From 90f28aacde1ba89e70d88e94fb6fe7f7755e27f4 Mon Sep 17 00:00:00 2001 From: Wonsuk Choi Date: Mon, 7 Sep 2026 02:53:25 +0900 Subject: [PATCH 1/9] docs(query-core): add JSDoc across the package and expose it in generated reference docs --- .../reference/classes/CancelledError.md | 273 +++ .../classes/InfiniteQueryObserver.md | 665 +++++++ .../angular/reference/classes/Mutation.md | 329 ++++ .../reference/classes/MutationCache.md | 308 ++++ .../reference/classes/MutationObserver.md | 333 ++++ .../reference/classes/QueriesObserver.md | 325 ++++ .../angular/reference/classes/Query.md | 585 ++++++ .../angular/reference/classes/QueryCache.md | 461 +++++ .../angular/reference/classes/QueryClient.md | 1455 +++++++++++++++ .../reference/classes/QueryObserver.md | 555 ++++++ .../defaultShouldDehydrateMutation.md | 23 + .../functions/defaultShouldDehydrateQuery.md | 23 + .../angular/reference/functions/dehydrate.md | 43 + .../reference/functions/dehydrateQuery.md | 43 + .../functions/experimental_streamedQuery.md | 52 + .../angular/reference/functions/hashKey.md | 30 + .../angular/reference/functions/hydrate.md | 49 + .../functions/infiniteQueryOptions.md | 12 +- .../functions/injectInfiniteQuery.md | 12 +- .../reference/functions/injectIsFetching.md | 6 +- .../reference/functions/injectIsMutating.md | 6 +- .../reference/functions/injectIsRestoring.md | 2 +- .../reference/functions/injectMutation.md | 2 +- .../functions/injectMutationState.md | 6 +- .../reference/functions/injectQuery.md | 6 +- .../reference/functions/injectQueryClient.md | 4 +- .../reference/functions/isCancelledError.md | 24 + .../reference/functions/keepPreviousData.md | 40 + .../reference/functions/matchMutation.md | 38 + .../angular/reference/functions/matchQuery.md | 37 + .../reference/functions/mutationOptions.md | 8 +- .../angular/reference/functions/noop.md | 32 + .../reference/functions/partialMatchKey.md | 26 + .../functions/provideAngularQuery.md | 4 +- .../reference/functions/provideIsRestoring.md | 2 +- .../reference/functions/provideQueryClient.md | 4 +- .../functions/provideTanStackQuery.md | 4 +- .../reference/functions/queryFeature.md | 2 +- .../reference/functions/queryOptions.md | 6 +- .../reference/functions/replaceEqualDeep.md | 41 + .../reference/functions/shouldThrowError.md | 45 + docs/framework/angular/reference/index.md | 156 ++ .../interfaces/BaseMutationNarrowing.md | 12 +- .../interfaces/BaseQueryNarrowing.md | 10 +- .../reference/interfaces/CancelOptions.md | 26 + .../interfaces/CreateBaseQueryOptions.md | 579 +++++- .../interfaces/CreateInfiniteQueryOptions.md | 609 ++++++- .../interfaces/CreateMutationOptions.md | 290 ++- .../interfaces/CreateQueryOptions.md | 597 +++++- .../reference/interfaces/DefaultOptions.md | 76 + .../reference/interfaces/DehydrateOptions.md | 89 + .../reference/interfaces/DehydratedState.md | 30 + .../interfaces/EnsureQueryDataOptions.md | 343 ++++ .../interfaces/FetchNextPageOptions.md | 41 + .../interfaces/FetchPreviousPageOptions.md | 41 + .../reference/interfaces/FetchQueryOptions.md | 357 ++++ .../reference/interfaces/HydrateOptions.md | 43 + .../reference/interfaces/InfiniteData.md | 36 + .../InfiniteQueryObserverBaseResult.md | 577 ++++++ ...InfiniteQueryObserverLoadingErrorResult.md | 600 ++++++ .../InfiniteQueryObserverLoadingResult.md | 600 ++++++ .../InfiniteQueryObserverOptions.md | 605 ++++++ .../InfiniteQueryObserverPendingResult.md | 600 ++++++ .../InfiniteQueryObserverPlaceholderResult.md | 600 ++++++ ...InfiniteQueryObserverRefetchErrorResult.md | 600 ++++++ .../InfiniteQueryObserverSuccessResult.md | 600 ++++++ .../InfiniteQueryPageParamsOptions.md | 64 + .../reference/interfaces/InitialPageParam.md | 26 + .../interfaces/InjectInfiniteQueryOptions.md | 4 +- .../interfaces/InjectIsFetchingOptions.md | 4 +- .../interfaces/InjectIsMutatingOptions.md | 4 +- .../interfaces/InjectMutationOptions.md | 4 +- .../interfaces/InjectMutationStateOptions.md | 4 +- .../interfaces/InjectQueryOptions.md | 4 +- .../reference/interfaces/InvalidateOptions.md | 44 + .../interfaces/InvalidateQueryFilters.md | 135 ++ .../reference/interfaces/MutateOptions.md | 124 ++ .../interfaces/MutationCacheConfig.md | 161 ++ .../reference/interfaces/MutationFilters.md | 85 + .../interfaces/MutationObserverBaseResult.md | 291 +++ .../interfaces/MutationObserverErrorResult.md | 308 ++++ .../interfaces/MutationObserverIdleResult.md | 308 ++++ .../MutationObserverLoadingResult.md | 308 ++++ .../interfaces/MutationObserverOptions.md | 290 +++ .../MutationObserverSuccessResult.md | 308 ++++ .../reference/interfaces/MutationOptions.md | 232 +++ .../reference/interfaces/MutationState.md | 142 ++ .../reference/interfaces/NotifyEvent.md | 16 + .../interfaces/QueriesObserverOptions.md | 27 + .../reference/interfaces/QueryCacheConfig.md | 92 + .../reference/interfaces/QueryClientConfig.md | 36 + .../interfaces/QueryExecuteOptions.md | 375 ++++ .../reference/interfaces/QueryFeature.md | 6 +- .../reference/interfaces/QueryFilters.md | 102 ++ .../interfaces/QueryObserverBaseResult.md | 358 ++++ .../QueryObserverLoadingErrorResult.md | 452 +++++ .../interfaces/QueryObserverLoadingResult.md | 452 +++++ .../interfaces/QueryObserverOptions.md | 542 ++++++ .../interfaces/QueryObserverPendingResult.md | 452 +++++ .../QueryObserverPlaceholderResult.md | 452 +++++ .../QueryObserverRefetchErrorResult.md | 452 +++++ .../interfaces/QueryObserverSuccessResult.md | 452 +++++ .../reference/interfaces/QueryOptions.md | 240 +++ .../reference/interfaces/QueryState.md | 175 ++ .../reference/interfaces/RefetchOptions.md | 45 + .../interfaces/RefetchQueryFilters.md | 125 ++ .../angular/reference/interfaces/Register.md | 6 + .../reference/interfaces/ResetOptions.md | 44 + .../reference/interfaces/ResultOptions.md | 22 + .../reference/interfaces/SetDataOptions.md | 16 + .../reference/type-aliases/AnyDataTag.md | 30 + .../type-aliases/CreateBaseMutationResult.md | 6 +- .../type-aliases/CreateBaseQueryResult.md | 8 +- .../type-aliases/CreateInfiniteQueryResult.md | 6 +- .../type-aliases/CreateMutateAsyncFunction.md | 4 +- .../type-aliases/CreateMutateFunction.md | 6 +- .../type-aliases/CreateMutationResult.md | 4 +- .../type-aliases/CreateQueryResult.md | 4 +- .../angular/reference/type-aliases/DataTag.md | 24 + .../reference/type-aliases/DefaultError.md | 10 + .../DefaultedInfiniteQueryObserverOptions.md | 32 + .../DefaultedQueryObserverOptions.md | 32 + .../DefinedCreateInfiniteQueryResult.md | 8 +- .../type-aliases/DefinedCreateQueryResult.md | 8 +- .../DefinedInfiniteQueryObserverResult.md | 22 + .../DefinedInitialDataInfiniteOptions.md | 8 +- .../type-aliases/DefinedInitialDataOptions.md | 6 +- .../DefinedQueryObserverResult.md | 22 + .../reference/type-aliases/DevtoolsFeature.md | 2 +- .../type-aliases/DistributiveOmit.md | 20 + .../EnsureInfiniteQueryDataOptions.md | 42 + .../type-aliases/FetchInfiniteQueryOptions.md | 34 + .../reference/type-aliases/FetchStatus.md | 10 + .../type-aliases/GetNextPageParamFunction.md | 42 + .../GetPreviousPageParamFunction.md | 42 + .../type-aliases/InferDataFromTag.md | 20 + .../type-aliases/InferErrorFromTag.md | 20 + .../InfiniteQueryExecuteOptions.md | 32 + .../InfiniteQueryObserverResult.md | 25 + .../type-aliases/InitialDataFunction.md | 20 + .../reference/type-aliases/ManagedTimerId.md | 19 + .../reference/type-aliases/MutateFunction.md | 38 + .../type-aliases/MutateFunctionRest.md | 28 + .../type-aliases/MutationCacheNotifyEvent.md | 20 + .../type-aliases/MutationFunction.md | 34 + .../type-aliases/MutationFunctionContext.md | 40 + .../reference/type-aliases/MutationKey.md | 10 + .../reference/type-aliases/MutationMeta.md | 10 + .../type-aliases/MutationObserverResult.md | 32 + .../reference/type-aliases/MutationScope.md | 20 + .../reference/type-aliases/MutationStatus.md | 10 + .../reference/type-aliases/NetworkMode.md | 10 + .../type-aliases/NonUndefinedGuard.md | 16 + .../reference/type-aliases/NotifyEventType.md | 17 + .../type-aliases/NotifyOnChangeProps.md | 17 + .../reference/type-aliases/OmitKeyof.md | 28 + .../reference/type-aliases/Override.md | 20 + .../type-aliases/PersistQueryClientFeature.md | 2 +- .../type-aliases/PlaceholderDataFunction.md | 42 + .../reference/type-aliases/QueriesOptions.md | 2 +- .../QueriesPlaceholderDataFunction.md | 30 + .../reference/type-aliases/QueriesResults.md | 2 +- .../type-aliases/QueryBooleanOption.md | 28 + .../type-aliases/QueryCacheNotifyEvent.md | 21 + .../reference/type-aliases/QueryFeatures.md | 2 +- .../reference/type-aliases/QueryFunction.md | 34 + .../type-aliases/QueryFunctionContext.md | 20 + .../reference/type-aliases/QueryKey.md | 10 + .../type-aliases/QueryKeyHashFunction.md | 26 + .../type-aliases/QueryKeyWithDataTag.md | 34 + .../reference/type-aliases/QueryMeta.md | 10 + .../type-aliases/QueryObserverResult.md | 25 + .../reference/type-aliases/QueryPersister.md | 24 + .../reference/type-aliases/QueryStatus.md | 10 + .../reference/type-aliases/SkipToken.md | 12 + .../reference/type-aliases/StaleTime.md | 10 + .../type-aliases/StaleTimeFunction.md | 28 + .../reference/type-aliases/ThrowOnError.md | 28 + .../reference/type-aliases/TimeoutCallback.md | 27 + .../reference/type-aliases/TimeoutProvider.md | 106 ++ .../UndefinedInitialDataInfiniteOptions.md | 8 +- .../UndefinedInitialDataOptions.md | 6 +- .../reference/type-aliases/UnsetMarker.md | 10 + .../UnusedSkipTokenInfiniteOptions.md | 8 +- .../type-aliases/UnusedSkipTokenOptions.md | 6 +- .../angular/reference/type-aliases/Updater.md | 35 + .../reference/type-aliases/WithRequired.md | 20 + .../type-aliases/dataTagErrorSymbol.md | 10 + .../reference/type-aliases/dataTagSymbol.md | 10 + .../reference/variables/dataTagErrorSymbol.md | 10 + .../reference/variables/dataTagSymbol.md | 10 + .../reference/variables/defaultScheduler.md | 13 + .../reference/variables/environmentManager.md | 38 + .../reference/variables/focusManager.md | 12 + .../angular/reference/variables/isServer.md | 14 + .../reference/variables/notifyManager.md | 156 ++ .../reference/variables/onlineManager.md | 12 + .../angular/reference/variables/skipToken.md | 23 + .../reference/variables/timeoutManager.md | 12 + .../reference/variables/unsetMarker.md | 10 + .../lit/reference/classes/CancelledError.md | 75 + .../classes/InfiniteQueryObserver.md | 665 +++++++ .../lit/reference/classes/Mutation.md | 329 ++++ .../lit/reference/classes/MutationCache.md | 308 ++++ .../lit/reference/classes/MutationObserver.md | 335 ++++ .../lit/reference/classes/QueriesObserver.md | 325 ++++ docs/framework/lit/reference/classes/Query.md | 585 ++++++ .../lit/reference/classes/QueryCache.md | 461 +++++ .../lit/reference/classes/QueryClient.md | 1455 +++++++++++++++ .../lit/reference/classes/QueryObserver.md | 555 ++++++ .../createInfiniteQueryController.md | 4 +- .../functions/createMutationController.md | 2 +- .../functions/createQueriesController.md | 2 +- .../functions/createQueryController.md | 2 +- .../defaultShouldDehydrateMutation.md | 23 + .../functions/defaultShouldDehydrateQuery.md | 23 + .../lit/reference/functions/dehydrate.md | 43 + .../lit/reference/functions/dehydrateQuery.md | 43 + .../functions/experimental_streamedQuery.md | 52 + .../functions/getDefaultQueryClient.md | 2 +- .../lit/reference/functions/hashKey.md | 30 + .../lit/reference/functions/hydrate.md | 49 + .../functions/infiniteQueryOptions.md | 6 +- .../reference/functions/isCancelledError.md | 24 + .../reference/functions/keepPreviousData.md | 40 + .../lit/reference/functions/matchMutation.md | 38 + .../lit/reference/functions/matchQuery.md | 37 + .../reference/functions/mutationOptions.md | 4 +- .../framework/lit/reference/functions/noop.md | 32 + .../reference/functions/partialMatchKey.md | 26 + .../lit/reference/functions/queryOptions.md | 6 +- .../functions/registerDefaultQueryClient.md | 2 +- .../reference/functions/replaceEqualDeep.md | 41 + .../reference/functions/resolveQueryClient.md | 4 +- .../reference/functions/shouldThrowError.md | 45 + .../functions/unregisterDefaultQueryClient.md | 2 +- .../lit/reference/functions/useIsFetching.md | 4 +- .../lit/reference/functions/useIsMutating.md | 4 +- .../reference/functions/useMutationState.md | 4 +- .../lit/reference/functions/useQueryClient.md | 2 +- docs/framework/lit/reference/index.md | 153 ++ .../lit/reference/interfaces/CancelOptions.md | 26 + .../reference/interfaces/DefaultOptions.md | 76 + .../reference/interfaces/DehydrateOptions.md | 89 + .../reference/interfaces/DehydratedState.md | 30 + .../interfaces/EnsureQueryDataOptions.md | 343 ++++ .../interfaces/FetchNextPageOptions.md | 41 + .../interfaces/FetchPreviousPageOptions.md | 41 + .../reference/interfaces/FetchQueryOptions.md | 357 ++++ .../reference/interfaces/HydrateOptions.md | 43 + .../lit/reference/interfaces/InfiniteData.md | 36 + .../InfiniteQueryObserverBaseResult.md | 577 ++++++ ...InfiniteQueryObserverLoadingErrorResult.md | 600 ++++++ .../InfiniteQueryObserverLoadingResult.md | 600 ++++++ .../InfiniteQueryObserverOptions.md | 605 ++++++ .../InfiniteQueryObserverPendingResult.md | 600 ++++++ .../InfiniteQueryObserverPlaceholderResult.md | 600 ++++++ ...InfiniteQueryObserverRefetchErrorResult.md | 600 ++++++ .../InfiniteQueryObserverSuccessResult.md | 600 ++++++ .../InfiniteQueryPageParamsOptions.md | 64 + .../reference/interfaces/InitialPageParam.md | 26 + .../reference/interfaces/InvalidateOptions.md | 44 + .../interfaces/InvalidateQueryFilters.md | 135 ++ .../lit/reference/interfaces/MutateOptions.md | 124 ++ .../interfaces/MutationCacheConfig.md | 161 ++ .../reference/interfaces/MutationFilters.md | 85 + .../interfaces/MutationObserverBaseResult.md | 291 +++ .../interfaces/MutationObserverErrorResult.md | 308 ++++ .../interfaces/MutationObserverIdleResult.md | 308 ++++ .../MutationObserverLoadingResult.md | 308 ++++ .../interfaces/MutationObserverOptions.md | 290 +++ .../MutationObserverSuccessResult.md | 308 ++++ .../reference/interfaces/MutationOptions.md | 232 +++ .../lit/reference/interfaces/MutationState.md | 142 ++ .../lit/reference/interfaces/NotifyEvent.md | 16 + .../interfaces/QueriesObserverOptions.md | 27 + .../reference/interfaces/QueryCacheConfig.md | 92 + .../reference/interfaces/QueryClientConfig.md | 36 + .../interfaces/QueryExecuteOptions.md | 375 ++++ .../lit/reference/interfaces/QueryFilters.md | 102 ++ .../interfaces/QueryObserverBaseResult.md | 358 ++++ .../QueryObserverLoadingErrorResult.md | 452 +++++ .../interfaces/QueryObserverLoadingResult.md | 452 +++++ .../interfaces/QueryObserverOptions.md | 541 ++++++ .../interfaces/QueryObserverPendingResult.md | 452 +++++ .../QueryObserverPlaceholderResult.md | 452 +++++ .../QueryObserverRefetchErrorResult.md | 452 +++++ .../interfaces/QueryObserverSuccessResult.md | 452 +++++ .../lit/reference/interfaces/QueryOptions.md | 240 +++ .../lit/reference/interfaces/QueryState.md | 175 ++ .../reference/interfaces/RefetchOptions.md | 45 + .../interfaces/RefetchQueryFilters.md | 125 ++ .../lit/reference/interfaces/Register.md | 6 + .../lit/reference/interfaces/ResetOptions.md | 44 + .../lit/reference/interfaces/ResultOptions.md | 22 + .../reference/interfaces/SetDataOptions.md | 16 + .../lit/reference/type-aliases/AnyDataTag.md | 30 + .../CreateInfiniteQueryOptions.md | 6 +- .../type-aliases/CreateMutationOptions.md | 2 +- .../type-aliases/CreateQueriesInput.md | 4 +- .../type-aliases/CreateQueryOptions.md | 4 +- .../lit/reference/type-aliases/DataTag.md | 24 + .../reference/type-aliases/DefaultError.md | 10 + .../DefaultedInfiniteQueryObserverOptions.md | 32 + .../DefaultedQueryObserverOptions.md | 32 + .../DefinedInfiniteQueryObserverResult.md | 22 + .../type-aliases/DefinedInitialDataOptions.md | 4 +- .../DefinedQueryObserverResult.md | 22 + .../type-aliases/DistributiveOmit.md | 20 + .../EnsureInfiniteQueryDataOptions.md | 42 + .../type-aliases/FetchInfiniteQueryOptions.md | 34 + .../lit/reference/type-aliases/FetchStatus.md | 10 + .../type-aliases/GetNextPageParamFunction.md | 42 + .../GetPreviousPageParamFunction.md | 42 + .../type-aliases/InferDataFromTag.md | 20 + .../type-aliases/InferErrorFromTag.md | 20 + .../InfiniteQueryControllerOptions.md | 6 +- .../InfiniteQueryExecuteOptions.md | 32 + .../InfiniteQueryObserverResult.md | 25 + .../type-aliases/InitialDataFunction.md | 20 + .../reference/type-aliases/ManagedTimerId.md | 19 + .../reference/type-aliases/MutateFunction.md | 38 + .../type-aliases/MutateFunctionRest.md | 28 + .../type-aliases/MutationCacheNotifyEvent.md | 20 + .../type-aliases/MutationControllerOptions.md | 2 +- .../type-aliases/MutationControllerResult.md | 2 +- .../type-aliases/MutationFunction.md | 34 + .../type-aliases/MutationFunctionContext.md | 40 + .../lit/reference/type-aliases/MutationKey.md | 10 + .../reference/type-aliases/MutationMeta.md | 10 + .../type-aliases/MutationObserverResult.md | 32 + .../type-aliases/MutationResultAccessor.md | 2 +- .../reference/type-aliases/MutationScope.md | 20 + .../type-aliases/MutationStateOptions.md | 2 +- .../reference/type-aliases/MutationStatus.md | 10 + .../lit/reference/type-aliases/NetworkMode.md | 10 + .../type-aliases/NonUndefinedGuard.md | 16 + .../reference/type-aliases/NotifyEventType.md | 17 + .../type-aliases/NotifyOnChangeProps.md | 17 + .../lit/reference/type-aliases/OmitKeyof.md | 28 + .../lit/reference/type-aliases/Override.md | 20 + .../type-aliases/PlaceholderDataFunction.md | 42 + .../QueriesPlaceholderDataFunction.md | 30 + .../type-aliases/QueryBooleanOption.md | 28 + .../type-aliases/QueryCacheNotifyEvent.md | 21 + .../type-aliases/QueryControllerOptions.md | 4 +- .../type-aliases/QueryControllerResult.md | 2 +- .../reference/type-aliases/QueryFunction.md | 34 + .../type-aliases/QueryFunctionContext.md | 20 + .../lit/reference/type-aliases/QueryKey.md | 10 + .../type-aliases/QueryKeyHashFunction.md | 26 + .../type-aliases/QueryKeyWithDataTag.md | 34 + .../lit/reference/type-aliases/QueryMeta.md | 10 + .../type-aliases/QueryObserverResult.md | 25 + .../reference/type-aliases/QueryPersister.md | 24 + .../type-aliases/QueryResultAccessor.md | 2 +- .../lit/reference/type-aliases/QueryStatus.md | 10 + .../lit/reference/type-aliases/SkipToken.md | 12 + .../lit/reference/type-aliases/StaleTime.md | 10 + .../type-aliases/StaleTimeFunction.md | 28 + .../reference/type-aliases/ThrowOnError.md | 28 + .../reference/type-aliases/TimeoutCallback.md | 27 + .../reference/type-aliases/TimeoutProvider.md | 106 ++ .../UndefinedInitialDataOptions.md | 4 +- .../lit/reference/type-aliases/UnsetMarker.md | 10 + .../type-aliases/UnusedSkipTokenOptions.md | 4 +- .../lit/reference/type-aliases/Updater.md | 35 + .../reference/type-aliases/WithRequired.md | 20 + .../type-aliases/dataTagErrorSymbol.md | 10 + .../reference/type-aliases/dataTagSymbol.md | 10 + .../reference/variables/dataTagErrorSymbol.md | 10 + .../lit/reference/variables/dataTagSymbol.md | 10 + .../reference/variables/defaultScheduler.md | 13 + .../reference/variables/environmentManager.md | 44 + .../lit/reference/variables/focusManager.md | 12 + .../lit/reference/variables/isServer.md | 14 + .../lit/reference/variables/notifyManager.md | 156 ++ .../lit/reference/variables/onlineManager.md | 12 + .../lit/reference/variables/skipToken.md | 23 + .../lit/reference/variables/timeoutManager.md | 12 + .../lit/reference/variables/unsetMarker.md | 10 + .../reference/classes/CancelledError.md | 273 +++ .../classes/InfiniteQueryObserver.md | 665 +++++++ .../preact/reference/classes/Mutation.md | 329 ++++ .../preact/reference/classes/MutationCache.md | 308 ++++ .../reference/classes/MutationObserver.md | 335 ++++ .../reference/classes/QueriesObserver.md | 325 ++++ .../preact/reference/classes/Query.md | 585 ++++++ .../preact/reference/classes/QueryCache.md | 461 +++++ .../preact/reference/classes/QueryClient.md | 1455 +++++++++++++++ .../preact/reference/classes/QueryObserver.md | 555 ++++++ .../reference/functions/HydrationBoundary.md | 2 +- .../functions/QueryClientProvider.md | 2 +- .../functions/QueryErrorResetBoundary.md | 2 +- .../defaultShouldDehydrateMutation.md | 23 + .../functions/defaultShouldDehydrateQuery.md | 23 + .../preact/reference/functions/dehydrate.md | 43 + .../reference/functions/dehydrateQuery.md | 43 + .../functions/experimental_streamedQuery.md | 52 + .../preact/reference/functions/hashKey.md | 30 + .../preact/reference/functions/hydrate.md | 49 + .../functions/infiniteQueryOptions.md | 12 +- .../reference/functions/isCancelledError.md | 24 + .../reference/functions/keepPreviousData.md | 40 + .../reference/functions/matchMutation.md | 38 + .../preact/reference/functions/matchQuery.md | 37 + .../reference/functions/mutationOptions.md | 8 +- .../preact/reference/functions/noop.md | 32 + .../reference/functions/partialMatchKey.md | 26 + .../reference/functions/queryOptions.md | 6 +- .../reference/functions/replaceEqualDeep.md | 41 + .../reference/functions/shouldThrowError.md | 45 + .../reference/functions/useInfiniteQuery.md | 18 +- .../reference/functions/useIsFetching.md | 8 +- .../reference/functions/useIsMutating.md | 8 +- .../reference/functions/useIsRestoring.md | 2 +- .../preact/reference/functions/useMutation.md | 4 +- .../reference/functions/useMutationState.md | 10 +- .../functions/usePrefetchInfiniteQuery.md | 4 +- .../reference/functions/usePrefetchQuery.md | 4 +- .../preact/reference/functions/useQueries.md | 6 +- .../preact/reference/functions/useQuery.md | 12 +- .../reference/functions/useQueryClient.md | 6 +- .../functions/useQueryErrorResetBoundary.md | 2 +- .../functions/useSuspenseInfiniteQuery.md | 6 +- .../reference/functions/useSuspenseQueries.md | 8 +- .../reference/functions/useSuspenseQuery.md | 4 +- docs/framework/preact/reference/index.md | 153 ++ .../reference/interfaces/CancelOptions.md | 26 + .../reference/interfaces/DefaultOptions.md | 76 + .../reference/interfaces/DehydrateOptions.md | 89 + .../reference/interfaces/DehydratedState.md | 30 + .../interfaces/EnsureQueryDataOptions.md | 343 ++++ .../interfaces/FetchNextPageOptions.md | 41 + .../interfaces/FetchPreviousPageOptions.md | 41 + .../reference/interfaces/FetchQueryOptions.md | 357 ++++ .../reference/interfaces/HydrateOptions.md | 43 + .../interfaces/HydrationBoundaryProps.md | 13 +- .../reference/interfaces/InfiniteData.md | 36 + .../InfiniteQueryObserverBaseResult.md | 577 ++++++ ...InfiniteQueryObserverLoadingErrorResult.md | 600 ++++++ .../InfiniteQueryObserverLoadingResult.md | 600 ++++++ .../InfiniteQueryObserverOptions.md | 605 ++++++ .../InfiniteQueryObserverPendingResult.md | 600 ++++++ .../InfiniteQueryObserverPlaceholderResult.md | 600 ++++++ ...InfiniteQueryObserverRefetchErrorResult.md | 600 ++++++ .../InfiniteQueryObserverSuccessResult.md | 600 ++++++ .../InfiniteQueryPageParamsOptions.md | 64 + .../reference/interfaces/InitialPageParam.md | 26 + .../reference/interfaces/InvalidateOptions.md | 44 + .../interfaces/InvalidateQueryFilters.md | 135 ++ .../reference/interfaces/MutateOptions.md | 124 ++ .../interfaces/MutationCacheConfig.md | 161 ++ .../reference/interfaces/MutationFilters.md | 85 + .../interfaces/MutationObserverBaseResult.md | 291 +++ .../interfaces/MutationObserverErrorResult.md | 308 ++++ .../interfaces/MutationObserverIdleResult.md | 308 ++++ .../MutationObserverLoadingResult.md | 308 ++++ .../interfaces/MutationObserverOptions.md | 290 +++ .../MutationObserverSuccessResult.md | 308 ++++ .../reference/interfaces/MutationOptions.md | 232 +++ .../reference/interfaces/MutationState.md | 142 ++ .../reference/interfaces/NotifyEvent.md | 16 + .../interfaces/QueriesObserverOptions.md | 27 + .../reference/interfaces/QueryCacheConfig.md | 92 + .../reference/interfaces/QueryClientConfig.md | 36 + .../QueryErrorResetBoundaryProps.md | 4 +- .../interfaces/QueryExecuteOptions.md | 375 ++++ .../reference/interfaces/QueryFilters.md | 102 ++ .../interfaces/QueryObserverBaseResult.md | 358 ++++ .../QueryObserverLoadingErrorResult.md | 452 +++++ .../interfaces/QueryObserverLoadingResult.md | 452 +++++ .../interfaces/QueryObserverOptions.md | 542 ++++++ .../interfaces/QueryObserverPendingResult.md | 452 +++++ .../QueryObserverPlaceholderResult.md | 452 +++++ .../QueryObserverRefetchErrorResult.md | 452 +++++ .../interfaces/QueryObserverSuccessResult.md | 452 +++++ .../reference/interfaces/QueryOptions.md | 240 +++ .../preact/reference/interfaces/QueryState.md | 175 ++ .../reference/interfaces/RefetchOptions.md | 45 + .../interfaces/RefetchQueryFilters.md | 125 ++ .../preact/reference/interfaces/Register.md | 6 + .../reference/interfaces/ResetOptions.md | 44 + .../reference/interfaces/ResultOptions.md | 22 + .../reference/interfaces/SetDataOptions.md | 16 + .../interfaces/UseBaseQueryOptions.md | 581 +++++- .../interfaces/UseInfiniteQueryOptions.md | 613 ++++++- .../interfaces/UseMutationOptions.md | 290 ++- .../reference/interfaces/UseQueryOptions.md | 599 +++++- .../UseSuspenseInfiniteQueryOptions.md | 526 +++++- .../interfaces/UseSuspenseQueryOptions.md | 514 +++++- .../reference/type-aliases/AnyDataTag.md | 30 + .../type-aliases/AnyUseBaseQueryOptions.md | 2 +- .../AnyUseInfiniteQueryOptions.md | 2 +- .../type-aliases/AnyUseMutationOptions.md | 2 +- .../type-aliases/AnyUseQueryOptions.md | 2 +- .../AnyUseSuspenseInfiniteQueryOptions.md | 2 +- .../AnyUseSuspenseQueryOptions.md | 2 +- .../preact/reference/type-aliases/DataTag.md | 24 + .../reference/type-aliases/DefaultError.md | 10 + .../DefaultedInfiniteQueryObserverOptions.md | 32 + .../DefaultedQueryObserverOptions.md | 32 + .../DefinedInfiniteQueryObserverResult.md | 22 + .../DefinedInitialDataInfiniteOptions.md | 8 +- .../type-aliases/DefinedInitialDataOptions.md | 6 +- .../DefinedQueryObserverResult.md | 22 + .../DefinedUseInfiniteQueryResult.md | 6 +- .../type-aliases/DefinedUseQueryResult.md | 6 +- .../type-aliases/DistributiveOmit.md | 20 + .../EnsureInfiniteQueryDataOptions.md | 42 + .../type-aliases/FetchInfiniteQueryOptions.md | 34 + .../reference/type-aliases/FetchStatus.md | 10 + .../type-aliases/GetNextPageParamFunction.md | 42 + .../GetPreviousPageParamFunction.md | 42 + .../type-aliases/InferDataFromTag.md | 20 + .../type-aliases/InferErrorFromTag.md | 20 + .../InfiniteQueryExecuteOptions.md | 32 + .../InfiniteQueryObserverResult.md | 25 + .../type-aliases/InitialDataFunction.md | 20 + .../reference/type-aliases/ManagedTimerId.md | 19 + .../reference/type-aliases/MutateFunction.md | 38 + .../type-aliases/MutateFunctionRest.md | 28 + .../type-aliases/MutationCacheNotifyEvent.md | 20 + .../type-aliases/MutationFunction.md | 34 + .../type-aliases/MutationFunctionContext.md | 40 + .../reference/type-aliases/MutationKey.md | 10 + .../reference/type-aliases/MutationMeta.md | 10 + .../type-aliases/MutationObserverResult.md | 32 + .../reference/type-aliases/MutationScope.md | 20 + .../reference/type-aliases/MutationStatus.md | 10 + .../reference/type-aliases/NetworkMode.md | 10 + .../type-aliases/NonUndefinedGuard.md | 16 + .../reference/type-aliases/NotifyEventType.md | 17 + .../type-aliases/NotifyOnChangeProps.md | 17 + .../reference/type-aliases/OmitKeyof.md | 28 + .../preact/reference/type-aliases/Override.md | 20 + .../type-aliases/PlaceholderDataFunction.md | 42 + .../reference/type-aliases/QueriesOptions.md | 2 +- .../QueriesPlaceholderDataFunction.md | 30 + .../reference/type-aliases/QueriesResults.md | 2 +- .../type-aliases/QueryBooleanOption.md | 28 + .../type-aliases/QueryCacheNotifyEvent.md | 21 + .../type-aliases/QueryClientProviderProps.md | 6 +- .../QueryErrorClearResetFunction.md | 2 +- .../type-aliases/QueryErrorIsResetFunction.md | 2 +- .../QueryErrorResetBoundaryFunction.md | 2 +- .../type-aliases/QueryErrorResetFunction.md | 2 +- .../reference/type-aliases/QueryFunction.md | 34 + .../type-aliases/QueryFunctionContext.md | 20 + .../preact/reference/type-aliases/QueryKey.md | 10 + .../type-aliases/QueryKeyHashFunction.md | 26 + .../type-aliases/QueryKeyWithDataTag.md | 34 + .../reference/type-aliases/QueryMeta.md | 10 + .../type-aliases/QueryObserverResult.md | 25 + .../reference/type-aliases/QueryPersister.md | 24 + .../reference/type-aliases/QueryStatus.md | 10 + .../reference/type-aliases/SkipToken.md | 12 + .../reference/type-aliases/StaleTime.md | 10 + .../type-aliases/StaleTimeFunction.md | 28 + .../type-aliases/SuspenseQueriesOptions.md | 2 +- .../type-aliases/SuspenseQueriesResults.md | 2 +- .../reference/type-aliases/ThrowOnError.md | 28 + .../reference/type-aliases/TimeoutCallback.md | 27 + .../reference/type-aliases/TimeoutProvider.md | 106 ++ .../UndefinedInitialDataInfiniteOptions.md | 8 +- .../UndefinedInitialDataOptions.md | 6 +- .../reference/type-aliases/UnsetMarker.md | 10 + .../UnusedSkipTokenInfiniteOptions.md | 8 +- .../type-aliases/UnusedSkipTokenOptions.md | 6 +- .../preact/reference/type-aliases/Updater.md | 35 + .../type-aliases/UseBaseMutationResult.md | 6 +- .../type-aliases/UseBaseQueryResult.md | 6 +- .../type-aliases/UseInfiniteQueryResult.md | 6 +- .../type-aliases/UseMutateAsyncFunction.md | 4 +- .../type-aliases/UseMutateFunction.md | 6 +- .../type-aliases/UseMutationResult.md | 4 +- .../UsePrefetchInfiniteQueryOptions.md | 6 +- .../type-aliases/UsePrefetchQueryOptions.md | 6 +- .../reference/type-aliases/UseQueryResult.md | 4 +- .../UseSuspenseInfiniteQueryResult.md | 4 +- .../type-aliases/UseSuspenseQueryResult.md | 4 +- .../reference/type-aliases/WithRequired.md | 20 + .../type-aliases/dataTagErrorSymbol.md | 10 + .../reference/type-aliases/dataTagSymbol.md | 10 + .../variables/IsRestoringProvider.md | 2 +- .../reference/variables/QueryClientContext.md | 2 +- .../reference/variables/dataTagErrorSymbol.md | 10 + .../reference/variables/dataTagSymbol.md | 10 + .../reference/variables/defaultScheduler.md | 13 + .../reference/variables/environmentManager.md | 44 + .../reference/variables/focusManager.md | 12 + .../preact/reference/variables/isServer.md | 14 + .../reference/variables/notifyManager.md | 156 ++ .../reference/variables/onlineManager.md | 12 + .../preact/reference/variables/skipToken.md | 23 + .../reference/variables/timeoutManager.md | 12 + .../preact/reference/variables/unsetMarker.md | 10 + .../react/reference/classes/CancelledError.md | 273 +++ .../classes/InfiniteQueryObserver.md | 665 +++++++ .../react/reference/classes/Mutation.md | 329 ++++ .../react/reference/classes/MutationCache.md | 308 ++++ .../reference/classes/MutationObserver.md | 335 ++++ .../reference/classes/QueriesObserver.md | 325 ++++ .../react/reference/classes/Query.md | 585 ++++++ .../react/reference/classes/QueryCache.md | 461 +++++ .../react/reference/classes/QueryClient.md | 1455 +++++++++++++++ .../react/reference/classes/QueryObserver.md | 555 ++++++ .../reference/functions/HydrationBoundary.md | 2 +- .../functions/QueryClientProvider.md | 2 +- .../functions/QueryErrorResetBoundary.md | 2 +- .../defaultShouldDehydrateMutation.md | 23 + .../functions/defaultShouldDehydrateQuery.md | 23 + .../react/reference/functions/dehydrate.md | 43 + .../reference/functions/dehydrateQuery.md | 43 + .../functions/experimental_streamedQuery.md | 52 + .../react/reference/functions/hashKey.md | 30 + .../react/reference/functions/hydrate.md | 49 + .../functions/infiniteQueryOptions.md | 12 +- .../reference/functions/isCancelledError.md | 24 + .../reference/functions/keepPreviousData.md | 40 + .../reference/functions/matchMutation.md | 38 + .../react/reference/functions/matchQuery.md | 37 + .../reference/functions/mutationOptions.md | 8 +- .../react/reference/functions/noop.md | 32 + .../reference/functions/partialMatchKey.md | 26 + .../react/reference/functions/queryOptions.md | 6 +- .../reference/functions/replaceEqualDeep.md | 41 + .../reference/functions/shouldThrowError.md | 45 + .../reference/functions/useInfiniteQuery.md | 18 +- .../reference/functions/useIsFetching.md | 8 +- .../reference/functions/useIsMutating.md | 8 +- .../reference/functions/useIsRestoring.md | 2 +- .../react/reference/functions/useMutation.md | 4 +- .../reference/functions/useMutationState.md | 10 +- .../functions/usePrefetchInfiniteQuery.md | 6 +- .../reference/functions/usePrefetchQuery.md | 4 +- .../react/reference/functions/useQueries.md | 6 +- .../react/reference/functions/useQuery.md | 12 +- .../reference/functions/useQueryClient.md | 6 +- .../functions/useQueryErrorResetBoundary.md | 2 +- .../functions/useSuspenseInfiniteQuery.md | 6 +- .../reference/functions/useSuspenseQueries.md | 8 +- .../reference/functions/useSuspenseQuery.md | 4 +- docs/framework/react/reference/index.md | 153 ++ .../reference/interfaces/CancelOptions.md | 26 + .../reference/interfaces/DefaultOptions.md | 76 + .../reference/interfaces/DehydrateOptions.md | 89 + .../reference/interfaces/DehydratedState.md | 30 + .../interfaces/EnsureQueryDataOptions.md | 343 ++++ .../interfaces/FetchNextPageOptions.md | 41 + .../interfaces/FetchPreviousPageOptions.md | 41 + .../reference/interfaces/FetchQueryOptions.md | 357 ++++ .../reference/interfaces/HydrateOptions.md | 43 + .../interfaces/HydrationBoundaryProps.md | 13 +- .../reference/interfaces/InfiniteData.md | 36 + .../InfiniteQueryObserverBaseResult.md | 577 ++++++ ...InfiniteQueryObserverLoadingErrorResult.md | 600 ++++++ .../InfiniteQueryObserverLoadingResult.md | 600 ++++++ .../InfiniteQueryObserverOptions.md | 605 ++++++ .../InfiniteQueryObserverPendingResult.md | 600 ++++++ .../InfiniteQueryObserverPlaceholderResult.md | 600 ++++++ ...InfiniteQueryObserverRefetchErrorResult.md | 600 ++++++ .../InfiniteQueryObserverSuccessResult.md | 600 ++++++ .../InfiniteQueryPageParamsOptions.md | 64 + .../reference/interfaces/InitialPageParam.md | 26 + .../reference/interfaces/InvalidateOptions.md | 44 + .../interfaces/InvalidateQueryFilters.md | 135 ++ .../reference/interfaces/MutateOptions.md | 124 ++ .../interfaces/MutationCacheConfig.md | 161 ++ .../reference/interfaces/MutationFilters.md | 85 + .../interfaces/MutationObserverBaseResult.md | 291 +++ .../interfaces/MutationObserverErrorResult.md | 308 ++++ .../interfaces/MutationObserverIdleResult.md | 308 ++++ .../MutationObserverLoadingResult.md | 308 ++++ .../interfaces/MutationObserverOptions.md | 290 +++ .../MutationObserverSuccessResult.md | 308 ++++ .../reference/interfaces/MutationOptions.md | 232 +++ .../reference/interfaces/MutationState.md | 142 ++ .../react/reference/interfaces/NotifyEvent.md | 16 + .../interfaces/QueriesObserverOptions.md | 27 + .../reference/interfaces/QueryCacheConfig.md | 92 + .../reference/interfaces/QueryClientConfig.md | 36 + .../QueryErrorResetBoundaryProps.md | 4 +- .../interfaces/QueryExecuteOptions.md | 375 ++++ .../reference/interfaces/QueryFilters.md | 102 ++ .../interfaces/QueryObserverBaseResult.md | 358 ++++ .../QueryObserverLoadingErrorResult.md | 452 +++++ .../interfaces/QueryObserverLoadingResult.md | 452 +++++ .../interfaces/QueryObserverOptions.md | 542 ++++++ .../interfaces/QueryObserverPendingResult.md | 452 +++++ .../QueryObserverPlaceholderResult.md | 452 +++++ .../QueryObserverRefetchErrorResult.md | 452 +++++ .../interfaces/QueryObserverSuccessResult.md | 452 +++++ .../reference/interfaces/QueryOptions.md | 240 +++ .../react/reference/interfaces/QueryState.md | 175 ++ .../reference/interfaces/RefetchOptions.md | 45 + .../interfaces/RefetchQueryFilters.md | 125 ++ .../react/reference/interfaces/Register.md | 6 + .../reference/interfaces/ResetOptions.md | 44 + .../reference/interfaces/ResultOptions.md | 22 + .../reference/interfaces/SetDataOptions.md | 16 + .../interfaces/UseBaseQueryOptions.md | 581 +++++- .../interfaces/UseInfiniteQueryOptions.md | 613 ++++++- .../interfaces/UseMutationOptions.md | 290 ++- .../reference/interfaces/UseQueryOptions.md | 599 +++++- .../UseSuspenseInfiniteQueryOptions.md | 526 +++++- .../interfaces/UseSuspenseQueryOptions.md | 514 +++++- .../reference/type-aliases/AnyDataTag.md | 30 + .../type-aliases/AnyUseBaseQueryOptions.md | 2 +- .../AnyUseInfiniteQueryOptions.md | 2 +- .../type-aliases/AnyUseMutationOptions.md | 2 +- .../type-aliases/AnyUseQueryOptions.md | 2 +- .../AnyUseSuspenseInfiniteQueryOptions.md | 2 +- .../AnyUseSuspenseQueryOptions.md | 2 +- .../react/reference/type-aliases/DataTag.md | 24 + .../reference/type-aliases/DefaultError.md | 10 + .../DefaultedInfiniteQueryObserverOptions.md | 32 + .../DefaultedQueryObserverOptions.md | 32 + .../DefinedInfiniteQueryObserverResult.md | 22 + .../DefinedInitialDataInfiniteOptions.md | 8 +- .../type-aliases/DefinedInitialDataOptions.md | 6 +- .../DefinedQueryObserverResult.md | 22 + .../DefinedUseInfiniteQueryResult.md | 6 +- .../type-aliases/DefinedUseQueryResult.md | 6 +- .../type-aliases/DistributiveOmit.md | 20 + .../EnsureInfiniteQueryDataOptions.md | 42 + .../type-aliases/FetchInfiniteQueryOptions.md | 34 + .../reference/type-aliases/FetchStatus.md | 10 + .../type-aliases/GetNextPageParamFunction.md | 42 + .../GetPreviousPageParamFunction.md | 42 + .../type-aliases/InferDataFromTag.md | 20 + .../type-aliases/InferErrorFromTag.md | 20 + .../InfiniteQueryExecuteOptions.md | 32 + .../InfiniteQueryObserverResult.md | 25 + .../type-aliases/InitialDataFunction.md | 20 + .../reference/type-aliases/ManagedTimerId.md | 19 + .../reference/type-aliases/MutateFunction.md | 38 + .../type-aliases/MutateFunctionRest.md | 28 + .../type-aliases/MutationCacheNotifyEvent.md | 20 + .../type-aliases/MutationFunction.md | 34 + .../type-aliases/MutationFunctionContext.md | 40 + .../reference/type-aliases/MutationKey.md | 10 + .../reference/type-aliases/MutationMeta.md | 10 + .../type-aliases/MutationObserverResult.md | 32 + .../reference/type-aliases/MutationScope.md | 20 + .../reference/type-aliases/MutationStatus.md | 10 + .../reference/type-aliases/NetworkMode.md | 10 + .../type-aliases/NonUndefinedGuard.md | 16 + .../reference/type-aliases/NotifyEventType.md | 17 + .../type-aliases/NotifyOnChangeProps.md | 17 + .../react/reference/type-aliases/OmitKeyof.md | 28 + .../react/reference/type-aliases/Override.md | 20 + .../type-aliases/PlaceholderDataFunction.md | 42 + .../reference/type-aliases/QueriesOptions.md | 2 +- .../QueriesPlaceholderDataFunction.md | 30 + .../reference/type-aliases/QueriesResults.md | 2 +- .../type-aliases/QueryBooleanOption.md | 28 + .../type-aliases/QueryCacheNotifyEvent.md | 21 + .../type-aliases/QueryClientProviderProps.md | 6 +- .../QueryErrorClearResetFunction.md | 2 +- .../type-aliases/QueryErrorIsResetFunction.md | 2 +- .../QueryErrorResetBoundaryFunction.md | 2 +- .../type-aliases/QueryErrorResetFunction.md | 2 +- .../reference/type-aliases/QueryFunction.md | 34 + .../type-aliases/QueryFunctionContext.md | 20 + .../react/reference/type-aliases/QueryKey.md | 10 + .../type-aliases/QueryKeyHashFunction.md | 26 + .../type-aliases/QueryKeyWithDataTag.md | 34 + .../react/reference/type-aliases/QueryMeta.md | 10 + .../type-aliases/QueryObserverResult.md | 25 + .../reference/type-aliases/QueryPersister.md | 24 + .../reference/type-aliases/QueryStatus.md | 10 + .../react/reference/type-aliases/SkipToken.md | 12 + .../react/reference/type-aliases/StaleTime.md | 10 + .../type-aliases/StaleTimeFunction.md | 28 + .../type-aliases/SuspenseQueriesOptions.md | 2 +- .../type-aliases/SuspenseQueriesResults.md | 2 +- .../reference/type-aliases/ThrowOnError.md | 28 + .../reference/type-aliases/TimeoutCallback.md | 27 + .../reference/type-aliases/TimeoutProvider.md | 106 ++ .../UndefinedInitialDataInfiniteOptions.md | 8 +- .../UndefinedInitialDataOptions.md | 6 +- .../reference/type-aliases/UnsetMarker.md | 10 + .../UnusedSkipTokenInfiniteOptions.md | 8 +- .../type-aliases/UnusedSkipTokenOptions.md | 6 +- .../react/reference/type-aliases/Updater.md | 35 + .../type-aliases/UseBaseMutationResult.md | 6 +- .../type-aliases/UseBaseQueryResult.md | 6 +- .../type-aliases/UseInfiniteQueryResult.md | 6 +- .../type-aliases/UseMutateAsyncFunction.md | 4 +- .../type-aliases/UseMutateFunction.md | 6 +- .../type-aliases/UseMutationResult.md | 4 +- .../UsePrefetchInfiniteQueryOptions.md | 8 +- .../type-aliases/UsePrefetchQueryOptions.md | 6 +- .../reference/type-aliases/UseQueryResult.md | 4 +- .../UseSuspenseInfiniteQueryResult.md | 4 +- .../type-aliases/UseSuspenseQueryResult.md | 4 +- .../reference/type-aliases/WithRequired.md | 20 + .../type-aliases/dataTagErrorSymbol.md | 10 + .../reference/type-aliases/dataTagSymbol.md | 10 + .../variables/IsRestoringProvider.md | 2 +- .../reference/variables/QueryClientContext.md | 2 +- .../reference/variables/dataTagErrorSymbol.md | 10 + .../reference/variables/dataTagSymbol.md | 10 + .../reference/variables/defaultScheduler.md | 13 + .../reference/variables/environmentManager.md | 44 + .../react/reference/variables/focusManager.md | 12 + .../react/reference/variables/isServer.md | 14 + .../reference/variables/notifyManager.md | 156 ++ .../reference/variables/onlineManager.md | 12 + .../react/reference/variables/skipToken.md | 23 + .../reference/variables/timeoutManager.md | 12 + .../react/reference/variables/unsetMarker.md | 10 + .../solid/reference/classes/CancelledError.md | 273 +++ .../classes/InfiniteQueryObserver.md | 665 +++++++ .../solid/reference/classes/Mutation.md | 329 ++++ .../solid/reference/classes/MutationCache.md | 308 ++++ .../reference/classes/MutationObserver.md | 335 ++++ .../reference/classes/QueriesObserver.md | 325 ++++ .../solid/reference/classes/Query.md | 585 ++++++ .../solid/reference/classes/QueryCache.md | 461 +++++ .../solid/reference/classes/QueryClient.md | 1621 ++++++++++++++++- .../solid/reference/classes/QueryObserver.md | 555 ++++++ .../functions/QueryClientProvider.md | 2 +- .../defaultShouldDehydrateMutation.md | 23 + .../functions/defaultShouldDehydrateQuery.md | 23 + .../solid/reference/functions/dehydrate.md | 43 + .../reference/functions/dehydrateQuery.md | 43 + .../functions/experimental_streamedQuery.md | 52 + .../solid/reference/functions/hashKey.md | 30 + .../solid/reference/functions/hydrate.md | 49 + .../functions/infiniteQueryOptions.md | 12 +- .../reference/functions/isCancelledError.md | 24 + .../reference/functions/keepPreviousData.md | 40 + .../reference/functions/matchMutation.md | 38 + .../solid/reference/functions/matchQuery.md | 37 + .../reference/functions/mutationOptions.md | 8 +- .../solid/reference/functions/noop.md | 32 + .../reference/functions/partialMatchKey.md | 26 + .../solid/reference/functions/queryOptions.md | 8 +- .../reference/functions/replaceEqualDeep.md | 41 + .../reference/functions/shouldThrowError.md | 45 + .../reference/functions/useInfiniteQuery.md | 8 +- .../reference/functions/useIsFetching.md | 6 +- .../reference/functions/useIsMutating.md | 6 +- .../reference/functions/useIsRestoring.md | 2 +- .../solid/reference/functions/useMutation.md | 2 +- .../reference/functions/useMutationState.md | 8 +- .../solid/reference/functions/useQueries.md | 50 +- .../solid/reference/functions/useQuery.md | 4 +- .../reference/functions/useQueryClient.md | 2 +- docs/framework/solid/reference/index.md | 143 ++ .../reference/interfaces/CancelOptions.md | 26 + .../reference/interfaces/DefaultOptions.md | 78 +- .../reference/interfaces/DehydrateOptions.md | 89 + .../reference/interfaces/DehydratedState.md | 30 + .../interfaces/EnsureQueryDataOptions.md | 343 ++++ .../interfaces/FetchNextPageOptions.md | 41 + .../interfaces/FetchPreviousPageOptions.md | 41 + .../reference/interfaces/FetchQueryOptions.md | 357 ++++ .../reference/interfaces/HydrateOptions.md | 43 + .../reference/interfaces/InfiniteData.md | 36 + .../InfiniteQueryObserverBaseResult.md | 577 ++++++ ...InfiniteQueryObserverLoadingErrorResult.md | 600 ++++++ .../InfiniteQueryObserverLoadingResult.md | 600 ++++++ .../InfiniteQueryObserverOptions.md | 613 ++++++- .../InfiniteQueryObserverPendingResult.md | 600 ++++++ .../InfiniteQueryObserverPlaceholderResult.md | 600 ++++++ ...InfiniteQueryObserverRefetchErrorResult.md | 600 ++++++ .../InfiniteQueryObserverSuccessResult.md | 600 ++++++ .../interfaces/InfiniteQueryOptions.md | 576 +++++- .../InfiniteQueryPageParamsOptions.md | 60 + .../reference/interfaces/InitialPageParam.md | 26 + .../reference/interfaces/InvalidateOptions.md | 44 + .../interfaces/InvalidateQueryFilters.md | 135 ++ .../reference/interfaces/MutateOptions.md | 124 ++ .../interfaces/MutationCacheConfig.md | 161 ++ .../reference/interfaces/MutationFilters.md | 85 + .../interfaces/MutationObserverBaseResult.md | 291 +++ .../interfaces/MutationObserverErrorResult.md | 308 ++++ .../interfaces/MutationObserverIdleResult.md | 308 ++++ .../MutationObserverLoadingResult.md | 308 ++++ .../interfaces/MutationObserverOptions.md | 314 ++++ .../MutationObserverSuccessResult.md | 308 ++++ .../reference/interfaces/MutationOptions.md | 288 ++- .../reference/interfaces/MutationState.md | 142 ++ .../solid/reference/interfaces/NotifyEvent.md | 16 + .../interfaces/QueriesObserverOptions.md | 27 + .../reference/interfaces/QueryCacheConfig.md | 92 + .../reference/interfaces/QueryClientConfig.md | 36 +- .../interfaces/QueryExecuteOptions.md | 375 ++++ .../reference/interfaces/QueryFilters.md | 102 ++ .../interfaces/QueryObserverBaseResult.md | 358 ++++ .../QueryObserverLoadingErrorResult.md | 452 +++++ .../interfaces/QueryObserverLoadingResult.md | 452 +++++ .../interfaces/QueryObserverOptions.md | 559 +++++- .../interfaces/QueryObserverPendingResult.md | 452 +++++ .../QueryObserverPlaceholderResult.md | 452 +++++ .../QueryObserverRefetchErrorResult.md | 452 +++++ .../interfaces/QueryObserverSuccessResult.md | 452 +++++ .../reference/interfaces/QueryOptions.md | 545 +++++- .../solid/reference/interfaces/QueryState.md | 175 ++ .../reference/interfaces/RefetchOptions.md | 45 + .../interfaces/RefetchQueryFilters.md | 125 ++ .../solid/reference/interfaces/Register.md | 6 + .../reference/interfaces/ResetOptions.md | 44 + .../reference/interfaces/ResultOptions.md | 22 + .../reference/interfaces/SetDataOptions.md | 16 + .../interfaces/UseBaseQueryOptions.md | 587 +++++- .../reference/type-aliases/AnyDataTag.md | 30 + .../solid/reference/type-aliases/DataTag.md | 24 + .../reference/type-aliases/DefaultError.md | 10 + .../DefaultedInfiniteQueryObserverOptions.md | 32 + .../DefaultedQueryObserverOptions.md | 32 + .../DefinedInfiniteQueryObserverResult.md | 22 + .../DefinedInitialDataInfiniteOptions.md | 8 +- .../type-aliases/DefinedInitialDataOptions.md | 6 +- .../DefinedQueryObserverResult.md | 22 + .../type-aliases/DefinedUseBaseQueryResult.md | 4 +- .../DefinedUseInfiniteQueryResult.md | 4 +- .../type-aliases/DefinedUseQueryResult.md | 4 +- .../type-aliases/DistributiveOmit.md | 20 + .../EnsureInfiniteQueryDataOptions.md | 42 + .../type-aliases/FetchInfiniteQueryOptions.md | 34 + .../reference/type-aliases/FetchStatus.md | 10 + .../type-aliases/GetNextPageParamFunction.md | 42 + .../GetPreviousPageParamFunction.md | 42 + .../type-aliases/InferDataFromTag.md | 20 + .../type-aliases/InferErrorFromTag.md | 20 + .../InfiniteQueryExecuteOptions.md | 32 + .../InfiniteQueryObserverResult.md | 25 + .../type-aliases/InitialDataFunction.md | 20 + .../reference/type-aliases/ManagedTimerId.md | 19 + .../reference/type-aliases/MutateFunction.md | 38 + .../type-aliases/MutateFunctionRest.md | 28 + .../type-aliases/MutationCacheNotifyEvent.md | 20 + .../type-aliases/MutationFunction.md | 34 + .../type-aliases/MutationFunctionContext.md | 40 + .../reference/type-aliases/MutationKey.md | 10 + .../reference/type-aliases/MutationMeta.md | 10 + .../type-aliases/MutationObserverResult.md | 32 + .../reference/type-aliases/MutationScope.md | 20 + .../reference/type-aliases/MutationStatus.md | 10 + .../reference/type-aliases/NetworkMode.md | 10 + .../type-aliases/NonUndefinedGuard.md | 16 + .../reference/type-aliases/NotifyEventType.md | 17 + .../type-aliases/NotifyOnChangeProps.md | 17 + .../solid/reference/type-aliases/OmitKeyof.md | 28 + .../solid/reference/type-aliases/Override.md | 20 + .../type-aliases/PlaceholderDataFunction.md | 42 + .../QueriesPlaceholderDataFunction.md | 30 + .../type-aliases/QueryBooleanOption.md | 28 + .../type-aliases/QueryCacheNotifyEvent.md | 21 + .../type-aliases/QueryClientProviderProps.md | 6 +- .../reference/type-aliases/QueryFunction.md | 34 + .../type-aliases/QueryFunctionContext.md | 20 + .../solid/reference/type-aliases/QueryKey.md | 10 + .../type-aliases/QueryKeyHashFunction.md | 26 + .../type-aliases/QueryKeyWithDataTag.md | 34 + .../solid/reference/type-aliases/QueryMeta.md | 10 + .../type-aliases/QueryObserverResult.md | 25 + .../reference/type-aliases/QueryPersister.md | 24 + .../reference/type-aliases/QueryStatus.md | 10 + .../solid/reference/type-aliases/SkipToken.md | 12 + .../solid/reference/type-aliases/StaleTime.md | 10 + .../type-aliases/StaleTimeFunction.md | 28 + .../reference/type-aliases/ThrowOnError.md | 28 + .../reference/type-aliases/TimeoutCallback.md | 27 + .../reference/type-aliases/TimeoutProvider.md | 106 ++ .../UndefinedInitialDataInfiniteOptions.md | 8 +- .../UndefinedInitialDataOptions.md | 6 +- .../reference/type-aliases/UnsetMarker.md | 10 + .../solid/reference/type-aliases/Updater.md | 35 + .../type-aliases/UseBaseMutationResult.md | 6 +- .../type-aliases/UseBaseQueryResult.md | 6 +- .../type-aliases/UseInfiniteQueryOptions.md | 6 +- .../type-aliases/UseInfiniteQueryResult.md | 4 +- .../type-aliases/UseMutateAsyncFunction.md | 4 +- .../type-aliases/UseMutateFunction.md | 6 +- .../type-aliases/UseMutationOptions.md | 4 +- .../type-aliases/UseMutationResult.md | 4 +- .../reference/type-aliases/UseQueryOptions.md | 6 +- .../reference/type-aliases/UseQueryResult.md | 4 +- .../reference/type-aliases/WithRequired.md | 20 + .../type-aliases/dataTagErrorSymbol.md | 10 + .../reference/type-aliases/dataTagSymbol.md | 10 + .../variables/IsRestoringProvider.md | 2 +- .../reference/variables/QueryClientContext.md | 2 +- .../variables/createInfiniteQuery.md | 6 +- .../reference/variables/createMutation.md | 2 +- .../reference/variables/createQueries.md | 50 +- .../solid/reference/variables/createQuery.md | 2 +- .../reference/variables/dataTagErrorSymbol.md | 10 + .../reference/variables/dataTagSymbol.md | 10 + .../reference/variables/defaultScheduler.md | 13 + .../reference/variables/environmentManager.md | 44 + .../solid/reference/variables/focusManager.md | 12 + .../solid/reference/variables/isServer.md | 14 + .../reference/variables/notifyManager.md | 156 ++ .../reference/variables/onlineManager.md | 12 + .../solid/reference/variables/skipToken.md | 23 + .../reference/variables/timeoutManager.md | 12 + .../solid/reference/variables/unsetMarker.md | 10 + .../reference/classes/CancelledError.md | 273 +++ .../classes/InfiniteQueryObserver.md | 665 +++++++ .../svelte/reference/classes/Mutation.md | 329 ++++ .../svelte/reference/classes/MutationCache.md | 308 ++++ .../reference/classes/MutationObserver.md | 335 ++++ .../reference/classes/QueriesObserver.md | 325 ++++ .../svelte/reference/classes/Query.md | 585 ++++++ .../svelte/reference/classes/QueryCache.md | 461 +++++ .../svelte/reference/classes/QueryClient.md | 1455 +++++++++++++++ .../svelte/reference/classes/QueryObserver.md | 555 ++++++ .../functions/createInfiniteQuery.md | 12 +- .../reference/functions/createMutation.md | 2 +- .../reference/functions/createQueries.md | 2 +- .../svelte/reference/functions/createQuery.md | 6 +- .../defaultShouldDehydrateMutation.md | 23 + .../functions/defaultShouldDehydrateQuery.md | 23 + .../svelte/reference/functions/dehydrate.md | 43 + .../reference/functions/dehydrateQuery.md | 43 + .../functions/experimental_streamedQuery.md | 52 + .../functions/getQueryClientContext.md | 2 +- .../svelte/reference/functions/hashKey.md | 30 + .../svelte/reference/functions/hydrate.md | 49 + .../functions/infiniteQueryOptions.md | 8 +- .../reference/functions/isCancelledError.md | 24 + .../reference/functions/keepPreviousData.md | 40 + .../reference/functions/matchMutation.md | 38 + .../svelte/reference/functions/matchQuery.md | 37 + .../reference/functions/mutationOptions.md | 4 +- .../svelte/reference/functions/noop.md | 32 + .../reference/functions/partialMatchKey.md | 26 + .../reference/functions/queryOptions.md | 4 +- .../reference/functions/replaceEqualDeep.md | 41 + .../functions/setQueryClientContext.md | 2 +- .../reference/functions/shouldThrowError.md | 45 + .../svelte/reference/functions/useHydrate.md | 6 +- .../reference/functions/useIsFetching.md | 6 +- .../reference/functions/useIsMutating.md | 6 +- .../reference/functions/useMutationState.md | 6 +- .../reference/functions/useQueryClient.md | 4 +- docs/framework/svelte/reference/index.md | 156 ++ .../reference/interfaces/CancelOptions.md | 26 + .../reference/interfaces/DefaultOptions.md | 76 + .../reference/interfaces/DehydrateOptions.md | 89 + .../reference/interfaces/DehydratedState.md | 30 + .../interfaces/EnsureQueryDataOptions.md | 343 ++++ .../interfaces/FetchNextPageOptions.md | 41 + .../interfaces/FetchPreviousPageOptions.md | 41 + .../reference/interfaces/FetchQueryOptions.md | 357 ++++ .../reference/interfaces/HydrateOptions.md | 43 + .../reference/interfaces/InfiniteData.md | 36 + .../InfiniteQueryObserverBaseResult.md | 577 ++++++ ...InfiniteQueryObserverLoadingErrorResult.md | 600 ++++++ .../InfiniteQueryObserverLoadingResult.md | 600 ++++++ .../InfiniteQueryObserverOptions.md | 605 ++++++ .../InfiniteQueryObserverPendingResult.md | 600 ++++++ .../InfiniteQueryObserverPlaceholderResult.md | 600 ++++++ ...InfiniteQueryObserverRefetchErrorResult.md | 600 ++++++ .../InfiniteQueryObserverSuccessResult.md | 600 ++++++ .../InfiniteQueryPageParamsOptions.md | 64 + .../reference/interfaces/InitialPageParam.md | 26 + .../reference/interfaces/InvalidateOptions.md | 44 + .../interfaces/InvalidateQueryFilters.md | 135 ++ .../reference/interfaces/MutateOptions.md | 124 ++ .../interfaces/MutationCacheConfig.md | 161 ++ .../reference/interfaces/MutationFilters.md | 85 + .../interfaces/MutationObserverBaseResult.md | 291 +++ .../interfaces/MutationObserverErrorResult.md | 308 ++++ .../interfaces/MutationObserverIdleResult.md | 308 ++++ .../MutationObserverLoadingResult.md | 308 ++++ .../interfaces/MutationObserverOptions.md | 290 +++ .../MutationObserverSuccessResult.md | 308 ++++ .../reference/interfaces/MutationOptions.md | 232 +++ .../reference/interfaces/MutationState.md | 142 ++ .../reference/interfaces/NotifyEvent.md | 16 + .../interfaces/QueriesObserverOptions.md | 27 + .../reference/interfaces/QueryCacheConfig.md | 92 + .../reference/interfaces/QueryClientConfig.md | 36 + .../interfaces/QueryExecuteOptions.md | 375 ++++ .../reference/interfaces/QueryFilters.md | 102 ++ .../interfaces/QueryObserverBaseResult.md | 358 ++++ .../QueryObserverLoadingErrorResult.md | 452 +++++ .../interfaces/QueryObserverLoadingResult.md | 452 +++++ .../interfaces/QueryObserverOptions.md | 541 ++++++ .../interfaces/QueryObserverPendingResult.md | 452 +++++ .../QueryObserverPlaceholderResult.md | 452 +++++ .../QueryObserverRefetchErrorResult.md | 452 +++++ .../interfaces/QueryObserverSuccessResult.md | 452 +++++ .../reference/interfaces/QueryOptions.md | 240 +++ .../svelte/reference/interfaces/QueryState.md | 175 ++ .../reference/interfaces/RefetchOptions.md | 45 + .../interfaces/RefetchQueryFilters.md | 125 ++ .../svelte/reference/interfaces/Register.md | 6 + .../reference/interfaces/ResetOptions.md | 44 + .../reference/interfaces/ResultOptions.md | 22 + .../reference/interfaces/SetDataOptions.md | 16 + .../reference/type-aliases/AnyDataTag.md | 30 + .../type-aliases/CreateBaseMutationResult.md | 2 +- .../type-aliases/CreateBaseQueryOptions.md | 4 +- .../type-aliases/CreateBaseQueryResult.md | 2 +- .../CreateInfiniteQueryOptions.md | 4 +- .../type-aliases/CreateInfiniteQueryResult.md | 2 +- .../type-aliases/CreateMutateAsyncFunction.md | 2 +- .../type-aliases/CreateMutateFunction.md | 4 +- .../type-aliases/CreateMutationOptions.md | 2 +- .../type-aliases/CreateMutationResult.md | 2 +- .../type-aliases/CreateQueryOptions.md | 4 +- .../type-aliases/CreateQueryResult.md | 2 +- .../svelte/reference/type-aliases/DataTag.md | 24 + .../reference/type-aliases/DefaultError.md | 10 + .../DefaultedInfiniteQueryObserverOptions.md | 32 + .../DefaultedQueryObserverOptions.md | 32 + .../DefinedCreateBaseQueryResult.md | 2 +- .../DefinedCreateInfiniteQueryResult.md | 2 +- .../type-aliases/DefinedCreateQueryResult.md | 2 +- .../DefinedInfiniteQueryObserverResult.md | 22 + .../DefinedInitialDataInfiniteOptions.md | 6 +- .../type-aliases/DefinedInitialDataOptions.md | 4 +- .../DefinedQueryObserverResult.md | 22 + .../type-aliases/DistributiveOmit.md | 20 + .../EnsureInfiniteQueryDataOptions.md | 42 + .../type-aliases/FetchInfiniteQueryOptions.md | 34 + .../reference/type-aliases/FetchStatus.md | 10 + .../type-aliases/GetNextPageParamFunction.md | 42 + .../GetPreviousPageParamFunction.md | 42 + .../type-aliases/InferDataFromTag.md | 20 + .../type-aliases/InferErrorFromTag.md | 20 + .../InfiniteQueryExecuteOptions.md | 32 + .../InfiniteQueryObserverResult.md | 25 + .../type-aliases/InitialDataFunction.md | 20 + .../reference/type-aliases/ManagedTimerId.md | 19 + .../reference/type-aliases/MutateFunction.md | 38 + .../type-aliases/MutateFunctionRest.md | 28 + .../type-aliases/MutationCacheNotifyEvent.md | 20 + .../type-aliases/MutationFunction.md | 34 + .../type-aliases/MutationFunctionContext.md | 40 + .../reference/type-aliases/MutationKey.md | 10 + .../reference/type-aliases/MutationMeta.md | 10 + .../type-aliases/MutationObserverResult.md | 32 + .../reference/type-aliases/MutationScope.md | 20 + .../type-aliases/MutationStateOptions.md | 4 +- .../reference/type-aliases/MutationStatus.md | 10 + .../reference/type-aliases/NetworkMode.md | 10 + .../type-aliases/NonUndefinedGuard.md | 16 + .../reference/type-aliases/NotifyEventType.md | 17 + .../type-aliases/NotifyOnChangeProps.md | 17 + .../reference/type-aliases/OmitKeyof.md | 28 + .../svelte/reference/type-aliases/Override.md | 20 + .../type-aliases/PlaceholderDataFunction.md | 42 + .../QueriesPlaceholderDataFunction.md | 30 + .../type-aliases/QueryBooleanOption.md | 28 + .../type-aliases/QueryCacheNotifyEvent.md | 21 + .../reference/type-aliases/QueryFunction.md | 34 + .../type-aliases/QueryFunctionContext.md | 20 + .../svelte/reference/type-aliases/QueryKey.md | 10 + .../type-aliases/QueryKeyHashFunction.md | 26 + .../type-aliases/QueryKeyWithDataTag.md | 34 + .../reference/type-aliases/QueryMeta.md | 10 + .../type-aliases/QueryObserverResult.md | 25 + .../reference/type-aliases/QueryPersister.md | 24 + .../reference/type-aliases/QueryStatus.md | 10 + .../reference/type-aliases/SkipToken.md | 12 + .../reference/type-aliases/StaleTime.md | 10 + .../type-aliases/StaleTimeFunction.md | 28 + .../reference/type-aliases/ThrowOnError.md | 28 + .../reference/type-aliases/TimeoutCallback.md | 27 + .../reference/type-aliases/TimeoutProvider.md | 106 ++ .../UndefinedInitialDataInfiniteOptions.md | 6 +- .../UndefinedInitialDataOptions.md | 4 +- .../reference/type-aliases/UnsetMarker.md | 10 + .../svelte/reference/type-aliases/Updater.md | 35 + .../reference/type-aliases/WithRequired.md | 20 + .../type-aliases/dataTagErrorSymbol.md | 10 + .../reference/type-aliases/dataTagSymbol.md | 10 + .../reference/variables/dataTagErrorSymbol.md | 10 + .../reference/variables/dataTagSymbol.md | 10 + .../reference/variables/defaultScheduler.md | 13 + .../reference/variables/environmentManager.md | 44 + .../reference/variables/focusManager.md | 12 + .../svelte/reference/variables/isServer.md | 14 + .../reference/variables/notifyManager.md | 156 ++ .../reference/variables/onlineManager.md | 12 + .../svelte/reference/variables/skipToken.md | 23 + .../reference/variables/timeoutManager.md | 12 + .../svelte/reference/variables/unsetMarker.md | 10 + .../vue/reference/classes/CancelledError.md | 273 +++ .../classes/InfiniteQueryObserver.md | 665 +++++++ .../vue/reference/classes/Mutation.md | 329 ++++ .../vue/reference/classes/MutationCache.md | 241 ++- .../vue/reference/classes/MutationObserver.md | 335 ++++ .../vue/reference/classes/QueriesObserver.md | 325 ++++ docs/framework/vue/reference/classes/Query.md | 585 ++++++ .../vue/reference/classes/QueryCache.md | 417 ++++- .../vue/reference/classes/QueryClient.md | 780 +++++++- .../vue/reference/classes/QueryObserver.md | 555 ++++++ .../defaultShouldDehydrateMutation.md | 23 + .../functions/defaultShouldDehydrateQuery.md | 23 + .../vue/reference/functions/dehydrate.md | 43 + .../vue/reference/functions/dehydrateQuery.md | 43 + .../functions/experimental_streamedQuery.md | 52 + .../vue/reference/functions/hashKey.md | 30 + .../vue/reference/functions/hydrate.md | 49 + .../functions/infiniteQueryOptions.md | 12 +- .../reference/functions/isCancelledError.md | 24 + .../reference/functions/keepPreviousData.md | 40 + .../vue/reference/functions/matchMutation.md | 38 + .../vue/reference/functions/matchQuery.md | 37 + .../reference/functions/mutationOptions.md | 16 +- .../framework/vue/reference/functions/noop.md | 32 + .../reference/functions/partialMatchKey.md | 26 + .../vue/reference/functions/queryOptions.md | 8 +- .../reference/functions/replaceEqualDeep.md | 41 + .../reference/functions/shouldThrowError.md | 45 + .../reference/functions/useInfiniteQuery.md | 12 +- .../vue/reference/functions/useIsFetching.md | 2 +- .../vue/reference/functions/useIsMutating.md | 2 +- .../vue/reference/functions/useMutation.md | 2 +- .../reference/functions/useMutationState.md | 6 +- .../functions/usePrefetchInfiniteQuery.md | 4 +- .../reference/functions/usePrefetchQuery.md | 2 +- .../vue/reference/functions/useQueries.md | 2 +- .../vue/reference/functions/useQuery.md | 6 +- .../vue/reference/functions/useQueryClient.md | 2 +- docs/framework/vue/reference/index.md | 146 ++ .../vue/reference/interfaces/CancelOptions.md | 26 + .../reference/interfaces/DefaultOptions.md | 76 + .../reference/interfaces/DehydrateOptions.md | 89 + .../reference/interfaces/DehydratedState.md | 30 + .../interfaces/EnsureQueryDataOptions.md | 343 ++++ .../interfaces/FetchNextPageOptions.md | 41 + .../interfaces/FetchPreviousPageOptions.md | 41 + .../reference/interfaces/FetchQueryOptions.md | 357 ++++ .../reference/interfaces/HydrateOptions.md | 43 + .../vue/reference/interfaces/InfiniteData.md | 36 + .../InfiniteQueryObserverBaseResult.md | 577 ++++++ ...InfiniteQueryObserverLoadingErrorResult.md | 600 ++++++ .../InfiniteQueryObserverLoadingResult.md | 600 ++++++ .../InfiniteQueryObserverOptions.md | 605 ++++++ .../InfiniteQueryObserverPendingResult.md | 600 ++++++ .../InfiniteQueryObserverPlaceholderResult.md | 600 ++++++ ...InfiniteQueryObserverRefetchErrorResult.md | 600 ++++++ .../InfiniteQueryObserverSuccessResult.md | 600 ++++++ .../InfiniteQueryPageParamsOptions.md | 64 + .../reference/interfaces/InitialPageParam.md | 26 + .../reference/interfaces/InvalidateOptions.md | 44 + .../interfaces/InvalidateQueryFilters.md | 144 ++ .../vue/reference/interfaces/MutateOptions.md | 124 ++ .../interfaces/MutationCacheConfig.md | 161 ++ .../interfaces/MutationObserverBaseResult.md | 291 +++ .../interfaces/MutationObserverErrorResult.md | 308 ++++ .../interfaces/MutationObserverIdleResult.md | 308 ++++ .../MutationObserverLoadingResult.md | 308 ++++ .../interfaces/MutationObserverOptions.md | 314 ++++ .../MutationObserverSuccessResult.md | 308 ++++ .../vue/reference/interfaces/MutationState.md | 142 ++ .../vue/reference/interfaces/NotifyEvent.md | 16 + .../interfaces/QueriesObserverOptions.md | 27 + .../reference/interfaces/QueryCacheConfig.md | 92 + .../reference/interfaces/QueryClientConfig.md | 36 + .../interfaces/QueryExecuteOptions.md | 375 ++++ .../interfaces/QueryObserverBaseResult.md | 358 ++++ .../QueryObserverLoadingErrorResult.md | 452 +++++ .../interfaces/QueryObserverLoadingResult.md | 452 +++++ .../interfaces/QueryObserverOptions.md | 541 ++++++ .../interfaces/QueryObserverPendingResult.md | 452 +++++ .../QueryObserverPlaceholderResult.md | 452 +++++ .../QueryObserverRefetchErrorResult.md | 452 +++++ .../interfaces/QueryObserverSuccessResult.md | 452 +++++ .../vue/reference/interfaces/QueryState.md | 175 ++ .../reference/interfaces/RefetchOptions.md | 45 + .../interfaces/RefetchQueryFilters.md | 134 ++ .../vue/reference/interfaces/Register.md | 6 + .../vue/reference/interfaces/ResetOptions.md | 44 + .../vue/reference/interfaces/ResultOptions.md | 22 + .../reference/interfaces/SetDataOptions.md | 16 + .../vue/reference/type-aliases/AnyDataTag.md | 30 + .../vue/reference/type-aliases/DataTag.md | 24 + .../reference/type-aliases/DefaultError.md | 10 + .../DefaultedInfiniteQueryObserverOptions.md | 32 + .../DefaultedQueryObserverOptions.md | 32 + .../DefinedInfiniteQueryObserverResult.md | 22 + .../DefinedInitialDataInfiniteOptions.md | 8 +- .../DefinedInitialQueryOptions.md | 6 +- .../DefinedInitialQueryOptionsWithDataTag.md | 6 +- .../DefinedQueryObserverResult.md | 22 + .../type-aliases/DistributiveOmit.md | 20 + .../EnsureInfiniteQueryDataOptions.md | 42 + .../type-aliases/FetchInfiniteQueryOptions.md | 34 + .../vue/reference/type-aliases/FetchStatus.md | 10 + .../type-aliases/GetNextPageParamFunction.md | 42 + .../GetPreviousPageParamFunction.md | 42 + .../type-aliases/InferDataFromTag.md | 20 + .../type-aliases/InferErrorFromTag.md | 20 + .../InfiniteQueryExecuteOptions.md | 32 + .../InfiniteQueryObserverResult.md | 25 + .../type-aliases/InitialDataFunction.md | 20 + .../reference/type-aliases/ManagedTimerId.md | 19 + .../reference/type-aliases/MutateFunction.md | 38 + .../type-aliases/MutateFunctionRest.md | 28 + .../type-aliases/MutationCacheNotifyEvent.md | 20 + .../reference/type-aliases/MutationFilters.md | 2 +- .../type-aliases/MutationFunction.md | 34 + .../type-aliases/MutationFunctionContext.md | 40 + .../vue/reference/type-aliases/MutationKey.md | 10 + .../reference/type-aliases/MutationMeta.md | 10 + .../type-aliases/MutationObserverResult.md | 32 + .../reference/type-aliases/MutationOptions.md | 4 +- .../reference/type-aliases/MutationScope.md | 20 + .../type-aliases/MutationStateOptions.md | 10 +- .../reference/type-aliases/MutationStatus.md | 10 + .../vue/reference/type-aliases/NetworkMode.md | 10 + .../type-aliases/NonUndefinedGuard.md | 16 + .../reference/type-aliases/NotifyEventType.md | 17 + .../type-aliases/NotifyOnChangeProps.md | 17 + .../vue/reference/type-aliases/OmitKeyof.md | 28 + .../vue/reference/type-aliases/Override.md | 20 + .../type-aliases/PlaceholderDataFunction.md | 42 + .../QueriesPlaceholderDataFunction.md | 30 + .../type-aliases/QueryBooleanOption.md | 28 + .../type-aliases/QueryCacheNotifyEvent.md | 21 + .../reference/type-aliases/QueryFilters.md | 2 +- .../reference/type-aliases/QueryFunction.md | 34 + .../type-aliases/QueryFunctionContext.md | 20 + .../vue/reference/type-aliases/QueryKey.md | 10 + .../type-aliases/QueryKeyHashFunction.md | 26 + .../type-aliases/QueryKeyWithDataTag.md | 34 + .../vue/reference/type-aliases/QueryMeta.md | 10 + .../type-aliases/QueryObserverResult.md | 25 + .../reference/type-aliases/QueryOptions.md | 6 +- .../reference/type-aliases/QueryPersister.md | 24 + .../vue/reference/type-aliases/QueryStatus.md | 10 + .../vue/reference/type-aliases/SkipToken.md | 12 + .../vue/reference/type-aliases/StaleTime.md | 10 + .../type-aliases/StaleTimeFunction.md | 28 + .../reference/type-aliases/ThrowOnError.md | 28 + .../reference/type-aliases/TimeoutCallback.md | 27 + .../reference/type-aliases/TimeoutProvider.md | 106 ++ .../UndefinedInitialDataInfiniteOptions.md | 8 +- .../UndefinedInitialQueryOptions.md | 6 +- ...UndefinedInitialQueryOptionsWithDataTag.md | 6 +- .../vue/reference/type-aliases/UnsetMarker.md | 10 + .../vue/reference/type-aliases/Updater.md | 35 + .../type-aliases/UseInfiniteQueryOptions.md | 6 +- .../UseInfiniteQueryReturnType.md | 2 +- .../type-aliases/UseMutationOptions.md | 4 +- .../type-aliases/UseMutationReturnType.md | 2 +- .../UsePrefetchInfiniteQueryOptions.md | 4 +- .../type-aliases/UsePrefetchQueryOptions.md | 4 +- .../type-aliases/UseQueriesOptions.md | 2 +- .../type-aliases/UseQueriesResults.md | 2 +- .../type-aliases/UseQueryDefinedReturnType.md | 2 +- .../reference/type-aliases/UseQueryOptions.md | 6 +- .../type-aliases/UseQueryReturnType.md | 2 +- .../type-aliases/VueQueryPluginOptions.md | 2 +- .../reference/type-aliases/WithRequired.md | 20 + .../type-aliases/dataTagErrorSymbol.md | 10 + .../reference/type-aliases/dataTagSymbol.md | 10 + .../vue/reference/variables/VueQueryPlugin.md | 2 +- .../reference/variables/dataTagErrorSymbol.md | 10 + .../vue/reference/variables/dataTagSymbol.md | 10 + .../reference/variables/defaultScheduler.md | 13 + .../reference/variables/environmentManager.md | 44 + .../vue/reference/variables/focusManager.md | 12 + .../vue/reference/variables/isServer.md | 14 + .../vue/reference/variables/notifyManager.md | 156 ++ .../vue/reference/variables/onlineManager.md | 12 + .../vue/reference/variables/skipToken.md | 23 + .../vue/reference/variables/timeoutManager.md | 12 + .../vue/reference/variables/unsetMarker.md | 10 + .../angular-query-experimental/tsconfig.json | 2 +- packages/lit-query/tsconfig.json | 3 +- packages/query-core/src/focusManager.ts | 57 + packages/query-core/src/hydration.ts | 81 +- .../query-core/src/infiniteQueryObserver.ts | 67 + packages/query-core/src/mutation.ts | 108 ++ packages/query-core/src/mutationCache.ts | 84 + packages/query-core/src/mutationObserver.ts | 71 + packages/query-core/src/notifyManager.ts | 36 + packages/query-core/src/onlineManager.ts | 47 + packages/query-core/src/queriesObserver.ts | 70 + packages/query-core/src/query.ts | 193 ++ packages/query-core/src/queryCache.ts | 124 ++ packages/query-core/src/queryClient.ts | 353 ++++ packages/query-core/src/queryObserver.ts | 114 ++ packages/query-core/src/retryer.ts | 18 + packages/query-core/src/streamedQuery.ts | 9 + packages/query-core/src/timeoutManager.ts | 99 + packages/query-core/src/types.ts | 72 +- packages/query-core/src/utils.ts | 104 ++ packages/solid-query/tsconfig.json | 3 +- packages/svelte-query/tsconfig.json | 3 +- packages/vue-query/tsconfig.json | 3 +- scripts/generate-docs.ts | 9 +- 1395 files changed, 160394 insertions(+), 1014 deletions(-) create mode 100644 docs/framework/angular/reference/classes/CancelledError.md create mode 100644 docs/framework/angular/reference/classes/InfiniteQueryObserver.md create mode 100644 docs/framework/angular/reference/classes/Mutation.md create mode 100644 docs/framework/angular/reference/classes/MutationCache.md create mode 100644 docs/framework/angular/reference/classes/MutationObserver.md create mode 100644 docs/framework/angular/reference/classes/QueriesObserver.md create mode 100644 docs/framework/angular/reference/classes/Query.md create mode 100644 docs/framework/angular/reference/classes/QueryCache.md create mode 100644 docs/framework/angular/reference/classes/QueryClient.md create mode 100644 docs/framework/angular/reference/classes/QueryObserver.md create mode 100644 docs/framework/angular/reference/functions/defaultShouldDehydrateMutation.md create mode 100644 docs/framework/angular/reference/functions/defaultShouldDehydrateQuery.md create mode 100644 docs/framework/angular/reference/functions/dehydrate.md create mode 100644 docs/framework/angular/reference/functions/dehydrateQuery.md create mode 100644 docs/framework/angular/reference/functions/experimental_streamedQuery.md create mode 100644 docs/framework/angular/reference/functions/hashKey.md create mode 100644 docs/framework/angular/reference/functions/hydrate.md create mode 100644 docs/framework/angular/reference/functions/isCancelledError.md create mode 100644 docs/framework/angular/reference/functions/keepPreviousData.md create mode 100644 docs/framework/angular/reference/functions/matchMutation.md create mode 100644 docs/framework/angular/reference/functions/matchQuery.md create mode 100644 docs/framework/angular/reference/functions/noop.md create mode 100644 docs/framework/angular/reference/functions/partialMatchKey.md create mode 100644 docs/framework/angular/reference/functions/replaceEqualDeep.md create mode 100644 docs/framework/angular/reference/functions/shouldThrowError.md create mode 100644 docs/framework/angular/reference/interfaces/CancelOptions.md create mode 100644 docs/framework/angular/reference/interfaces/DefaultOptions.md create mode 100644 docs/framework/angular/reference/interfaces/DehydrateOptions.md create mode 100644 docs/framework/angular/reference/interfaces/DehydratedState.md create mode 100644 docs/framework/angular/reference/interfaces/EnsureQueryDataOptions.md create mode 100644 docs/framework/angular/reference/interfaces/FetchNextPageOptions.md create mode 100644 docs/framework/angular/reference/interfaces/FetchPreviousPageOptions.md create mode 100644 docs/framework/angular/reference/interfaces/FetchQueryOptions.md create mode 100644 docs/framework/angular/reference/interfaces/HydrateOptions.md create mode 100644 docs/framework/angular/reference/interfaces/InfiniteData.md create mode 100644 docs/framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult.md create mode 100644 docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md create mode 100644 docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult.md create mode 100644 docs/framework/angular/reference/interfaces/InfiniteQueryObserverOptions.md create mode 100644 docs/framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult.md create mode 100644 docs/framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md create mode 100644 docs/framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md create mode 100644 docs/framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult.md create mode 100644 docs/framework/angular/reference/interfaces/InfiniteQueryPageParamsOptions.md create mode 100644 docs/framework/angular/reference/interfaces/InitialPageParam.md create mode 100644 docs/framework/angular/reference/interfaces/InvalidateOptions.md create mode 100644 docs/framework/angular/reference/interfaces/InvalidateQueryFilters.md create mode 100644 docs/framework/angular/reference/interfaces/MutateOptions.md create mode 100644 docs/framework/angular/reference/interfaces/MutationCacheConfig.md create mode 100644 docs/framework/angular/reference/interfaces/MutationFilters.md create mode 100644 docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md create mode 100644 docs/framework/angular/reference/interfaces/MutationObserverErrorResult.md create mode 100644 docs/framework/angular/reference/interfaces/MutationObserverIdleResult.md create mode 100644 docs/framework/angular/reference/interfaces/MutationObserverLoadingResult.md create mode 100644 docs/framework/angular/reference/interfaces/MutationObserverOptions.md create mode 100644 docs/framework/angular/reference/interfaces/MutationObserverSuccessResult.md create mode 100644 docs/framework/angular/reference/interfaces/MutationOptions.md create mode 100644 docs/framework/angular/reference/interfaces/MutationState.md create mode 100644 docs/framework/angular/reference/interfaces/NotifyEvent.md create mode 100644 docs/framework/angular/reference/interfaces/QueriesObserverOptions.md create mode 100644 docs/framework/angular/reference/interfaces/QueryCacheConfig.md create mode 100644 docs/framework/angular/reference/interfaces/QueryClientConfig.md create mode 100644 docs/framework/angular/reference/interfaces/QueryExecuteOptions.md create mode 100644 docs/framework/angular/reference/interfaces/QueryFilters.md create mode 100644 docs/framework/angular/reference/interfaces/QueryObserverBaseResult.md create mode 100644 docs/framework/angular/reference/interfaces/QueryObserverLoadingErrorResult.md create mode 100644 docs/framework/angular/reference/interfaces/QueryObserverLoadingResult.md create mode 100644 docs/framework/angular/reference/interfaces/QueryObserverOptions.md create mode 100644 docs/framework/angular/reference/interfaces/QueryObserverPendingResult.md create mode 100644 docs/framework/angular/reference/interfaces/QueryObserverPlaceholderResult.md create mode 100644 docs/framework/angular/reference/interfaces/QueryObserverRefetchErrorResult.md create mode 100644 docs/framework/angular/reference/interfaces/QueryObserverSuccessResult.md create mode 100644 docs/framework/angular/reference/interfaces/QueryOptions.md create mode 100644 docs/framework/angular/reference/interfaces/QueryState.md create mode 100644 docs/framework/angular/reference/interfaces/RefetchOptions.md create mode 100644 docs/framework/angular/reference/interfaces/RefetchQueryFilters.md create mode 100644 docs/framework/angular/reference/interfaces/Register.md create mode 100644 docs/framework/angular/reference/interfaces/ResetOptions.md create mode 100644 docs/framework/angular/reference/interfaces/ResultOptions.md create mode 100644 docs/framework/angular/reference/interfaces/SetDataOptions.md create mode 100644 docs/framework/angular/reference/type-aliases/AnyDataTag.md create mode 100644 docs/framework/angular/reference/type-aliases/DataTag.md create mode 100644 docs/framework/angular/reference/type-aliases/DefaultError.md create mode 100644 docs/framework/angular/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md create mode 100644 docs/framework/angular/reference/type-aliases/DefaultedQueryObserverOptions.md create mode 100644 docs/framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult.md create mode 100644 docs/framework/angular/reference/type-aliases/DefinedQueryObserverResult.md create mode 100644 docs/framework/angular/reference/type-aliases/DistributiveOmit.md create mode 100644 docs/framework/angular/reference/type-aliases/EnsureInfiniteQueryDataOptions.md create mode 100644 docs/framework/angular/reference/type-aliases/FetchInfiniteQueryOptions.md create mode 100644 docs/framework/angular/reference/type-aliases/FetchStatus.md create mode 100644 docs/framework/angular/reference/type-aliases/GetNextPageParamFunction.md create mode 100644 docs/framework/angular/reference/type-aliases/GetPreviousPageParamFunction.md create mode 100644 docs/framework/angular/reference/type-aliases/InferDataFromTag.md create mode 100644 docs/framework/angular/reference/type-aliases/InferErrorFromTag.md create mode 100644 docs/framework/angular/reference/type-aliases/InfiniteQueryExecuteOptions.md create mode 100644 docs/framework/angular/reference/type-aliases/InfiniteQueryObserverResult.md create mode 100644 docs/framework/angular/reference/type-aliases/InitialDataFunction.md create mode 100644 docs/framework/angular/reference/type-aliases/ManagedTimerId.md create mode 100644 docs/framework/angular/reference/type-aliases/MutateFunction.md create mode 100644 docs/framework/angular/reference/type-aliases/MutateFunctionRest.md create mode 100644 docs/framework/angular/reference/type-aliases/MutationCacheNotifyEvent.md create mode 100644 docs/framework/angular/reference/type-aliases/MutationFunction.md create mode 100644 docs/framework/angular/reference/type-aliases/MutationFunctionContext.md create mode 100644 docs/framework/angular/reference/type-aliases/MutationKey.md create mode 100644 docs/framework/angular/reference/type-aliases/MutationMeta.md create mode 100644 docs/framework/angular/reference/type-aliases/MutationObserverResult.md create mode 100644 docs/framework/angular/reference/type-aliases/MutationScope.md create mode 100644 docs/framework/angular/reference/type-aliases/MutationStatus.md create mode 100644 docs/framework/angular/reference/type-aliases/NetworkMode.md create mode 100644 docs/framework/angular/reference/type-aliases/NonUndefinedGuard.md create mode 100644 docs/framework/angular/reference/type-aliases/NotifyEventType.md create mode 100644 docs/framework/angular/reference/type-aliases/NotifyOnChangeProps.md create mode 100644 docs/framework/angular/reference/type-aliases/OmitKeyof.md create mode 100644 docs/framework/angular/reference/type-aliases/Override.md create mode 100644 docs/framework/angular/reference/type-aliases/PlaceholderDataFunction.md create mode 100644 docs/framework/angular/reference/type-aliases/QueriesPlaceholderDataFunction.md create mode 100644 docs/framework/angular/reference/type-aliases/QueryBooleanOption.md create mode 100644 docs/framework/angular/reference/type-aliases/QueryCacheNotifyEvent.md create mode 100644 docs/framework/angular/reference/type-aliases/QueryFunction.md create mode 100644 docs/framework/angular/reference/type-aliases/QueryFunctionContext.md create mode 100644 docs/framework/angular/reference/type-aliases/QueryKey.md create mode 100644 docs/framework/angular/reference/type-aliases/QueryKeyHashFunction.md create mode 100644 docs/framework/angular/reference/type-aliases/QueryKeyWithDataTag.md create mode 100644 docs/framework/angular/reference/type-aliases/QueryMeta.md create mode 100644 docs/framework/angular/reference/type-aliases/QueryObserverResult.md create mode 100644 docs/framework/angular/reference/type-aliases/QueryPersister.md create mode 100644 docs/framework/angular/reference/type-aliases/QueryStatus.md create mode 100644 docs/framework/angular/reference/type-aliases/SkipToken.md create mode 100644 docs/framework/angular/reference/type-aliases/StaleTime.md create mode 100644 docs/framework/angular/reference/type-aliases/StaleTimeFunction.md create mode 100644 docs/framework/angular/reference/type-aliases/ThrowOnError.md create mode 100644 docs/framework/angular/reference/type-aliases/TimeoutCallback.md create mode 100644 docs/framework/angular/reference/type-aliases/TimeoutProvider.md create mode 100644 docs/framework/angular/reference/type-aliases/UnsetMarker.md create mode 100644 docs/framework/angular/reference/type-aliases/Updater.md create mode 100644 docs/framework/angular/reference/type-aliases/WithRequired.md create mode 100644 docs/framework/angular/reference/type-aliases/dataTagErrorSymbol.md create mode 100644 docs/framework/angular/reference/type-aliases/dataTagSymbol.md create mode 100644 docs/framework/angular/reference/variables/dataTagErrorSymbol.md create mode 100644 docs/framework/angular/reference/variables/dataTagSymbol.md create mode 100644 docs/framework/angular/reference/variables/defaultScheduler.md create mode 100644 docs/framework/angular/reference/variables/environmentManager.md create mode 100644 docs/framework/angular/reference/variables/focusManager.md create mode 100644 docs/framework/angular/reference/variables/isServer.md create mode 100644 docs/framework/angular/reference/variables/notifyManager.md create mode 100644 docs/framework/angular/reference/variables/onlineManager.md create mode 100644 docs/framework/angular/reference/variables/skipToken.md create mode 100644 docs/framework/angular/reference/variables/timeoutManager.md create mode 100644 docs/framework/angular/reference/variables/unsetMarker.md create mode 100644 docs/framework/lit/reference/classes/CancelledError.md create mode 100644 docs/framework/lit/reference/classes/InfiniteQueryObserver.md create mode 100644 docs/framework/lit/reference/classes/Mutation.md create mode 100644 docs/framework/lit/reference/classes/MutationCache.md create mode 100644 docs/framework/lit/reference/classes/MutationObserver.md create mode 100644 docs/framework/lit/reference/classes/QueriesObserver.md create mode 100644 docs/framework/lit/reference/classes/Query.md create mode 100644 docs/framework/lit/reference/classes/QueryCache.md create mode 100644 docs/framework/lit/reference/classes/QueryClient.md create mode 100644 docs/framework/lit/reference/classes/QueryObserver.md create mode 100644 docs/framework/lit/reference/functions/defaultShouldDehydrateMutation.md create mode 100644 docs/framework/lit/reference/functions/defaultShouldDehydrateQuery.md create mode 100644 docs/framework/lit/reference/functions/dehydrate.md create mode 100644 docs/framework/lit/reference/functions/dehydrateQuery.md create mode 100644 docs/framework/lit/reference/functions/experimental_streamedQuery.md create mode 100644 docs/framework/lit/reference/functions/hashKey.md create mode 100644 docs/framework/lit/reference/functions/hydrate.md create mode 100644 docs/framework/lit/reference/functions/isCancelledError.md create mode 100644 docs/framework/lit/reference/functions/keepPreviousData.md create mode 100644 docs/framework/lit/reference/functions/matchMutation.md create mode 100644 docs/framework/lit/reference/functions/matchQuery.md create mode 100644 docs/framework/lit/reference/functions/noop.md create mode 100644 docs/framework/lit/reference/functions/partialMatchKey.md create mode 100644 docs/framework/lit/reference/functions/replaceEqualDeep.md create mode 100644 docs/framework/lit/reference/functions/shouldThrowError.md create mode 100644 docs/framework/lit/reference/interfaces/CancelOptions.md create mode 100644 docs/framework/lit/reference/interfaces/DefaultOptions.md create mode 100644 docs/framework/lit/reference/interfaces/DehydrateOptions.md create mode 100644 docs/framework/lit/reference/interfaces/DehydratedState.md create mode 100644 docs/framework/lit/reference/interfaces/EnsureQueryDataOptions.md create mode 100644 docs/framework/lit/reference/interfaces/FetchNextPageOptions.md create mode 100644 docs/framework/lit/reference/interfaces/FetchPreviousPageOptions.md create mode 100644 docs/framework/lit/reference/interfaces/FetchQueryOptions.md create mode 100644 docs/framework/lit/reference/interfaces/HydrateOptions.md create mode 100644 docs/framework/lit/reference/interfaces/InfiniteData.md create mode 100644 docs/framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult.md create mode 100644 docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md create mode 100644 docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult.md create mode 100644 docs/framework/lit/reference/interfaces/InfiniteQueryObserverOptions.md create mode 100644 docs/framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult.md create mode 100644 docs/framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md create mode 100644 docs/framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md create mode 100644 docs/framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult.md create mode 100644 docs/framework/lit/reference/interfaces/InfiniteQueryPageParamsOptions.md create mode 100644 docs/framework/lit/reference/interfaces/InitialPageParam.md create mode 100644 docs/framework/lit/reference/interfaces/InvalidateOptions.md create mode 100644 docs/framework/lit/reference/interfaces/InvalidateQueryFilters.md create mode 100644 docs/framework/lit/reference/interfaces/MutateOptions.md create mode 100644 docs/framework/lit/reference/interfaces/MutationCacheConfig.md create mode 100644 docs/framework/lit/reference/interfaces/MutationFilters.md create mode 100644 docs/framework/lit/reference/interfaces/MutationObserverBaseResult.md create mode 100644 docs/framework/lit/reference/interfaces/MutationObserverErrorResult.md create mode 100644 docs/framework/lit/reference/interfaces/MutationObserverIdleResult.md create mode 100644 docs/framework/lit/reference/interfaces/MutationObserverLoadingResult.md create mode 100644 docs/framework/lit/reference/interfaces/MutationObserverOptions.md create mode 100644 docs/framework/lit/reference/interfaces/MutationObserverSuccessResult.md create mode 100644 docs/framework/lit/reference/interfaces/MutationOptions.md create mode 100644 docs/framework/lit/reference/interfaces/MutationState.md create mode 100644 docs/framework/lit/reference/interfaces/NotifyEvent.md create mode 100644 docs/framework/lit/reference/interfaces/QueriesObserverOptions.md create mode 100644 docs/framework/lit/reference/interfaces/QueryCacheConfig.md create mode 100644 docs/framework/lit/reference/interfaces/QueryClientConfig.md create mode 100644 docs/framework/lit/reference/interfaces/QueryExecuteOptions.md create mode 100644 docs/framework/lit/reference/interfaces/QueryFilters.md create mode 100644 docs/framework/lit/reference/interfaces/QueryObserverBaseResult.md create mode 100644 docs/framework/lit/reference/interfaces/QueryObserverLoadingErrorResult.md create mode 100644 docs/framework/lit/reference/interfaces/QueryObserverLoadingResult.md create mode 100644 docs/framework/lit/reference/interfaces/QueryObserverOptions.md create mode 100644 docs/framework/lit/reference/interfaces/QueryObserverPendingResult.md create mode 100644 docs/framework/lit/reference/interfaces/QueryObserverPlaceholderResult.md create mode 100644 docs/framework/lit/reference/interfaces/QueryObserverRefetchErrorResult.md create mode 100644 docs/framework/lit/reference/interfaces/QueryObserverSuccessResult.md create mode 100644 docs/framework/lit/reference/interfaces/QueryOptions.md create mode 100644 docs/framework/lit/reference/interfaces/QueryState.md create mode 100644 docs/framework/lit/reference/interfaces/RefetchOptions.md create mode 100644 docs/framework/lit/reference/interfaces/RefetchQueryFilters.md create mode 100644 docs/framework/lit/reference/interfaces/Register.md create mode 100644 docs/framework/lit/reference/interfaces/ResetOptions.md create mode 100644 docs/framework/lit/reference/interfaces/ResultOptions.md create mode 100644 docs/framework/lit/reference/interfaces/SetDataOptions.md create mode 100644 docs/framework/lit/reference/type-aliases/AnyDataTag.md create mode 100644 docs/framework/lit/reference/type-aliases/DataTag.md create mode 100644 docs/framework/lit/reference/type-aliases/DefaultError.md create mode 100644 docs/framework/lit/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md create mode 100644 docs/framework/lit/reference/type-aliases/DefaultedQueryObserverOptions.md create mode 100644 docs/framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult.md create mode 100644 docs/framework/lit/reference/type-aliases/DefinedQueryObserverResult.md create mode 100644 docs/framework/lit/reference/type-aliases/DistributiveOmit.md create mode 100644 docs/framework/lit/reference/type-aliases/EnsureInfiniteQueryDataOptions.md create mode 100644 docs/framework/lit/reference/type-aliases/FetchInfiniteQueryOptions.md create mode 100644 docs/framework/lit/reference/type-aliases/FetchStatus.md create mode 100644 docs/framework/lit/reference/type-aliases/GetNextPageParamFunction.md create mode 100644 docs/framework/lit/reference/type-aliases/GetPreviousPageParamFunction.md create mode 100644 docs/framework/lit/reference/type-aliases/InferDataFromTag.md create mode 100644 docs/framework/lit/reference/type-aliases/InferErrorFromTag.md create mode 100644 docs/framework/lit/reference/type-aliases/InfiniteQueryExecuteOptions.md create mode 100644 docs/framework/lit/reference/type-aliases/InfiniteQueryObserverResult.md create mode 100644 docs/framework/lit/reference/type-aliases/InitialDataFunction.md create mode 100644 docs/framework/lit/reference/type-aliases/ManagedTimerId.md create mode 100644 docs/framework/lit/reference/type-aliases/MutateFunction.md create mode 100644 docs/framework/lit/reference/type-aliases/MutateFunctionRest.md create mode 100644 docs/framework/lit/reference/type-aliases/MutationCacheNotifyEvent.md create mode 100644 docs/framework/lit/reference/type-aliases/MutationFunction.md create mode 100644 docs/framework/lit/reference/type-aliases/MutationFunctionContext.md create mode 100644 docs/framework/lit/reference/type-aliases/MutationKey.md create mode 100644 docs/framework/lit/reference/type-aliases/MutationMeta.md create mode 100644 docs/framework/lit/reference/type-aliases/MutationObserverResult.md create mode 100644 docs/framework/lit/reference/type-aliases/MutationScope.md create mode 100644 docs/framework/lit/reference/type-aliases/MutationStatus.md create mode 100644 docs/framework/lit/reference/type-aliases/NetworkMode.md create mode 100644 docs/framework/lit/reference/type-aliases/NonUndefinedGuard.md create mode 100644 docs/framework/lit/reference/type-aliases/NotifyEventType.md create mode 100644 docs/framework/lit/reference/type-aliases/NotifyOnChangeProps.md create mode 100644 docs/framework/lit/reference/type-aliases/OmitKeyof.md create mode 100644 docs/framework/lit/reference/type-aliases/Override.md create mode 100644 docs/framework/lit/reference/type-aliases/PlaceholderDataFunction.md create mode 100644 docs/framework/lit/reference/type-aliases/QueriesPlaceholderDataFunction.md create mode 100644 docs/framework/lit/reference/type-aliases/QueryBooleanOption.md create mode 100644 docs/framework/lit/reference/type-aliases/QueryCacheNotifyEvent.md create mode 100644 docs/framework/lit/reference/type-aliases/QueryFunction.md create mode 100644 docs/framework/lit/reference/type-aliases/QueryFunctionContext.md create mode 100644 docs/framework/lit/reference/type-aliases/QueryKey.md create mode 100644 docs/framework/lit/reference/type-aliases/QueryKeyHashFunction.md create mode 100644 docs/framework/lit/reference/type-aliases/QueryKeyWithDataTag.md create mode 100644 docs/framework/lit/reference/type-aliases/QueryMeta.md create mode 100644 docs/framework/lit/reference/type-aliases/QueryObserverResult.md create mode 100644 docs/framework/lit/reference/type-aliases/QueryPersister.md create mode 100644 docs/framework/lit/reference/type-aliases/QueryStatus.md create mode 100644 docs/framework/lit/reference/type-aliases/SkipToken.md create mode 100644 docs/framework/lit/reference/type-aliases/StaleTime.md create mode 100644 docs/framework/lit/reference/type-aliases/StaleTimeFunction.md create mode 100644 docs/framework/lit/reference/type-aliases/ThrowOnError.md create mode 100644 docs/framework/lit/reference/type-aliases/TimeoutCallback.md create mode 100644 docs/framework/lit/reference/type-aliases/TimeoutProvider.md create mode 100644 docs/framework/lit/reference/type-aliases/UnsetMarker.md create mode 100644 docs/framework/lit/reference/type-aliases/Updater.md create mode 100644 docs/framework/lit/reference/type-aliases/WithRequired.md create mode 100644 docs/framework/lit/reference/type-aliases/dataTagErrorSymbol.md create mode 100644 docs/framework/lit/reference/type-aliases/dataTagSymbol.md create mode 100644 docs/framework/lit/reference/variables/dataTagErrorSymbol.md create mode 100644 docs/framework/lit/reference/variables/dataTagSymbol.md create mode 100644 docs/framework/lit/reference/variables/defaultScheduler.md create mode 100644 docs/framework/lit/reference/variables/environmentManager.md create mode 100644 docs/framework/lit/reference/variables/focusManager.md create mode 100644 docs/framework/lit/reference/variables/isServer.md create mode 100644 docs/framework/lit/reference/variables/notifyManager.md create mode 100644 docs/framework/lit/reference/variables/onlineManager.md create mode 100644 docs/framework/lit/reference/variables/skipToken.md create mode 100644 docs/framework/lit/reference/variables/timeoutManager.md create mode 100644 docs/framework/lit/reference/variables/unsetMarker.md create mode 100644 docs/framework/preact/reference/classes/CancelledError.md create mode 100644 docs/framework/preact/reference/classes/InfiniteQueryObserver.md create mode 100644 docs/framework/preact/reference/classes/Mutation.md create mode 100644 docs/framework/preact/reference/classes/MutationCache.md create mode 100644 docs/framework/preact/reference/classes/MutationObserver.md create mode 100644 docs/framework/preact/reference/classes/QueriesObserver.md create mode 100644 docs/framework/preact/reference/classes/Query.md create mode 100644 docs/framework/preact/reference/classes/QueryCache.md create mode 100644 docs/framework/preact/reference/classes/QueryClient.md create mode 100644 docs/framework/preact/reference/classes/QueryObserver.md create mode 100644 docs/framework/preact/reference/functions/defaultShouldDehydrateMutation.md create mode 100644 docs/framework/preact/reference/functions/defaultShouldDehydrateQuery.md create mode 100644 docs/framework/preact/reference/functions/dehydrate.md create mode 100644 docs/framework/preact/reference/functions/dehydrateQuery.md create mode 100644 docs/framework/preact/reference/functions/experimental_streamedQuery.md create mode 100644 docs/framework/preact/reference/functions/hashKey.md create mode 100644 docs/framework/preact/reference/functions/hydrate.md create mode 100644 docs/framework/preact/reference/functions/isCancelledError.md create mode 100644 docs/framework/preact/reference/functions/keepPreviousData.md create mode 100644 docs/framework/preact/reference/functions/matchMutation.md create mode 100644 docs/framework/preact/reference/functions/matchQuery.md create mode 100644 docs/framework/preact/reference/functions/noop.md create mode 100644 docs/framework/preact/reference/functions/partialMatchKey.md create mode 100644 docs/framework/preact/reference/functions/replaceEqualDeep.md create mode 100644 docs/framework/preact/reference/functions/shouldThrowError.md create mode 100644 docs/framework/preact/reference/interfaces/CancelOptions.md create mode 100644 docs/framework/preact/reference/interfaces/DefaultOptions.md create mode 100644 docs/framework/preact/reference/interfaces/DehydrateOptions.md create mode 100644 docs/framework/preact/reference/interfaces/DehydratedState.md create mode 100644 docs/framework/preact/reference/interfaces/EnsureQueryDataOptions.md create mode 100644 docs/framework/preact/reference/interfaces/FetchNextPageOptions.md create mode 100644 docs/framework/preact/reference/interfaces/FetchPreviousPageOptions.md create mode 100644 docs/framework/preact/reference/interfaces/FetchQueryOptions.md create mode 100644 docs/framework/preact/reference/interfaces/HydrateOptions.md create mode 100644 docs/framework/preact/reference/interfaces/InfiniteData.md create mode 100644 docs/framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult.md create mode 100644 docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md create mode 100644 docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult.md create mode 100644 docs/framework/preact/reference/interfaces/InfiniteQueryObserverOptions.md create mode 100644 docs/framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult.md create mode 100644 docs/framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md create mode 100644 docs/framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md create mode 100644 docs/framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult.md create mode 100644 docs/framework/preact/reference/interfaces/InfiniteQueryPageParamsOptions.md create mode 100644 docs/framework/preact/reference/interfaces/InitialPageParam.md create mode 100644 docs/framework/preact/reference/interfaces/InvalidateOptions.md create mode 100644 docs/framework/preact/reference/interfaces/InvalidateQueryFilters.md create mode 100644 docs/framework/preact/reference/interfaces/MutateOptions.md create mode 100644 docs/framework/preact/reference/interfaces/MutationCacheConfig.md create mode 100644 docs/framework/preact/reference/interfaces/MutationFilters.md create mode 100644 docs/framework/preact/reference/interfaces/MutationObserverBaseResult.md create mode 100644 docs/framework/preact/reference/interfaces/MutationObserverErrorResult.md create mode 100644 docs/framework/preact/reference/interfaces/MutationObserverIdleResult.md create mode 100644 docs/framework/preact/reference/interfaces/MutationObserverLoadingResult.md create mode 100644 docs/framework/preact/reference/interfaces/MutationObserverOptions.md create mode 100644 docs/framework/preact/reference/interfaces/MutationObserverSuccessResult.md create mode 100644 docs/framework/preact/reference/interfaces/MutationOptions.md create mode 100644 docs/framework/preact/reference/interfaces/MutationState.md create mode 100644 docs/framework/preact/reference/interfaces/NotifyEvent.md create mode 100644 docs/framework/preact/reference/interfaces/QueriesObserverOptions.md create mode 100644 docs/framework/preact/reference/interfaces/QueryCacheConfig.md create mode 100644 docs/framework/preact/reference/interfaces/QueryClientConfig.md create mode 100644 docs/framework/preact/reference/interfaces/QueryExecuteOptions.md create mode 100644 docs/framework/preact/reference/interfaces/QueryFilters.md create mode 100644 docs/framework/preact/reference/interfaces/QueryObserverBaseResult.md create mode 100644 docs/framework/preact/reference/interfaces/QueryObserverLoadingErrorResult.md create mode 100644 docs/framework/preact/reference/interfaces/QueryObserverLoadingResult.md create mode 100644 docs/framework/preact/reference/interfaces/QueryObserverOptions.md create mode 100644 docs/framework/preact/reference/interfaces/QueryObserverPendingResult.md create mode 100644 docs/framework/preact/reference/interfaces/QueryObserverPlaceholderResult.md create mode 100644 docs/framework/preact/reference/interfaces/QueryObserverRefetchErrorResult.md create mode 100644 docs/framework/preact/reference/interfaces/QueryObserverSuccessResult.md create mode 100644 docs/framework/preact/reference/interfaces/QueryOptions.md create mode 100644 docs/framework/preact/reference/interfaces/QueryState.md create mode 100644 docs/framework/preact/reference/interfaces/RefetchOptions.md create mode 100644 docs/framework/preact/reference/interfaces/RefetchQueryFilters.md create mode 100644 docs/framework/preact/reference/interfaces/Register.md create mode 100644 docs/framework/preact/reference/interfaces/ResetOptions.md create mode 100644 docs/framework/preact/reference/interfaces/ResultOptions.md create mode 100644 docs/framework/preact/reference/interfaces/SetDataOptions.md create mode 100644 docs/framework/preact/reference/type-aliases/AnyDataTag.md create mode 100644 docs/framework/preact/reference/type-aliases/DataTag.md create mode 100644 docs/framework/preact/reference/type-aliases/DefaultError.md create mode 100644 docs/framework/preact/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md create mode 100644 docs/framework/preact/reference/type-aliases/DefaultedQueryObserverOptions.md create mode 100644 docs/framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult.md create mode 100644 docs/framework/preact/reference/type-aliases/DefinedQueryObserverResult.md create mode 100644 docs/framework/preact/reference/type-aliases/DistributiveOmit.md create mode 100644 docs/framework/preact/reference/type-aliases/EnsureInfiniteQueryDataOptions.md create mode 100644 docs/framework/preact/reference/type-aliases/FetchInfiniteQueryOptions.md create mode 100644 docs/framework/preact/reference/type-aliases/FetchStatus.md create mode 100644 docs/framework/preact/reference/type-aliases/GetNextPageParamFunction.md create mode 100644 docs/framework/preact/reference/type-aliases/GetPreviousPageParamFunction.md create mode 100644 docs/framework/preact/reference/type-aliases/InferDataFromTag.md create mode 100644 docs/framework/preact/reference/type-aliases/InferErrorFromTag.md create mode 100644 docs/framework/preact/reference/type-aliases/InfiniteQueryExecuteOptions.md create mode 100644 docs/framework/preact/reference/type-aliases/InfiniteQueryObserverResult.md create mode 100644 docs/framework/preact/reference/type-aliases/InitialDataFunction.md create mode 100644 docs/framework/preact/reference/type-aliases/ManagedTimerId.md create mode 100644 docs/framework/preact/reference/type-aliases/MutateFunction.md create mode 100644 docs/framework/preact/reference/type-aliases/MutateFunctionRest.md create mode 100644 docs/framework/preact/reference/type-aliases/MutationCacheNotifyEvent.md create mode 100644 docs/framework/preact/reference/type-aliases/MutationFunction.md create mode 100644 docs/framework/preact/reference/type-aliases/MutationFunctionContext.md create mode 100644 docs/framework/preact/reference/type-aliases/MutationKey.md create mode 100644 docs/framework/preact/reference/type-aliases/MutationMeta.md create mode 100644 docs/framework/preact/reference/type-aliases/MutationObserverResult.md create mode 100644 docs/framework/preact/reference/type-aliases/MutationScope.md create mode 100644 docs/framework/preact/reference/type-aliases/MutationStatus.md create mode 100644 docs/framework/preact/reference/type-aliases/NetworkMode.md create mode 100644 docs/framework/preact/reference/type-aliases/NonUndefinedGuard.md create mode 100644 docs/framework/preact/reference/type-aliases/NotifyEventType.md create mode 100644 docs/framework/preact/reference/type-aliases/NotifyOnChangeProps.md create mode 100644 docs/framework/preact/reference/type-aliases/OmitKeyof.md create mode 100644 docs/framework/preact/reference/type-aliases/Override.md create mode 100644 docs/framework/preact/reference/type-aliases/PlaceholderDataFunction.md create mode 100644 docs/framework/preact/reference/type-aliases/QueriesPlaceholderDataFunction.md create mode 100644 docs/framework/preact/reference/type-aliases/QueryBooleanOption.md create mode 100644 docs/framework/preact/reference/type-aliases/QueryCacheNotifyEvent.md create mode 100644 docs/framework/preact/reference/type-aliases/QueryFunction.md create mode 100644 docs/framework/preact/reference/type-aliases/QueryFunctionContext.md create mode 100644 docs/framework/preact/reference/type-aliases/QueryKey.md create mode 100644 docs/framework/preact/reference/type-aliases/QueryKeyHashFunction.md create mode 100644 docs/framework/preact/reference/type-aliases/QueryKeyWithDataTag.md create mode 100644 docs/framework/preact/reference/type-aliases/QueryMeta.md create mode 100644 docs/framework/preact/reference/type-aliases/QueryObserverResult.md create mode 100644 docs/framework/preact/reference/type-aliases/QueryPersister.md create mode 100644 docs/framework/preact/reference/type-aliases/QueryStatus.md create mode 100644 docs/framework/preact/reference/type-aliases/SkipToken.md create mode 100644 docs/framework/preact/reference/type-aliases/StaleTime.md create mode 100644 docs/framework/preact/reference/type-aliases/StaleTimeFunction.md create mode 100644 docs/framework/preact/reference/type-aliases/ThrowOnError.md create mode 100644 docs/framework/preact/reference/type-aliases/TimeoutCallback.md create mode 100644 docs/framework/preact/reference/type-aliases/TimeoutProvider.md create mode 100644 docs/framework/preact/reference/type-aliases/UnsetMarker.md create mode 100644 docs/framework/preact/reference/type-aliases/Updater.md create mode 100644 docs/framework/preact/reference/type-aliases/WithRequired.md create mode 100644 docs/framework/preact/reference/type-aliases/dataTagErrorSymbol.md create mode 100644 docs/framework/preact/reference/type-aliases/dataTagSymbol.md create mode 100644 docs/framework/preact/reference/variables/dataTagErrorSymbol.md create mode 100644 docs/framework/preact/reference/variables/dataTagSymbol.md create mode 100644 docs/framework/preact/reference/variables/defaultScheduler.md create mode 100644 docs/framework/preact/reference/variables/environmentManager.md create mode 100644 docs/framework/preact/reference/variables/focusManager.md create mode 100644 docs/framework/preact/reference/variables/isServer.md create mode 100644 docs/framework/preact/reference/variables/notifyManager.md create mode 100644 docs/framework/preact/reference/variables/onlineManager.md create mode 100644 docs/framework/preact/reference/variables/skipToken.md create mode 100644 docs/framework/preact/reference/variables/timeoutManager.md create mode 100644 docs/framework/preact/reference/variables/unsetMarker.md create mode 100644 docs/framework/react/reference/classes/CancelledError.md create mode 100644 docs/framework/react/reference/classes/InfiniteQueryObserver.md create mode 100644 docs/framework/react/reference/classes/Mutation.md create mode 100644 docs/framework/react/reference/classes/MutationCache.md create mode 100644 docs/framework/react/reference/classes/MutationObserver.md create mode 100644 docs/framework/react/reference/classes/QueriesObserver.md create mode 100644 docs/framework/react/reference/classes/Query.md create mode 100644 docs/framework/react/reference/classes/QueryCache.md create mode 100644 docs/framework/react/reference/classes/QueryClient.md create mode 100644 docs/framework/react/reference/classes/QueryObserver.md create mode 100644 docs/framework/react/reference/functions/defaultShouldDehydrateMutation.md create mode 100644 docs/framework/react/reference/functions/defaultShouldDehydrateQuery.md create mode 100644 docs/framework/react/reference/functions/dehydrate.md create mode 100644 docs/framework/react/reference/functions/dehydrateQuery.md create mode 100644 docs/framework/react/reference/functions/experimental_streamedQuery.md create mode 100644 docs/framework/react/reference/functions/hashKey.md create mode 100644 docs/framework/react/reference/functions/hydrate.md create mode 100644 docs/framework/react/reference/functions/isCancelledError.md create mode 100644 docs/framework/react/reference/functions/keepPreviousData.md create mode 100644 docs/framework/react/reference/functions/matchMutation.md create mode 100644 docs/framework/react/reference/functions/matchQuery.md create mode 100644 docs/framework/react/reference/functions/noop.md create mode 100644 docs/framework/react/reference/functions/partialMatchKey.md create mode 100644 docs/framework/react/reference/functions/replaceEqualDeep.md create mode 100644 docs/framework/react/reference/functions/shouldThrowError.md create mode 100644 docs/framework/react/reference/interfaces/CancelOptions.md create mode 100644 docs/framework/react/reference/interfaces/DefaultOptions.md create mode 100644 docs/framework/react/reference/interfaces/DehydrateOptions.md create mode 100644 docs/framework/react/reference/interfaces/DehydratedState.md create mode 100644 docs/framework/react/reference/interfaces/EnsureQueryDataOptions.md create mode 100644 docs/framework/react/reference/interfaces/FetchNextPageOptions.md create mode 100644 docs/framework/react/reference/interfaces/FetchPreviousPageOptions.md create mode 100644 docs/framework/react/reference/interfaces/FetchQueryOptions.md create mode 100644 docs/framework/react/reference/interfaces/HydrateOptions.md create mode 100644 docs/framework/react/reference/interfaces/InfiniteData.md create mode 100644 docs/framework/react/reference/interfaces/InfiniteQueryObserverBaseResult.md create mode 100644 docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md create mode 100644 docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult.md create mode 100644 docs/framework/react/reference/interfaces/InfiniteQueryObserverOptions.md create mode 100644 docs/framework/react/reference/interfaces/InfiniteQueryObserverPendingResult.md create mode 100644 docs/framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md create mode 100644 docs/framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md create mode 100644 docs/framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult.md create mode 100644 docs/framework/react/reference/interfaces/InfiniteQueryPageParamsOptions.md create mode 100644 docs/framework/react/reference/interfaces/InitialPageParam.md create mode 100644 docs/framework/react/reference/interfaces/InvalidateOptions.md create mode 100644 docs/framework/react/reference/interfaces/InvalidateQueryFilters.md create mode 100644 docs/framework/react/reference/interfaces/MutateOptions.md create mode 100644 docs/framework/react/reference/interfaces/MutationCacheConfig.md create mode 100644 docs/framework/react/reference/interfaces/MutationFilters.md create mode 100644 docs/framework/react/reference/interfaces/MutationObserverBaseResult.md create mode 100644 docs/framework/react/reference/interfaces/MutationObserverErrorResult.md create mode 100644 docs/framework/react/reference/interfaces/MutationObserverIdleResult.md create mode 100644 docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md create mode 100644 docs/framework/react/reference/interfaces/MutationObserverOptions.md create mode 100644 docs/framework/react/reference/interfaces/MutationObserverSuccessResult.md create mode 100644 docs/framework/react/reference/interfaces/MutationOptions.md create mode 100644 docs/framework/react/reference/interfaces/MutationState.md create mode 100644 docs/framework/react/reference/interfaces/NotifyEvent.md create mode 100644 docs/framework/react/reference/interfaces/QueriesObserverOptions.md create mode 100644 docs/framework/react/reference/interfaces/QueryCacheConfig.md create mode 100644 docs/framework/react/reference/interfaces/QueryClientConfig.md create mode 100644 docs/framework/react/reference/interfaces/QueryExecuteOptions.md create mode 100644 docs/framework/react/reference/interfaces/QueryFilters.md create mode 100644 docs/framework/react/reference/interfaces/QueryObserverBaseResult.md create mode 100644 docs/framework/react/reference/interfaces/QueryObserverLoadingErrorResult.md create mode 100644 docs/framework/react/reference/interfaces/QueryObserverLoadingResult.md create mode 100644 docs/framework/react/reference/interfaces/QueryObserverOptions.md create mode 100644 docs/framework/react/reference/interfaces/QueryObserverPendingResult.md create mode 100644 docs/framework/react/reference/interfaces/QueryObserverPlaceholderResult.md create mode 100644 docs/framework/react/reference/interfaces/QueryObserverRefetchErrorResult.md create mode 100644 docs/framework/react/reference/interfaces/QueryObserverSuccessResult.md create mode 100644 docs/framework/react/reference/interfaces/QueryOptions.md create mode 100644 docs/framework/react/reference/interfaces/QueryState.md create mode 100644 docs/framework/react/reference/interfaces/RefetchOptions.md create mode 100644 docs/framework/react/reference/interfaces/RefetchQueryFilters.md create mode 100644 docs/framework/react/reference/interfaces/Register.md create mode 100644 docs/framework/react/reference/interfaces/ResetOptions.md create mode 100644 docs/framework/react/reference/interfaces/ResultOptions.md create mode 100644 docs/framework/react/reference/interfaces/SetDataOptions.md create mode 100644 docs/framework/react/reference/type-aliases/AnyDataTag.md create mode 100644 docs/framework/react/reference/type-aliases/DataTag.md create mode 100644 docs/framework/react/reference/type-aliases/DefaultError.md create mode 100644 docs/framework/react/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md create mode 100644 docs/framework/react/reference/type-aliases/DefaultedQueryObserverOptions.md create mode 100644 docs/framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult.md create mode 100644 docs/framework/react/reference/type-aliases/DefinedQueryObserverResult.md create mode 100644 docs/framework/react/reference/type-aliases/DistributiveOmit.md create mode 100644 docs/framework/react/reference/type-aliases/EnsureInfiniteQueryDataOptions.md create mode 100644 docs/framework/react/reference/type-aliases/FetchInfiniteQueryOptions.md create mode 100644 docs/framework/react/reference/type-aliases/FetchStatus.md create mode 100644 docs/framework/react/reference/type-aliases/GetNextPageParamFunction.md create mode 100644 docs/framework/react/reference/type-aliases/GetPreviousPageParamFunction.md create mode 100644 docs/framework/react/reference/type-aliases/InferDataFromTag.md create mode 100644 docs/framework/react/reference/type-aliases/InferErrorFromTag.md create mode 100644 docs/framework/react/reference/type-aliases/InfiniteQueryExecuteOptions.md create mode 100644 docs/framework/react/reference/type-aliases/InfiniteQueryObserverResult.md create mode 100644 docs/framework/react/reference/type-aliases/InitialDataFunction.md create mode 100644 docs/framework/react/reference/type-aliases/ManagedTimerId.md create mode 100644 docs/framework/react/reference/type-aliases/MutateFunction.md create mode 100644 docs/framework/react/reference/type-aliases/MutateFunctionRest.md create mode 100644 docs/framework/react/reference/type-aliases/MutationCacheNotifyEvent.md create mode 100644 docs/framework/react/reference/type-aliases/MutationFunction.md create mode 100644 docs/framework/react/reference/type-aliases/MutationFunctionContext.md create mode 100644 docs/framework/react/reference/type-aliases/MutationKey.md create mode 100644 docs/framework/react/reference/type-aliases/MutationMeta.md create mode 100644 docs/framework/react/reference/type-aliases/MutationObserverResult.md create mode 100644 docs/framework/react/reference/type-aliases/MutationScope.md create mode 100644 docs/framework/react/reference/type-aliases/MutationStatus.md create mode 100644 docs/framework/react/reference/type-aliases/NetworkMode.md create mode 100644 docs/framework/react/reference/type-aliases/NonUndefinedGuard.md create mode 100644 docs/framework/react/reference/type-aliases/NotifyEventType.md create mode 100644 docs/framework/react/reference/type-aliases/NotifyOnChangeProps.md create mode 100644 docs/framework/react/reference/type-aliases/OmitKeyof.md create mode 100644 docs/framework/react/reference/type-aliases/Override.md create mode 100644 docs/framework/react/reference/type-aliases/PlaceholderDataFunction.md create mode 100644 docs/framework/react/reference/type-aliases/QueriesPlaceholderDataFunction.md create mode 100644 docs/framework/react/reference/type-aliases/QueryBooleanOption.md create mode 100644 docs/framework/react/reference/type-aliases/QueryCacheNotifyEvent.md create mode 100644 docs/framework/react/reference/type-aliases/QueryFunction.md create mode 100644 docs/framework/react/reference/type-aliases/QueryFunctionContext.md create mode 100644 docs/framework/react/reference/type-aliases/QueryKey.md create mode 100644 docs/framework/react/reference/type-aliases/QueryKeyHashFunction.md create mode 100644 docs/framework/react/reference/type-aliases/QueryKeyWithDataTag.md create mode 100644 docs/framework/react/reference/type-aliases/QueryMeta.md create mode 100644 docs/framework/react/reference/type-aliases/QueryObserverResult.md create mode 100644 docs/framework/react/reference/type-aliases/QueryPersister.md create mode 100644 docs/framework/react/reference/type-aliases/QueryStatus.md create mode 100644 docs/framework/react/reference/type-aliases/SkipToken.md create mode 100644 docs/framework/react/reference/type-aliases/StaleTime.md create mode 100644 docs/framework/react/reference/type-aliases/StaleTimeFunction.md create mode 100644 docs/framework/react/reference/type-aliases/ThrowOnError.md create mode 100644 docs/framework/react/reference/type-aliases/TimeoutCallback.md create mode 100644 docs/framework/react/reference/type-aliases/TimeoutProvider.md create mode 100644 docs/framework/react/reference/type-aliases/UnsetMarker.md create mode 100644 docs/framework/react/reference/type-aliases/Updater.md create mode 100644 docs/framework/react/reference/type-aliases/WithRequired.md create mode 100644 docs/framework/react/reference/type-aliases/dataTagErrorSymbol.md create mode 100644 docs/framework/react/reference/type-aliases/dataTagSymbol.md create mode 100644 docs/framework/react/reference/variables/dataTagErrorSymbol.md create mode 100644 docs/framework/react/reference/variables/dataTagSymbol.md create mode 100644 docs/framework/react/reference/variables/defaultScheduler.md create mode 100644 docs/framework/react/reference/variables/environmentManager.md create mode 100644 docs/framework/react/reference/variables/focusManager.md create mode 100644 docs/framework/react/reference/variables/isServer.md create mode 100644 docs/framework/react/reference/variables/notifyManager.md create mode 100644 docs/framework/react/reference/variables/onlineManager.md create mode 100644 docs/framework/react/reference/variables/skipToken.md create mode 100644 docs/framework/react/reference/variables/timeoutManager.md create mode 100644 docs/framework/react/reference/variables/unsetMarker.md create mode 100644 docs/framework/solid/reference/classes/CancelledError.md create mode 100644 docs/framework/solid/reference/classes/InfiniteQueryObserver.md create mode 100644 docs/framework/solid/reference/classes/Mutation.md create mode 100644 docs/framework/solid/reference/classes/MutationCache.md create mode 100644 docs/framework/solid/reference/classes/MutationObserver.md create mode 100644 docs/framework/solid/reference/classes/QueriesObserver.md create mode 100644 docs/framework/solid/reference/classes/Query.md create mode 100644 docs/framework/solid/reference/classes/QueryCache.md create mode 100644 docs/framework/solid/reference/classes/QueryObserver.md create mode 100644 docs/framework/solid/reference/functions/defaultShouldDehydrateMutation.md create mode 100644 docs/framework/solid/reference/functions/defaultShouldDehydrateQuery.md create mode 100644 docs/framework/solid/reference/functions/dehydrate.md create mode 100644 docs/framework/solid/reference/functions/dehydrateQuery.md create mode 100644 docs/framework/solid/reference/functions/experimental_streamedQuery.md create mode 100644 docs/framework/solid/reference/functions/hashKey.md create mode 100644 docs/framework/solid/reference/functions/hydrate.md create mode 100644 docs/framework/solid/reference/functions/isCancelledError.md create mode 100644 docs/framework/solid/reference/functions/keepPreviousData.md create mode 100644 docs/framework/solid/reference/functions/matchMutation.md create mode 100644 docs/framework/solid/reference/functions/matchQuery.md create mode 100644 docs/framework/solid/reference/functions/noop.md create mode 100644 docs/framework/solid/reference/functions/partialMatchKey.md create mode 100644 docs/framework/solid/reference/functions/replaceEqualDeep.md create mode 100644 docs/framework/solid/reference/functions/shouldThrowError.md create mode 100644 docs/framework/solid/reference/interfaces/CancelOptions.md create mode 100644 docs/framework/solid/reference/interfaces/DehydrateOptions.md create mode 100644 docs/framework/solid/reference/interfaces/DehydratedState.md create mode 100644 docs/framework/solid/reference/interfaces/EnsureQueryDataOptions.md create mode 100644 docs/framework/solid/reference/interfaces/FetchNextPageOptions.md create mode 100644 docs/framework/solid/reference/interfaces/FetchPreviousPageOptions.md create mode 100644 docs/framework/solid/reference/interfaces/FetchQueryOptions.md create mode 100644 docs/framework/solid/reference/interfaces/HydrateOptions.md create mode 100644 docs/framework/solid/reference/interfaces/InfiniteData.md create mode 100644 docs/framework/solid/reference/interfaces/InfiniteQueryObserverBaseResult.md create mode 100644 docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md create mode 100644 docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult.md create mode 100644 docs/framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult.md create mode 100644 docs/framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md create mode 100644 docs/framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md create mode 100644 docs/framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult.md create mode 100644 docs/framework/solid/reference/interfaces/InfiniteQueryPageParamsOptions.md create mode 100644 docs/framework/solid/reference/interfaces/InitialPageParam.md create mode 100644 docs/framework/solid/reference/interfaces/InvalidateOptions.md create mode 100644 docs/framework/solid/reference/interfaces/InvalidateQueryFilters.md create mode 100644 docs/framework/solid/reference/interfaces/MutateOptions.md create mode 100644 docs/framework/solid/reference/interfaces/MutationCacheConfig.md create mode 100644 docs/framework/solid/reference/interfaces/MutationFilters.md create mode 100644 docs/framework/solid/reference/interfaces/MutationObserverBaseResult.md create mode 100644 docs/framework/solid/reference/interfaces/MutationObserverErrorResult.md create mode 100644 docs/framework/solid/reference/interfaces/MutationObserverIdleResult.md create mode 100644 docs/framework/solid/reference/interfaces/MutationObserverLoadingResult.md create mode 100644 docs/framework/solid/reference/interfaces/MutationObserverOptions.md create mode 100644 docs/framework/solid/reference/interfaces/MutationObserverSuccessResult.md create mode 100644 docs/framework/solid/reference/interfaces/MutationState.md create mode 100644 docs/framework/solid/reference/interfaces/NotifyEvent.md create mode 100644 docs/framework/solid/reference/interfaces/QueriesObserverOptions.md create mode 100644 docs/framework/solid/reference/interfaces/QueryCacheConfig.md create mode 100644 docs/framework/solid/reference/interfaces/QueryExecuteOptions.md create mode 100644 docs/framework/solid/reference/interfaces/QueryFilters.md create mode 100644 docs/framework/solid/reference/interfaces/QueryObserverBaseResult.md create mode 100644 docs/framework/solid/reference/interfaces/QueryObserverLoadingErrorResult.md create mode 100644 docs/framework/solid/reference/interfaces/QueryObserverLoadingResult.md create mode 100644 docs/framework/solid/reference/interfaces/QueryObserverPendingResult.md create mode 100644 docs/framework/solid/reference/interfaces/QueryObserverPlaceholderResult.md create mode 100644 docs/framework/solid/reference/interfaces/QueryObserverRefetchErrorResult.md create mode 100644 docs/framework/solid/reference/interfaces/QueryObserverSuccessResult.md create mode 100644 docs/framework/solid/reference/interfaces/QueryState.md create mode 100644 docs/framework/solid/reference/interfaces/RefetchOptions.md create mode 100644 docs/framework/solid/reference/interfaces/RefetchQueryFilters.md create mode 100644 docs/framework/solid/reference/interfaces/Register.md create mode 100644 docs/framework/solid/reference/interfaces/ResetOptions.md create mode 100644 docs/framework/solid/reference/interfaces/ResultOptions.md create mode 100644 docs/framework/solid/reference/interfaces/SetDataOptions.md create mode 100644 docs/framework/solid/reference/type-aliases/AnyDataTag.md create mode 100644 docs/framework/solid/reference/type-aliases/DataTag.md create mode 100644 docs/framework/solid/reference/type-aliases/DefaultError.md create mode 100644 docs/framework/solid/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md create mode 100644 docs/framework/solid/reference/type-aliases/DefaultedQueryObserverOptions.md create mode 100644 docs/framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult.md create mode 100644 docs/framework/solid/reference/type-aliases/DefinedQueryObserverResult.md create mode 100644 docs/framework/solid/reference/type-aliases/DistributiveOmit.md create mode 100644 docs/framework/solid/reference/type-aliases/EnsureInfiniteQueryDataOptions.md create mode 100644 docs/framework/solid/reference/type-aliases/FetchInfiniteQueryOptions.md create mode 100644 docs/framework/solid/reference/type-aliases/FetchStatus.md create mode 100644 docs/framework/solid/reference/type-aliases/GetNextPageParamFunction.md create mode 100644 docs/framework/solid/reference/type-aliases/GetPreviousPageParamFunction.md create mode 100644 docs/framework/solid/reference/type-aliases/InferDataFromTag.md create mode 100644 docs/framework/solid/reference/type-aliases/InferErrorFromTag.md create mode 100644 docs/framework/solid/reference/type-aliases/InfiniteQueryExecuteOptions.md create mode 100644 docs/framework/solid/reference/type-aliases/InfiniteQueryObserverResult.md create mode 100644 docs/framework/solid/reference/type-aliases/InitialDataFunction.md create mode 100644 docs/framework/solid/reference/type-aliases/ManagedTimerId.md create mode 100644 docs/framework/solid/reference/type-aliases/MutateFunction.md create mode 100644 docs/framework/solid/reference/type-aliases/MutateFunctionRest.md create mode 100644 docs/framework/solid/reference/type-aliases/MutationCacheNotifyEvent.md create mode 100644 docs/framework/solid/reference/type-aliases/MutationFunction.md create mode 100644 docs/framework/solid/reference/type-aliases/MutationFunctionContext.md create mode 100644 docs/framework/solid/reference/type-aliases/MutationKey.md create mode 100644 docs/framework/solid/reference/type-aliases/MutationMeta.md create mode 100644 docs/framework/solid/reference/type-aliases/MutationObserverResult.md create mode 100644 docs/framework/solid/reference/type-aliases/MutationScope.md create mode 100644 docs/framework/solid/reference/type-aliases/MutationStatus.md create mode 100644 docs/framework/solid/reference/type-aliases/NetworkMode.md create mode 100644 docs/framework/solid/reference/type-aliases/NonUndefinedGuard.md create mode 100644 docs/framework/solid/reference/type-aliases/NotifyEventType.md create mode 100644 docs/framework/solid/reference/type-aliases/NotifyOnChangeProps.md create mode 100644 docs/framework/solid/reference/type-aliases/OmitKeyof.md create mode 100644 docs/framework/solid/reference/type-aliases/Override.md create mode 100644 docs/framework/solid/reference/type-aliases/PlaceholderDataFunction.md create mode 100644 docs/framework/solid/reference/type-aliases/QueriesPlaceholderDataFunction.md create mode 100644 docs/framework/solid/reference/type-aliases/QueryBooleanOption.md create mode 100644 docs/framework/solid/reference/type-aliases/QueryCacheNotifyEvent.md create mode 100644 docs/framework/solid/reference/type-aliases/QueryFunction.md create mode 100644 docs/framework/solid/reference/type-aliases/QueryFunctionContext.md create mode 100644 docs/framework/solid/reference/type-aliases/QueryKey.md create mode 100644 docs/framework/solid/reference/type-aliases/QueryKeyHashFunction.md create mode 100644 docs/framework/solid/reference/type-aliases/QueryKeyWithDataTag.md create mode 100644 docs/framework/solid/reference/type-aliases/QueryMeta.md create mode 100644 docs/framework/solid/reference/type-aliases/QueryObserverResult.md create mode 100644 docs/framework/solid/reference/type-aliases/QueryPersister.md create mode 100644 docs/framework/solid/reference/type-aliases/QueryStatus.md create mode 100644 docs/framework/solid/reference/type-aliases/SkipToken.md create mode 100644 docs/framework/solid/reference/type-aliases/StaleTime.md create mode 100644 docs/framework/solid/reference/type-aliases/StaleTimeFunction.md create mode 100644 docs/framework/solid/reference/type-aliases/ThrowOnError.md create mode 100644 docs/framework/solid/reference/type-aliases/TimeoutCallback.md create mode 100644 docs/framework/solid/reference/type-aliases/TimeoutProvider.md create mode 100644 docs/framework/solid/reference/type-aliases/UnsetMarker.md create mode 100644 docs/framework/solid/reference/type-aliases/Updater.md create mode 100644 docs/framework/solid/reference/type-aliases/WithRequired.md create mode 100644 docs/framework/solid/reference/type-aliases/dataTagErrorSymbol.md create mode 100644 docs/framework/solid/reference/type-aliases/dataTagSymbol.md create mode 100644 docs/framework/solid/reference/variables/dataTagErrorSymbol.md create mode 100644 docs/framework/solid/reference/variables/dataTagSymbol.md create mode 100644 docs/framework/solid/reference/variables/defaultScheduler.md create mode 100644 docs/framework/solid/reference/variables/environmentManager.md create mode 100644 docs/framework/solid/reference/variables/focusManager.md create mode 100644 docs/framework/solid/reference/variables/isServer.md create mode 100644 docs/framework/solid/reference/variables/notifyManager.md create mode 100644 docs/framework/solid/reference/variables/onlineManager.md create mode 100644 docs/framework/solid/reference/variables/skipToken.md create mode 100644 docs/framework/solid/reference/variables/timeoutManager.md create mode 100644 docs/framework/solid/reference/variables/unsetMarker.md create mode 100644 docs/framework/svelte/reference/classes/CancelledError.md create mode 100644 docs/framework/svelte/reference/classes/InfiniteQueryObserver.md create mode 100644 docs/framework/svelte/reference/classes/Mutation.md create mode 100644 docs/framework/svelte/reference/classes/MutationCache.md create mode 100644 docs/framework/svelte/reference/classes/MutationObserver.md create mode 100644 docs/framework/svelte/reference/classes/QueriesObserver.md create mode 100644 docs/framework/svelte/reference/classes/Query.md create mode 100644 docs/framework/svelte/reference/classes/QueryCache.md create mode 100644 docs/framework/svelte/reference/classes/QueryClient.md create mode 100644 docs/framework/svelte/reference/classes/QueryObserver.md create mode 100644 docs/framework/svelte/reference/functions/defaultShouldDehydrateMutation.md create mode 100644 docs/framework/svelte/reference/functions/defaultShouldDehydrateQuery.md create mode 100644 docs/framework/svelte/reference/functions/dehydrate.md create mode 100644 docs/framework/svelte/reference/functions/dehydrateQuery.md create mode 100644 docs/framework/svelte/reference/functions/experimental_streamedQuery.md create mode 100644 docs/framework/svelte/reference/functions/hashKey.md create mode 100644 docs/framework/svelte/reference/functions/hydrate.md create mode 100644 docs/framework/svelte/reference/functions/isCancelledError.md create mode 100644 docs/framework/svelte/reference/functions/keepPreviousData.md create mode 100644 docs/framework/svelte/reference/functions/matchMutation.md create mode 100644 docs/framework/svelte/reference/functions/matchQuery.md create mode 100644 docs/framework/svelte/reference/functions/noop.md create mode 100644 docs/framework/svelte/reference/functions/partialMatchKey.md create mode 100644 docs/framework/svelte/reference/functions/replaceEqualDeep.md create mode 100644 docs/framework/svelte/reference/functions/shouldThrowError.md create mode 100644 docs/framework/svelte/reference/interfaces/CancelOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/DefaultOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/DehydrateOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/DehydratedState.md create mode 100644 docs/framework/svelte/reference/interfaces/EnsureQueryDataOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/FetchNextPageOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/FetchPreviousPageOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/FetchQueryOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/HydrateOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/InfiniteData.md create mode 100644 docs/framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult.md create mode 100644 docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md create mode 100644 docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult.md create mode 100644 docs/framework/svelte/reference/interfaces/InfiniteQueryObserverOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult.md create mode 100644 docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md create mode 100644 docs/framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md create mode 100644 docs/framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult.md create mode 100644 docs/framework/svelte/reference/interfaces/InfiniteQueryPageParamsOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/InitialPageParam.md create mode 100644 docs/framework/svelte/reference/interfaces/InvalidateOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/InvalidateQueryFilters.md create mode 100644 docs/framework/svelte/reference/interfaces/MutateOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/MutationCacheConfig.md create mode 100644 docs/framework/svelte/reference/interfaces/MutationFilters.md create mode 100644 docs/framework/svelte/reference/interfaces/MutationObserverBaseResult.md create mode 100644 docs/framework/svelte/reference/interfaces/MutationObserverErrorResult.md create mode 100644 docs/framework/svelte/reference/interfaces/MutationObserverIdleResult.md create mode 100644 docs/framework/svelte/reference/interfaces/MutationObserverLoadingResult.md create mode 100644 docs/framework/svelte/reference/interfaces/MutationObserverOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/MutationObserverSuccessResult.md create mode 100644 docs/framework/svelte/reference/interfaces/MutationOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/MutationState.md create mode 100644 docs/framework/svelte/reference/interfaces/NotifyEvent.md create mode 100644 docs/framework/svelte/reference/interfaces/QueriesObserverOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/QueryCacheConfig.md create mode 100644 docs/framework/svelte/reference/interfaces/QueryClientConfig.md create mode 100644 docs/framework/svelte/reference/interfaces/QueryExecuteOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/QueryFilters.md create mode 100644 docs/framework/svelte/reference/interfaces/QueryObserverBaseResult.md create mode 100644 docs/framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult.md create mode 100644 docs/framework/svelte/reference/interfaces/QueryObserverLoadingResult.md create mode 100644 docs/framework/svelte/reference/interfaces/QueryObserverOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/QueryObserverPendingResult.md create mode 100644 docs/framework/svelte/reference/interfaces/QueryObserverPlaceholderResult.md create mode 100644 docs/framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult.md create mode 100644 docs/framework/svelte/reference/interfaces/QueryObserverSuccessResult.md create mode 100644 docs/framework/svelte/reference/interfaces/QueryOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/QueryState.md create mode 100644 docs/framework/svelte/reference/interfaces/RefetchOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/RefetchQueryFilters.md create mode 100644 docs/framework/svelte/reference/interfaces/Register.md create mode 100644 docs/framework/svelte/reference/interfaces/ResetOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/ResultOptions.md create mode 100644 docs/framework/svelte/reference/interfaces/SetDataOptions.md create mode 100644 docs/framework/svelte/reference/type-aliases/AnyDataTag.md create mode 100644 docs/framework/svelte/reference/type-aliases/DataTag.md create mode 100644 docs/framework/svelte/reference/type-aliases/DefaultError.md create mode 100644 docs/framework/svelte/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md create mode 100644 docs/framework/svelte/reference/type-aliases/DefaultedQueryObserverOptions.md create mode 100644 docs/framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult.md create mode 100644 docs/framework/svelte/reference/type-aliases/DefinedQueryObserverResult.md create mode 100644 docs/framework/svelte/reference/type-aliases/DistributiveOmit.md create mode 100644 docs/framework/svelte/reference/type-aliases/EnsureInfiniteQueryDataOptions.md create mode 100644 docs/framework/svelte/reference/type-aliases/FetchInfiniteQueryOptions.md create mode 100644 docs/framework/svelte/reference/type-aliases/FetchStatus.md create mode 100644 docs/framework/svelte/reference/type-aliases/GetNextPageParamFunction.md create mode 100644 docs/framework/svelte/reference/type-aliases/GetPreviousPageParamFunction.md create mode 100644 docs/framework/svelte/reference/type-aliases/InferDataFromTag.md create mode 100644 docs/framework/svelte/reference/type-aliases/InferErrorFromTag.md create mode 100644 docs/framework/svelte/reference/type-aliases/InfiniteQueryExecuteOptions.md create mode 100644 docs/framework/svelte/reference/type-aliases/InfiniteQueryObserverResult.md create mode 100644 docs/framework/svelte/reference/type-aliases/InitialDataFunction.md create mode 100644 docs/framework/svelte/reference/type-aliases/ManagedTimerId.md create mode 100644 docs/framework/svelte/reference/type-aliases/MutateFunction.md create mode 100644 docs/framework/svelte/reference/type-aliases/MutateFunctionRest.md create mode 100644 docs/framework/svelte/reference/type-aliases/MutationCacheNotifyEvent.md create mode 100644 docs/framework/svelte/reference/type-aliases/MutationFunction.md create mode 100644 docs/framework/svelte/reference/type-aliases/MutationFunctionContext.md create mode 100644 docs/framework/svelte/reference/type-aliases/MutationKey.md create mode 100644 docs/framework/svelte/reference/type-aliases/MutationMeta.md create mode 100644 docs/framework/svelte/reference/type-aliases/MutationObserverResult.md create mode 100644 docs/framework/svelte/reference/type-aliases/MutationScope.md create mode 100644 docs/framework/svelte/reference/type-aliases/MutationStatus.md create mode 100644 docs/framework/svelte/reference/type-aliases/NetworkMode.md create mode 100644 docs/framework/svelte/reference/type-aliases/NonUndefinedGuard.md create mode 100644 docs/framework/svelte/reference/type-aliases/NotifyEventType.md create mode 100644 docs/framework/svelte/reference/type-aliases/NotifyOnChangeProps.md create mode 100644 docs/framework/svelte/reference/type-aliases/OmitKeyof.md create mode 100644 docs/framework/svelte/reference/type-aliases/Override.md create mode 100644 docs/framework/svelte/reference/type-aliases/PlaceholderDataFunction.md create mode 100644 docs/framework/svelte/reference/type-aliases/QueriesPlaceholderDataFunction.md create mode 100644 docs/framework/svelte/reference/type-aliases/QueryBooleanOption.md create mode 100644 docs/framework/svelte/reference/type-aliases/QueryCacheNotifyEvent.md create mode 100644 docs/framework/svelte/reference/type-aliases/QueryFunction.md create mode 100644 docs/framework/svelte/reference/type-aliases/QueryFunctionContext.md create mode 100644 docs/framework/svelte/reference/type-aliases/QueryKey.md create mode 100644 docs/framework/svelte/reference/type-aliases/QueryKeyHashFunction.md create mode 100644 docs/framework/svelte/reference/type-aliases/QueryKeyWithDataTag.md create mode 100644 docs/framework/svelte/reference/type-aliases/QueryMeta.md create mode 100644 docs/framework/svelte/reference/type-aliases/QueryObserverResult.md create mode 100644 docs/framework/svelte/reference/type-aliases/QueryPersister.md create mode 100644 docs/framework/svelte/reference/type-aliases/QueryStatus.md create mode 100644 docs/framework/svelte/reference/type-aliases/SkipToken.md create mode 100644 docs/framework/svelte/reference/type-aliases/StaleTime.md create mode 100644 docs/framework/svelte/reference/type-aliases/StaleTimeFunction.md create mode 100644 docs/framework/svelte/reference/type-aliases/ThrowOnError.md create mode 100644 docs/framework/svelte/reference/type-aliases/TimeoutCallback.md create mode 100644 docs/framework/svelte/reference/type-aliases/TimeoutProvider.md create mode 100644 docs/framework/svelte/reference/type-aliases/UnsetMarker.md create mode 100644 docs/framework/svelte/reference/type-aliases/Updater.md create mode 100644 docs/framework/svelte/reference/type-aliases/WithRequired.md create mode 100644 docs/framework/svelte/reference/type-aliases/dataTagErrorSymbol.md create mode 100644 docs/framework/svelte/reference/type-aliases/dataTagSymbol.md create mode 100644 docs/framework/svelte/reference/variables/dataTagErrorSymbol.md create mode 100644 docs/framework/svelte/reference/variables/dataTagSymbol.md create mode 100644 docs/framework/svelte/reference/variables/defaultScheduler.md create mode 100644 docs/framework/svelte/reference/variables/environmentManager.md create mode 100644 docs/framework/svelte/reference/variables/focusManager.md create mode 100644 docs/framework/svelte/reference/variables/isServer.md create mode 100644 docs/framework/svelte/reference/variables/notifyManager.md create mode 100644 docs/framework/svelte/reference/variables/onlineManager.md create mode 100644 docs/framework/svelte/reference/variables/skipToken.md create mode 100644 docs/framework/svelte/reference/variables/timeoutManager.md create mode 100644 docs/framework/svelte/reference/variables/unsetMarker.md create mode 100644 docs/framework/vue/reference/classes/CancelledError.md create mode 100644 docs/framework/vue/reference/classes/InfiniteQueryObserver.md create mode 100644 docs/framework/vue/reference/classes/Mutation.md create mode 100644 docs/framework/vue/reference/classes/MutationObserver.md create mode 100644 docs/framework/vue/reference/classes/QueriesObserver.md create mode 100644 docs/framework/vue/reference/classes/Query.md create mode 100644 docs/framework/vue/reference/classes/QueryObserver.md create mode 100644 docs/framework/vue/reference/functions/defaultShouldDehydrateMutation.md create mode 100644 docs/framework/vue/reference/functions/defaultShouldDehydrateQuery.md create mode 100644 docs/framework/vue/reference/functions/dehydrate.md create mode 100644 docs/framework/vue/reference/functions/dehydrateQuery.md create mode 100644 docs/framework/vue/reference/functions/experimental_streamedQuery.md create mode 100644 docs/framework/vue/reference/functions/hashKey.md create mode 100644 docs/framework/vue/reference/functions/hydrate.md create mode 100644 docs/framework/vue/reference/functions/isCancelledError.md create mode 100644 docs/framework/vue/reference/functions/keepPreviousData.md create mode 100644 docs/framework/vue/reference/functions/matchMutation.md create mode 100644 docs/framework/vue/reference/functions/matchQuery.md create mode 100644 docs/framework/vue/reference/functions/noop.md create mode 100644 docs/framework/vue/reference/functions/partialMatchKey.md create mode 100644 docs/framework/vue/reference/functions/replaceEqualDeep.md create mode 100644 docs/framework/vue/reference/functions/shouldThrowError.md create mode 100644 docs/framework/vue/reference/interfaces/CancelOptions.md create mode 100644 docs/framework/vue/reference/interfaces/DefaultOptions.md create mode 100644 docs/framework/vue/reference/interfaces/DehydrateOptions.md create mode 100644 docs/framework/vue/reference/interfaces/DehydratedState.md create mode 100644 docs/framework/vue/reference/interfaces/EnsureQueryDataOptions.md create mode 100644 docs/framework/vue/reference/interfaces/FetchNextPageOptions.md create mode 100644 docs/framework/vue/reference/interfaces/FetchPreviousPageOptions.md create mode 100644 docs/framework/vue/reference/interfaces/FetchQueryOptions.md create mode 100644 docs/framework/vue/reference/interfaces/HydrateOptions.md create mode 100644 docs/framework/vue/reference/interfaces/InfiniteData.md create mode 100644 docs/framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult.md create mode 100644 docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md create mode 100644 docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult.md create mode 100644 docs/framework/vue/reference/interfaces/InfiniteQueryObserverOptions.md create mode 100644 docs/framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult.md create mode 100644 docs/framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md create mode 100644 docs/framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md create mode 100644 docs/framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult.md create mode 100644 docs/framework/vue/reference/interfaces/InfiniteQueryPageParamsOptions.md create mode 100644 docs/framework/vue/reference/interfaces/InitialPageParam.md create mode 100644 docs/framework/vue/reference/interfaces/InvalidateOptions.md create mode 100644 docs/framework/vue/reference/interfaces/InvalidateQueryFilters.md create mode 100644 docs/framework/vue/reference/interfaces/MutateOptions.md create mode 100644 docs/framework/vue/reference/interfaces/MutationCacheConfig.md create mode 100644 docs/framework/vue/reference/interfaces/MutationObserverBaseResult.md create mode 100644 docs/framework/vue/reference/interfaces/MutationObserverErrorResult.md create mode 100644 docs/framework/vue/reference/interfaces/MutationObserverIdleResult.md create mode 100644 docs/framework/vue/reference/interfaces/MutationObserverLoadingResult.md create mode 100644 docs/framework/vue/reference/interfaces/MutationObserverOptions.md create mode 100644 docs/framework/vue/reference/interfaces/MutationObserverSuccessResult.md create mode 100644 docs/framework/vue/reference/interfaces/MutationState.md create mode 100644 docs/framework/vue/reference/interfaces/NotifyEvent.md create mode 100644 docs/framework/vue/reference/interfaces/QueriesObserverOptions.md create mode 100644 docs/framework/vue/reference/interfaces/QueryCacheConfig.md create mode 100644 docs/framework/vue/reference/interfaces/QueryClientConfig.md create mode 100644 docs/framework/vue/reference/interfaces/QueryExecuteOptions.md create mode 100644 docs/framework/vue/reference/interfaces/QueryObserverBaseResult.md create mode 100644 docs/framework/vue/reference/interfaces/QueryObserverLoadingErrorResult.md create mode 100644 docs/framework/vue/reference/interfaces/QueryObserverLoadingResult.md create mode 100644 docs/framework/vue/reference/interfaces/QueryObserverOptions.md create mode 100644 docs/framework/vue/reference/interfaces/QueryObserverPendingResult.md create mode 100644 docs/framework/vue/reference/interfaces/QueryObserverPlaceholderResult.md create mode 100644 docs/framework/vue/reference/interfaces/QueryObserverRefetchErrorResult.md create mode 100644 docs/framework/vue/reference/interfaces/QueryObserverSuccessResult.md create mode 100644 docs/framework/vue/reference/interfaces/QueryState.md create mode 100644 docs/framework/vue/reference/interfaces/RefetchOptions.md create mode 100644 docs/framework/vue/reference/interfaces/RefetchQueryFilters.md create mode 100644 docs/framework/vue/reference/interfaces/Register.md create mode 100644 docs/framework/vue/reference/interfaces/ResetOptions.md create mode 100644 docs/framework/vue/reference/interfaces/ResultOptions.md create mode 100644 docs/framework/vue/reference/interfaces/SetDataOptions.md create mode 100644 docs/framework/vue/reference/type-aliases/AnyDataTag.md create mode 100644 docs/framework/vue/reference/type-aliases/DataTag.md create mode 100644 docs/framework/vue/reference/type-aliases/DefaultError.md create mode 100644 docs/framework/vue/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md create mode 100644 docs/framework/vue/reference/type-aliases/DefaultedQueryObserverOptions.md create mode 100644 docs/framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult.md create mode 100644 docs/framework/vue/reference/type-aliases/DefinedQueryObserverResult.md create mode 100644 docs/framework/vue/reference/type-aliases/DistributiveOmit.md create mode 100644 docs/framework/vue/reference/type-aliases/EnsureInfiniteQueryDataOptions.md create mode 100644 docs/framework/vue/reference/type-aliases/FetchInfiniteQueryOptions.md create mode 100644 docs/framework/vue/reference/type-aliases/FetchStatus.md create mode 100644 docs/framework/vue/reference/type-aliases/GetNextPageParamFunction.md create mode 100644 docs/framework/vue/reference/type-aliases/GetPreviousPageParamFunction.md create mode 100644 docs/framework/vue/reference/type-aliases/InferDataFromTag.md create mode 100644 docs/framework/vue/reference/type-aliases/InferErrorFromTag.md create mode 100644 docs/framework/vue/reference/type-aliases/InfiniteQueryExecuteOptions.md create mode 100644 docs/framework/vue/reference/type-aliases/InfiniteQueryObserverResult.md create mode 100644 docs/framework/vue/reference/type-aliases/InitialDataFunction.md create mode 100644 docs/framework/vue/reference/type-aliases/ManagedTimerId.md create mode 100644 docs/framework/vue/reference/type-aliases/MutateFunction.md create mode 100644 docs/framework/vue/reference/type-aliases/MutateFunctionRest.md create mode 100644 docs/framework/vue/reference/type-aliases/MutationCacheNotifyEvent.md create mode 100644 docs/framework/vue/reference/type-aliases/MutationFunction.md create mode 100644 docs/framework/vue/reference/type-aliases/MutationFunctionContext.md create mode 100644 docs/framework/vue/reference/type-aliases/MutationKey.md create mode 100644 docs/framework/vue/reference/type-aliases/MutationMeta.md create mode 100644 docs/framework/vue/reference/type-aliases/MutationObserverResult.md create mode 100644 docs/framework/vue/reference/type-aliases/MutationScope.md create mode 100644 docs/framework/vue/reference/type-aliases/MutationStatus.md create mode 100644 docs/framework/vue/reference/type-aliases/NetworkMode.md create mode 100644 docs/framework/vue/reference/type-aliases/NonUndefinedGuard.md create mode 100644 docs/framework/vue/reference/type-aliases/NotifyEventType.md create mode 100644 docs/framework/vue/reference/type-aliases/NotifyOnChangeProps.md create mode 100644 docs/framework/vue/reference/type-aliases/OmitKeyof.md create mode 100644 docs/framework/vue/reference/type-aliases/Override.md create mode 100644 docs/framework/vue/reference/type-aliases/PlaceholderDataFunction.md create mode 100644 docs/framework/vue/reference/type-aliases/QueriesPlaceholderDataFunction.md create mode 100644 docs/framework/vue/reference/type-aliases/QueryBooleanOption.md create mode 100644 docs/framework/vue/reference/type-aliases/QueryCacheNotifyEvent.md create mode 100644 docs/framework/vue/reference/type-aliases/QueryFunction.md create mode 100644 docs/framework/vue/reference/type-aliases/QueryFunctionContext.md create mode 100644 docs/framework/vue/reference/type-aliases/QueryKey.md create mode 100644 docs/framework/vue/reference/type-aliases/QueryKeyHashFunction.md create mode 100644 docs/framework/vue/reference/type-aliases/QueryKeyWithDataTag.md create mode 100644 docs/framework/vue/reference/type-aliases/QueryMeta.md create mode 100644 docs/framework/vue/reference/type-aliases/QueryObserverResult.md create mode 100644 docs/framework/vue/reference/type-aliases/QueryPersister.md create mode 100644 docs/framework/vue/reference/type-aliases/QueryStatus.md create mode 100644 docs/framework/vue/reference/type-aliases/SkipToken.md create mode 100644 docs/framework/vue/reference/type-aliases/StaleTime.md create mode 100644 docs/framework/vue/reference/type-aliases/StaleTimeFunction.md create mode 100644 docs/framework/vue/reference/type-aliases/ThrowOnError.md create mode 100644 docs/framework/vue/reference/type-aliases/TimeoutCallback.md create mode 100644 docs/framework/vue/reference/type-aliases/TimeoutProvider.md create mode 100644 docs/framework/vue/reference/type-aliases/UnsetMarker.md create mode 100644 docs/framework/vue/reference/type-aliases/Updater.md create mode 100644 docs/framework/vue/reference/type-aliases/WithRequired.md create mode 100644 docs/framework/vue/reference/type-aliases/dataTagErrorSymbol.md create mode 100644 docs/framework/vue/reference/type-aliases/dataTagSymbol.md create mode 100644 docs/framework/vue/reference/variables/dataTagErrorSymbol.md create mode 100644 docs/framework/vue/reference/variables/dataTagSymbol.md create mode 100644 docs/framework/vue/reference/variables/defaultScheduler.md create mode 100644 docs/framework/vue/reference/variables/environmentManager.md create mode 100644 docs/framework/vue/reference/variables/focusManager.md create mode 100644 docs/framework/vue/reference/variables/isServer.md create mode 100644 docs/framework/vue/reference/variables/notifyManager.md create mode 100644 docs/framework/vue/reference/variables/onlineManager.md create mode 100644 docs/framework/vue/reference/variables/skipToken.md create mode 100644 docs/framework/vue/reference/variables/timeoutManager.md create mode 100644 docs/framework/vue/reference/variables/unsetMarker.md diff --git a/docs/framework/angular/reference/classes/CancelledError.md b/docs/framework/angular/reference/classes/CancelledError.md new file mode 100644 index 00000000000..61d35ba7178 --- /dev/null +++ b/docs/framework/angular/reference/classes/CancelledError.md @@ -0,0 +1,273 @@ +--- +id: CancelledError +title: CancelledError +--- + +Defined in: packages/query-core/dist-ts/src/retryer.d.ts:47 + +The error thrown by a `Retryer` (and surfaced to `query.promise`/`mutation`) when a fetch is cancelled, e.g. via +`query.cancel()`. `revert`, if `true`, tells the caller to restore the state the query was in before the fetch +started instead of surfacing the error. `silent`, if `true`, tells the caller to suppress this error and instead +resolve with the promise of the fetch that triggered the cancellation. + +## Example + +```ts +query.cancel() + +try { + await query.promise +} catch (error) { + if (error instanceof CancelledError) { + // the fetch was cancelled, e.g. via `query.cancel()` + } +} +``` + +## Extends + +- `Error` + +## Constructors + +### Constructor + +```ts +new CancelledError(options?): CancelledError; +``` + +Defined in: packages/query-core/dist-ts/src/retryer.d.ts:50 + +#### Parameters + +##### options? + +[`CancelOptions`](../interfaces/CancelOptions.md) + +#### Returns + +`CancelledError` + +#### Overrides + +```ts +Error.constructor +``` + +## Properties + +### cause? + +```ts +optional cause: unknown; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24 + +#### Inherited from + +```ts +Error.cause +``` + +*** + +### message + +```ts +message: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 + +#### Inherited from + +```ts +Error.message +``` + +*** + +### name + +```ts +name: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 + +#### Inherited from + +```ts +Error.name +``` + +*** + +### revert? + +```ts +optional revert: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/retryer.d.ts:48 + +*** + +### silent? + +```ts +optional silent: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/retryer.d.ts:49 + +*** + +### stack? + +```ts +optional stack: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 + +#### Inherited from + +```ts +Error.stack +``` + +*** + +### stackTraceLimit + +```ts +static stackTraceLimit: number; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:68 + +The `Error.stackTraceLimit` property specifies the number of stack frames +collected by a stack trace (whether generated by `new Error().stack` or +`Error.captureStackTrace(obj)`). + +The default value is `10` but may be set to any valid JavaScript number. Changes +will affect any stack trace captured _after_ the value has been changed. + +If set to a non-number value, or set to a negative number, stack traces will +not capture any frames. + +#### Inherited from + +```ts +Error.stackTraceLimit +``` + +## Methods + +### captureStackTrace() + +```ts +static captureStackTrace(targetObject, constructorOpt?): void; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:52 + +Creates a `.stack` property on `targetObject`, which when accessed returns +a string representing the location in the code at which +`Error.captureStackTrace()` was called. + +```js +const myObject = {}; +Error.captureStackTrace(myObject); +myObject.stack; // Similar to `new Error().stack` +``` + +The first line of the trace will be prefixed with +`${myObject.name}: ${myObject.message}`. + +The optional `constructorOpt` argument accepts a function. If given, all frames +above `constructorOpt`, including `constructorOpt`, will be omitted from the +generated stack trace. + +The `constructorOpt` argument is useful for hiding implementation +details of error generation from the user. For instance: + +```js +function a() { + b(); +} + +function b() { + c(); +} + +function c() { + // Create an error without stack trace to avoid calculating the stack trace twice. + const { stackTraceLimit } = Error; + Error.stackTraceLimit = 0; + const error = new Error(); + Error.stackTraceLimit = stackTraceLimit; + + // Capture the stack trace above function b + Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace + throw error; +} + +a(); +``` + +#### Parameters + +##### targetObject + +`object` + +##### constructorOpt? + +`Function` + +#### Returns + +`void` + +#### Inherited from + +```ts +Error.captureStackTrace +``` + +*** + +### prepareStackTrace() + +```ts +static prepareStackTrace(err, stackTraces): any; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:56 + +#### Parameters + +##### err + +`Error` + +##### stackTraces + +`CallSite`[] + +#### Returns + +`any` + +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +```ts +Error.prepareStackTrace +``` diff --git a/docs/framework/angular/reference/classes/InfiniteQueryObserver.md b/docs/framework/angular/reference/classes/InfiniteQueryObserver.md new file mode 100644 index 00000000000..df9ac3bc2e0 --- /dev/null +++ b/docs/framework/angular/reference/classes/InfiniteQueryObserver.md @@ -0,0 +1,665 @@ +--- +id: InfiniteQueryObserver +title: InfiniteQueryObserver +--- + +Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:26 + +An `InfiniteQueryObserver` extends `QueryObserver` to observe and switch +between infinite queries. It augments the base `QueryObserverResult` with +infinite-query-specific fields and methods, such as `hasNextPage` and +`fetchNextPage`, and is the primitive that framework adapters (e.g. +`useInfiniteQuery`) build their hooks on top of. + +## Example + +```ts +const observer = new InfiniteQueryObserver(queryClient, { + queryKey: ['projects'], + queryFn: ({ pageParam }) => fetchProjects(pageParam), + initialPageParam: 0, + getNextPageParam: (lastPage) => lastPage.nextCursor, +}) + +const unsubscribe = observer.subscribe((result) => console.log(result)) +``` + +## Extends + +- [`QueryObserver`](QueryObserver.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Constructors + +### Constructor + +```ts +new InfiniteQueryObserver(client, options): InfiniteQueryObserver; +``` + +Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:30 + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`InfiniteQueryObserver`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`constructor`](QueryObserver.md#constructor) + +## Properties + +### fetch + +```ts +protected fetch: ReplaceReturnType<(fetchOptions) => Promise>, Promise>>; +``` + +Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:29 + +#### Overrides + +```ts +QueryObserver.fetch +``` + +*** + +### getCurrentResult + +```ts +getCurrentResult: ReplaceReturnType<() => QueryObserverResult, InfiniteQueryObserverResult>; +``` + +Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:28 + +Returns the most recently computed `QueryObserverResult` for the +observed query. This is a point-in-time read; to be notified of updates +as they happen, subscribe to the observer instead (its inherited +`subscribe` method). + +#### Example + +```ts +const result = observer.getCurrentResult() +console.log(result.status, result.data) +``` + +#### Overrides + +```ts +QueryObserver.getCurrentResult +``` + +*** + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`listeners`](QueryObserver.md#listeners) + +*** + +### options + +```ts +options: QueryObserverOptions, TQueryKey>; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:31 + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`options`](QueryObserver.md#options) + +*** + +### subscribe() + +```ts +subscribe: (listener) => () => void; +``` + +Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:27 + +#### Parameters + +##### listener + +`InfiniteQueryObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Overrides + +```ts +QueryObserver.subscribe +``` + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:31 + +#### Returns + +`void` + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`bindMethods`](QueryObserver.md#bindmethods) + +*** + +### createResult() + +```ts +protected createResult(query, options): InfiniteQueryObserverResult; +``` + +Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:84 + +#### Parameters + +##### query + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`createResult`](QueryObserver.md#createresult) + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:53 + +Stops observing the current query: clears all listeners, cancels the +stale and refetch-interval timers, and removes this observer from the +query it was observing. + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`destroy`](QueryObserver.md#destroy) + +*** + +### fetchNextPage() + +```ts +fetchNextPage(options?): Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:64 + +Fetches the next page of the infinite query and returns a promise that +resolves with the resulting `InfiniteQueryObserverResult`. The page +param used for the fetch is determined by `getNextPageParam`, which +receives the current pages/page params and whose result also determines +`hasNextPage`. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](../interfaces/FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const { hasNextPage } = observer.getCurrentResult() + +if (hasNextPage) { + await observer.fetchNextPage() +} +``` + +#### See + +[InfiniteQueryObserver#fetchPreviousPage](#fetchpreviouspage) + +*** + +### fetchOptimistic() + +```ts +fetchOptimistic(options): Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:134 + +Fetches a query defined by the given options without affecting this +observer's own tracked query or result, and returns a promise that +resolves with the `QueryObserverResult` for that fetch. This is useful +for prefetching data that another observer (e.g. a query about to be +navigated to) will need, ahead of time. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.fetchOptimistic({ + queryKey: ['posts', 2], + queryFn: () => fetchPost(2), +}) +console.log(result.data) +``` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`fetchOptimistic`](QueryObserver.md#fetchoptimistic) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage(options?): Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:83 + +Fetches the previous page of the infinite query and returns a promise +that resolves with the resulting `InfiniteQueryObserverResult`. The page +param used for the fetch is determined by `getPreviousPageParam`, which +receives the current pages/page params and whose result also determines +`hasPreviousPage`. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](../interfaces/FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const { hasPreviousPage } = observer.getCurrentResult() + +if (hasPreviousPage) { + await observer.fetchPreviousPage() +} +``` + +#### See + +[InfiniteQueryObserver#fetchNextPage](#fetchnextpage) + +*** + +### getCurrentQuery() + +```ts +getCurrentQuery(): Query, TQueryKey>; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:106 + +Returns the `Query` instance this observer is currently observing. + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`getCurrentQuery`](QueryObserver.md#getcurrentquery) + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(options): InfiniteQueryObserverResult; +``` + +Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:45 + +The infinite-query counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult), marking the +options as an infinite query before delegating to it. Called by framework adapters (e.g. +`useInfiniteQuery`) ahead of subscribing, to compute the current `InfiniteQueryObserverResult` +synchronously. + +#### Parameters + +##### options + +[`DefaultedInfiniteQueryObserverOptions`](../type-aliases/DefaultedInfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`getOptimisticResult`](QueryObserver.md#getoptimisticresult) + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`hasListeners`](QueryObserver.md#haslisteners) + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:34 + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`onSubscribe`](QueryObserver.md#onsubscribe) + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:35 + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`onUnsubscribe`](QueryObserver.md#onunsubscribe) + +*** + +### refetch() + +```ts +refetch(__namedParameters?): Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:117 + +Refetches the observed query and returns a promise that resolves with +the resulting `QueryObserverResult`. + +#### Parameters + +##### \_\_namedParameters? + +[`RefetchOptions`](../interfaces/RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.refetch({ cancelRefetch: false }) +console.log(result.data) +``` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`refetch`](QueryObserver.md#refetch) + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:38 + +Updates the observer's options. Behaves the same as +`QueryObserver.setOptions`, additionally marking the options as +belonging to an infinite query before delegating to the base +implementation. + +#### Parameters + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`void` + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`setOptions`](QueryObserver.md#setoptions) + +*** + +### shouldFetchOnReconnect() + +```ts +shouldFetchOnReconnect(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:41 + +Returns whether the observed query is currently stale and configured +(via the `refetchOnReconnect` option) to refetch when the network +reconnects. + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`shouldFetchOnReconnect`](QueryObserver.md#shouldfetchonreconnect) + +*** + +### shouldFetchOnWindowFocus() + +```ts +shouldFetchOnWindowFocus(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:47 + +Returns whether the observed query is currently stale and configured +(via the `refetchOnWindowFocus` option) to refetch when the window +regains focus. + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`shouldFetchOnWindowFocus`](QueryObserver.md#shouldfetchonwindowfocus) + +*** + +### trackProp() + +```ts +trackProp(key): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:102 + +Records that the given `QueryObserverResult` property was read, so a subsequent update only +notifies this observer if a tracked property actually changed. Normally called indirectly via +[QueryObserver#trackResult](QueryObserver.md#trackresult)'s proxy; exposed directly for adapters that track property +access themselves (e.g. through their own reactivity system) instead of via the proxy. + +#### Parameters + +##### key + +`"status"` | `"error"` | `"isSuccess"` | `"isError"` | `"isPending"` | `"data"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isPlaceholderData"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`trackProp`](QueryObserver.md#trackprop) + +*** + +### trackResult() + +```ts +trackResult(result, onPropTracked?): QueryObserverResult; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:95 + +Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via +[QueryObserver#trackProp](QueryObserver.md#trackprop) (and an optional `onPropTracked` callback). Used by framework +adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on +properties you actually read" behavior. + +#### Parameters + +##### result + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +##### onPropTracked? + +(`key`) => `void` + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`trackResult`](QueryObserver.md#trackresult) + +*** + +### updateResult() + +```ts +updateResult(): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:142 + +Recomputes and stores the current result from the current query/options, notifying listeners +if it changed. Framework adapters call this right after subscribing to make sure no query +update was missed in the gap between creating the observer and subscribing to it. + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`updateResult`](QueryObserver.md#updateresult) diff --git a/docs/framework/angular/reference/classes/Mutation.md b/docs/framework/angular/reference/classes/Mutation.md new file mode 100644 index 00000000000..dbbb75da0a8 --- /dev/null +++ b/docs/framework/angular/reference/classes/Mutation.md @@ -0,0 +1,329 @@ +--- +id: Mutation +title: Mutation +--- + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:101 + +Represents a single mutation attempt. A `Mutation` holds the mutation's +options, state (data/error/status), and the `MutationObserver`s currently +subscribed to it. + +Instances are created and managed internally by `MutationCache`; application +code typically interacts with mutations indirectly through `QueryClient` or +a framework hook like `useMutation`. Direct access to a `Mutation` instance +is possible via `mutationCache.find()`/`getAll()` for inspecting cache state. + +## Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +``` + +## Extends + +- `Removable` + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Constructors + +### Constructor + +```ts +new Mutation(config): Mutation; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:106 + +#### Parameters + +##### config + +`MutationConfig`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`Mutation`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Overrides + +```ts +Removable.constructor +``` + +## Properties + +### gcTime + +```ts +gcTime: number; +``` + +Defined in: packages/query-core/dist-ts/src/removable.d.ts:3 + +#### Inherited from + +```ts +Removable.gcTime +``` + +*** + +### mutationId + +```ts +readonly mutationId: number; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:105 + +*** + +### options + +```ts +options: MutationOptions; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:104 + +*** + +### state + +```ts +state: MutationState; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:103 + +## Accessors + +### meta + +#### Get Signature + +```ts +get meta(): Record | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:112 + +The `meta` object passed in the mutation's options, if any. + +##### Returns + +`Record`\<`string`, `unknown`\> \| `undefined` + +## Methods + +### clearGcTimeout() + +```ts +protected clearGcTimeout(): void; +``` + +Defined in: packages/query-core/dist-ts/src/removable.d.ts:7 + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.clearGcTimeout +``` + +*** + +### continue() + +```ts +continue(): Promise; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:139 + +Resumes a mutation that is currently paused or was restored from a +dehydrated, still-`pending` state. + +- If this mutation has an active retryer (it paused mid-attempt, e.g. due + to the network mode or scope-based queuing), its retryer is resumed. +- Otherwise, if the mutation's status is still `pending` (e.g. it was + dehydrated while an attempt was in flight and never got a retryer in + this instance), `execute` is called again with the last known variables. +- Otherwise the mutation has already settled and this resolves immediately + without running anything again. + +#### Returns + +`Promise`\<`unknown`\> + +#### Example + +```ts +// typically driven by reconnect handling, e.g. queryClient.resumePausedMutations() +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +await mutation?.continue() +``` + +#### See + +[Mutation#execute](#execute) + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: packages/query-core/dist-ts/src/removable.d.ts:4 + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.destroy +``` + +*** + +### execute() + +```ts +execute(variables): Promise; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:169 + +Runs the mutation function for the given variables through a retryer, and +drives the mutation's state and lifecycle callbacks through to settlement. + +If this mutation's state is already `pending` when `execute` is called +(i.e. it was restored, still in-flight, from a dehydrated state), the +`onMutate` step is skipped and a `continue` action is dispatched to +unpause it; otherwise a `pending` action is dispatched first, then the +mutation cache's `onMutate` and the mutation's own `onMutate` option are +awaited in that order, and the resulting context is stored. + +The mutation function is then run (subject to `retry`/`retryDelay`/ +`networkMode`, and to the mutation cache's scope-based serialization). +On success, the cache's `onSuccess`/`onSettled` callbacks run before the +mutation's own `onSuccess`/`onSettled` options, a `success` action is +dispatched, and the resolved data is returned. On failure, the same +cache-then-option ordering is used for `onError`/`onSettled`, but each of +those four callbacks is individually caught so that a throwing callback +cannot mask the original error; an `error` action is then dispatched and +the original error is re-thrown. + +#### Parameters + +##### variables + +`TVariables` + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +// typically invoked by MutationObserver.mutate, not called directly +const data = await mutation.execute(variables) +``` + +#### See + +[Mutation#continue](#continue) + +*** + +### optionalRemove() + +```ts +protected optionalRemove(): void; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:117 + +#### Returns + +`void` + +#### Overrides + +```ts +Removable.optionalRemove +``` + +*** + +### scheduleGc() + +```ts +protected scheduleGc(): void; +``` + +Defined in: packages/query-core/dist-ts/src/removable.d.ts:5 + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.scheduleGc +``` + +*** + +### updateGcTime() + +```ts +protected updateGcTime(newGcTime): void; +``` + +Defined in: packages/query-core/dist-ts/src/removable.d.ts:6 + +#### Parameters + +##### newGcTime + +`number` | `undefined` + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.updateGcTime +``` diff --git a/docs/framework/angular/reference/classes/MutationCache.md b/docs/framework/angular/reference/classes/MutationCache.md new file mode 100644 index 00000000000..4b2494f5281 --- /dev/null +++ b/docs/framework/angular/reference/classes/MutationCache.md @@ -0,0 +1,308 @@ +--- +id: MutationCache +title: MutationCache +--- + +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:68 + +The `MutationCache` is the storage for mutations. + +Normally, you will not interact with the `MutationCache` directly and instead use a +`QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of +safe/known updates to the cache, such as mutations being added, removed, or updated. + +## Extends + +- `Subscribable`\<`MutationCacheListener`\> + +## Constructors + +### Constructor + +```ts +new MutationCache(config?): MutationCache; +``` + +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:71 + +#### Parameters + +##### config? + +[`MutationCacheConfig`](../interfaces/MutationCacheConfig.md) + +#### Returns + +`MutationCache` + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### config + +```ts +config: MutationCacheConfig; +``` + +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:70 + +*** + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### clear() + +```ts +clear(): void; +``` + +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:92 + +Removes all mutations from the cache. + +#### Returns + +`void` + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +mutationCache.clear() +``` + +*** + +### find() + +```ts +find(filters): + | Mutation + | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:122 + +A slightly more advanced method that can be used to get an existing mutation instance from +the cache. If the mutation does not exist, `undefined` is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about a mutation in rare scenarios. + +#### Type Parameters + +##### TData + +`TData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TVariables + +`TVariables` = `any` + +##### TOnMutateResult + +`TOnMutateResult` = `unknown` + +#### Parameters + +##### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) + +#### Returns + + \| [`Mutation`](Mutation.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + \| `undefined` + +#### See + +[MutationCache#findAll](#findall) + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +``` + +*** + +### findAll() + +```ts +findAll(filters?): Mutation[]; +``` + +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:138 + +An even more advanced method that can be used to get existing mutation instances from the +cache that match the given filters. If no mutations match, an empty array is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about mutations in rare scenarios. + +#### Parameters + +##### filters? + +[`MutationFilters`](../interfaces/MutationFilters.md)\<`unknown`, `Error`, `unknown`, `unknown`\> + +#### Returns + +[`Mutation`](Mutation.md)\<`unknown`, `Error`, `unknown`, `unknown`\>[] + +#### See + +[MutationCache#find](#find) + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutations = mutationCache.findAll({ mutationKey: ['addPost'] }) +``` + +*** + +### getAll() + +```ts +getAll(): Mutation[]; +``` + +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:106 + +Returns all mutations within the cache. + +This is not typically needed for most applications, but can come in handy when needing more +information about a mutation in rare scenarios. + +#### Returns + +[`Mutation`](Mutation.md)\<`unknown`, `Error`, `unknown`, `unknown`\>[] + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutations = mutationCache.getAll() +``` + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:6 + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:7 + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:4 + +#### Parameters + +##### listener + +`MutationCacheListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/angular/reference/classes/MutationObserver.md b/docs/framework/angular/reference/classes/MutationObserver.md new file mode 100644 index 00000000000..c7d705c17d7 --- /dev/null +++ b/docs/framework/angular/reference/classes/MutationObserver.md @@ -0,0 +1,333 @@ +--- +id: MutationObserver +title: MutationObserver +--- + +Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:21 + +Observes a single mutation and derives a `MutationObserverResult` from it. +A framework hook like `useMutation` creates one `MutationObserver` per hook +call, keeps it stable across re-renders, calls `setOptions` when the options +passed to the hook change, subscribes to it to re-render on updates, and +reads `getCurrentResult()` for the value to return. Calling `mutate()` +builds a new underlying `Mutation` in the `MutationCache` and executes it. + +## Example + +```ts +const observer = new MutationObserver(queryClient, { + mutationFn: (variables: { title: string }) => addPost(variables), +}) +``` + +## Extends + +- `Subscribable`\<`MutationObserverListener`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Constructors + +### Constructor + +```ts +new MutationObserver(client, options): MutationObserver; +``` + +Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:24 + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`MutationObserver`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Overrides + +```ts +Subscribable>.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 + +#### Inherited from + +```ts +Subscribable.listeners +``` + +*** + +### options + +```ts +options: MutationObserverOptions; +``` + +Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:23 + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:25 + +#### Returns + +`void` + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): MutationObserverResult; +``` + +Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:52 + +Returns the observer's current result, derived from the observed +mutation's state (or the default, `idle` state if no mutation has been +built yet, e.g. before the first `mutate()` call or after `reset()`). + +#### Returns + +[`MutationObserverResult`](../type-aliases/MutationObserverResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### mutate() + +```ts +mutate(variables, options?): Promise; +``` + +Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:88 + +Builds a new `Mutation` in the `MutationCache` using the observer's +current options, detaches this observer from any previously observed +mutation, attaches it to the new one, and executes it with the given +variables. + +The optional per-call `options` (`onSuccess`/`onError`/`onSettled`) are +invoked once the mutation settles, in addition to any callbacks defined +on the observer's own options. + +#### Parameters + +##### variables + +`TVariables` + +##### options? + +[`MutateOptions`](../interfaces/MutateOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +await observer.mutate( + { title: 'New post' }, + { onSuccess: (data) => console.log(data) }, +) +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:43 + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:44 + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### reset() + +```ts +reset(): void; +``` + +Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:69 + +Detaches the observer from the mutation it is currently observing (if +any) and resets the observed result back to its default, `idle` state. + +This does not cancel an in-flight mutation; the mutation itself keeps +running to completion and its own callbacks still fire, but this +observer stops reflecting its state and a subsequent `mutate()` call +will build a brand new mutation. + +#### Returns + +`void` + +#### Example + +```ts +observer.reset() +``` + +#### See + +[MutationObserver#mutate](#mutate) + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:42 + +Updates the observer's options. + +If the new `mutationKey` differs from the previous one (and both were +defined), the observer is reset, detaching it from the mutation it was +observing. Otherwise, if the currently observed mutation is still +`pending`, its options are updated in place as well. + +#### Parameters + +##### options + +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setOptions({ + mutationFn: (variables: { title: string }) => addPost(variables), + onSuccess: (data) => console.log(data), +}) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:4 + +#### Parameters + +##### listener + +`MutationObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/angular/reference/classes/QueriesObserver.md b/docs/framework/angular/reference/classes/QueriesObserver.md new file mode 100644 index 00000000000..cce04d387ad --- /dev/null +++ b/docs/framework/angular/reference/classes/QueriesObserver.md @@ -0,0 +1,325 @@ +--- +id: QueriesObserver +title: QueriesObserver +--- + +Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:35 + +A `QueriesObserver` watches an array of queries at once, exposing them as +a single array of `QueryObserverResult`s (or, when a `combine` option is +given, as a combined value derived from that array). It manages one +internal `QueryObserver` per query, and is the primitive that framework +adapters (e.g. `useQueries`) build their hooks on top of. + +## Example + +```ts +const observer = new QueriesObserver(queryClient, [ + { queryKey: ['post', 1], queryFn: fetchPost }, + { queryKey: ['post', 2], queryFn: fetchPost }, +]) + +const unsubscribe = observer.subscribe((result) => { + console.log(result) +}) +``` + +## Extends + +- `Subscribable`\<`QueriesObserverListener`\> + +## Type Parameters + +### TCombinedResult + +`TCombinedResult` = [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +## Constructors + +### Constructor + +```ts +new QueriesObserver( + client, + queries, +options?): QueriesObserver; +``` + +Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:37 + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`any`, `any`, `any`, `any`, `any`, `never`\>[] + +##### options? + +[`QueriesObserverOptions`](../interfaces/QueriesObserverOptions.md)\<`TCombinedResult`\> + +#### Returns + +`QueriesObserver`\<`TCombinedResult`\> + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:44 + +Stops observing all queries: clears all listeners and destroys every +underlying `QueryObserver` this observer manages. + +#### Returns + +`void` + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): QueryObserverResult[]; +``` + +Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:71 + +Returns the most recently computed array of `QueryObserverResult`s, one +per observed query, in the same order as the queries passed to the +constructor or `setQueries`. + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +#### Example + +```ts +const results = observer.getCurrentResult() +const data = results.map((result) => result.data) +``` + +*** + +### getObservers() + +```ts +getObservers(): QueryObserver[]; +``` + +Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:82 + +Returns the underlying `QueryObserver` instances this observer manages, +in the same order as the queries passed to the constructor or +`setQueries`. + +#### Returns + +[`QueryObserver`](QueryObserver.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[]\>[] + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(queries, combine): [QueryObserverResult[], (r?) => TCombinedResult, () => QueryObserverResult[]]; +``` + +Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:90 + +The `QueriesObserver` counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult) — computes +the result for the given (already-defaulted) queries right now, synchronously. Called by +framework adapters (e.g. `useQueries`) ahead of subscribing, returning a tuple of the raw +per-query results, a function to compute the combined result from them, and a function to +wrap the results for property-access tracking. + +#### Parameters + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[], `never`\>[] + +##### combine + +`CombineFn`\<`TCombinedResult`\> | `undefined` + +#### Returns + +\[[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[], (`r?`) => `TCombinedResult`, () => [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[]\] + +*** + +### getQueries() + +```ts +getQueries(): Query[]; +``` + +Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:76 + +Returns the underlying `Query` instances currently being observed, in +the same order as the queries passed to the constructor or `setQueries`. + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:38 + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:39 + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setQueries() + +```ts +setQueries(queries, options?): void; +``` + +Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:59 + +Replaces the set of queries being observed. Existing `QueryObserver`s +are reused for queries that match an already-observed query hash; +observers for queries that are no longer present are destroyed, and new +observers are created and subscribed to for newly added queries. + +#### Parameters + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[], `never`\>[] + +##### options? + +[`QueriesObserverOptions`](../interfaces/QueriesObserverOptions.md)\<`TCombinedResult`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setQueries([ + { queryKey: ['post', 1], queryFn: fetchPost }, + { queryKey: ['post', 3], queryFn: fetchPost }, +]) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:4 + +#### Parameters + +##### listener + +`QueriesObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/angular/reference/classes/Query.md b/docs/framework/angular/reference/classes/Query.md new file mode 100644 index 00000000000..2b7702bf60b --- /dev/null +++ b/docs/framework/angular/reference/classes/Query.md @@ -0,0 +1,585 @@ +--- +id: Query +title: Query +--- + +Defined in: packages/query-core/dist-ts/src/query.d.ts:154 + +Represents a single cached query. A `Query` holds the query's key, options, +state (data/error/status), and the observers currently subscribed to it. + +Instances are created and managed internally by `QueryCache`; application +code typically interacts with queries indirectly through `QueryClient` or +a framework hook like `useQuery`. Direct access to a `Query` instance is +possible via `queryCache.find()`/`findAll()` for inspecting cache state. + +## Example + +```ts +const queryCache = queryClient.getQueryCache() +const query = queryCache.find({ queryKey: ['posts'] }) + +if (query) { + console.log(query.state.dataUpdatedAt) +} +``` + +## Extends + +- `Removable` + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Constructors + +### Constructor + +```ts +new Query(config): Query; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:161 + +#### Parameters + +##### config + +`QueryConfig`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Query`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Overrides + +```ts +Removable.constructor +``` + +## Properties + +### gcTime + +```ts +gcTime: number; +``` + +Defined in: packages/query-core/dist-ts/src/removable.d.ts:3 + +#### Inherited from + +```ts +Removable.gcTime +``` + +*** + +### observers + +```ts +observers: QueryObserver[]; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:160 + +*** + +### options + +```ts +options: QueryOptions; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:158 + +*** + +### queryHash + +```ts +queryHash: string; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:157 + +*** + +### queryKey + +```ts +queryKey: TQueryKey; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:156 + +*** + +### state + +```ts +state: QueryState; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:159 + +## Accessors + +### meta + +#### Get Signature + +```ts +get meta(): Record | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:165 + +The `meta` object passed in the query's options, if any. + +##### Returns + +`Record`\<`string`, `unknown`\> \| `undefined` + +*** + +### promise + +#### Get Signature + +```ts +get promise(): Promise | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:172 + +The promise for the currently in-flight fetch, if the query is fetching. +`undefined` when the query is not fetching. + +##### Returns + +`Promise`\<`TData`\> \| `undefined` + +## Methods + +### cancel() + +```ts +cancel(options?): Promise; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:196 + +Cancels the query's currently in-flight fetch, if any. +- Returns a promise that resolves once the cancellation has settled. +- If no fetch is in progress, resolves immediately. + +#### Parameters + +##### options? + +[`CancelOptions`](../interfaces/CancelOptions.md) + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await query.cancel() +``` + +*** + +### clearGcTimeout() + +```ts +protected clearGcTimeout(): void; +``` + +Defined in: packages/query-core/dist-ts/src/removable.d.ts:7 + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.clearGcTimeout +``` + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:204 + +Clears the query's garbage collection timeout and silently cancels any +in-flight fetch. Called by `QueryCache` when the query is removed from +the cache. + +#### Returns + +`void` + +#### See + +[Query#cancel](#cancel) + +#### Overrides + +```ts +Removable.destroy +``` + +*** + +### fetch() + +```ts +fetch(options?, fetchOptions?): Promise; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:309 + +Fetches the query, i.e. runs its `queryFn` (through any configured +retryer/behavior) and updates the query's state with the result. +- If a fetch is already in flight, returns its promise instead of + starting a new one, unless `fetchOptions.cancelRefetch` is set and the + query already has data, in which case the current fetch is silently + cancelled first. +- If `options` is passed, it replaces the query's current options + before fetching. + +#### Parameters + +##### options? + +[`QueryOptions`](../interfaces/QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\> + +##### fetchOptions? + +`FetchOptions`\<`TQueryFnData`\> + +#### Returns + +`Promise`\<`TData`\> + +*** + +### getObserversCount() + +```ts +getObserversCount(): number; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:287 + +Returns the number of observers currently subscribed to this query. + +#### Returns + +`number` + +#### Example + +```ts +if (query.getObserversCount() === 0) { + // no component is currently watching this query +} +``` + +*** + +### invalidate() + +```ts +invalidate(): void; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:298 + +Marks the query as invalidated, unless it is already invalidated. This +updates `state.isInvalidated` and notifies observers, but does not by +itself trigger a refetch. + +#### Returns + +`void` + +#### Example + +```ts +query.invalidate() +``` + +*** + +### isActive() + +```ts +isActive(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:217 + +Returns `true` if the query has at least one observer for which `enabled` +does not resolve to `false`. + +#### Returns + +`boolean` + +*** + +### isDisabled() + +```ts +isDisabled(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:226 + +Returns `true` if the query is disabled, meaning it will not fetch +automatically. +- If the query has observers, it is disabled when none of them are active + (see `isActive`). +- If the query has no observers, it is disabled when its `queryFn` is + `skipToken` or it has never been fetched. + +#### Returns + +`boolean` + +*** + +### isFetched() + +```ts +isFetched(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:231 + +Returns `true` if the query has been fetched, i.e. it has resolved with +either data or an error at least once. + +#### Returns + +`boolean` + +*** + +### isStale() + +```ts +isStale(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:253 + +Returns `true` if the query is stale. +- If the query has observers, defers to whether any observer's current + result reports `isStale` (which accounts for each observer's own + `staleTime` and `enabled` state). +- If the query has no observers, it is considered stale when it has no + data or has been invalidated. + +#### Returns + +`boolean` + +#### See + +[Query#isStaleByTime](#isstalebytime) + +#### Example + +```ts +if (query.isStale()) { + // refetch or otherwise treat the cached data as outdated +} +``` + +*** + +### isStaleByTime() + +```ts +isStaleByTime(staleTime?): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:268 + +Returns `true` if the query's data is stale relative to the given +`staleTime` (defaults to `0`). +- A query with no data is always stale. +- `staleTime: 'static'` is never stale. +- An invalidated query is always stale. +- Otherwise, staleness is based on elapsed time since `dataUpdatedAt`. + +#### Parameters + +##### staleTime? + +[`StaleTime`](../type-aliases/StaleTime.md) + +#### Returns + +`boolean` + +#### See + +[Query#isStale](#isstale) + +#### Example + +```ts +const isStale = query.isStaleByTime(1000 * 60) +``` + +*** + +### isStatic() + +```ts +isStatic(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:236 + +Returns `true` if the query has at least one observer configured with +`staleTime: 'static'`, meaning it is treated as never stale. + +#### Returns + +`boolean` + +*** + +### optionalRemove() + +```ts +protected optionalRemove(): void; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:175 + +#### Returns + +`void` + +#### Overrides + +```ts +Removable.optionalRemove +``` + +*** + +### reset() + +```ts +reset(): void; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:212 + +Resets the query back to its initial state (the state it had when it was +first created, e.g. any `initialData`), destroying it first to cancel any +in-flight fetch. + +#### Returns + +`void` + +*** + +### scheduleGc() + +```ts +protected scheduleGc(): void; +``` + +Defined in: packages/query-core/dist-ts/src/removable.d.ts:5 + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.scheduleGc +``` + +*** + +### setState() + +```ts +setState(state): void; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:185 + +Merges the given partial state directly into this query's state, notifying observers. Used +by persistence and broadcast plugins to restore a state snapshot, and by devtools to let a +user manually trigger a loading/error state or edit the cached data. + +#### Parameters + +##### state + +`Partial`\<[`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\>\> + +#### Returns + +`void` + +*** + +### updateGcTime() + +```ts +protected updateGcTime(newGcTime): void; +``` + +Defined in: packages/query-core/dist-ts/src/removable.d.ts:6 + +#### Parameters + +##### newGcTime + +`number` | `undefined` + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.updateGcTime +``` diff --git a/docs/framework/angular/reference/classes/QueryCache.md b/docs/framework/angular/reference/classes/QueryCache.md new file mode 100644 index 00000000000..ab0ce089851 --- /dev/null +++ b/docs/framework/angular/reference/classes/QueryCache.md @@ -0,0 +1,461 @@ +--- +id: QueryCache +title: QueryCache +--- + +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:75 + +The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta +information, and state of the queries it contains. + +Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient` +for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of +safe/known updates to the cache, such as queries being added, removed, or updated. + +## Extends + +- `Subscribable`\<`QueryCacheListener`\> + +## Constructors + +### Constructor + +```ts +new QueryCache(config?): QueryCache; +``` + +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:78 + +#### Parameters + +##### config? + +[`QueryCacheConfig`](../interfaces/QueryCacheConfig.md) + +#### Returns + +`QueryCache` + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### config + +```ts +config: QueryCacheConfig; +``` + +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:77 + +*** + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### build() + +```ts +build( + client, + options, +state?): Query; +``` + +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:95 + +Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or +builds and adds a new one to the cache if none exists yet. Used by framework adapters and +plugins (e.g. broadcast/persistence) that need to get-or-create a `Query` directly, bypassing +the reactive `QueryObserver` machinery. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](../interfaces/QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\>, `"queryKey"`\> + +##### state? + +[`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\> + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const query = queryCache.build(queryClient, { + queryKey: ['posts'], + queryFn: fetchPosts, +}) +``` + +*** + +### clear() + +```ts +clear(): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:125 + +Removes all queries from the cache. + +#### Returns + +`void` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +queryCache.clear() +``` + +*** + +### find() + +```ts +find(filters): + | Query + | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:170 + +A slightly more advanced method that can be used to get an existing query instance from the +cache. This instance not only contains all the state for the query, but all of the instances, +and underlying guts of the query as well. If the query does not exist, `undefined` is +returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about a query in rare scenarios (e.g. looking at `query.state.dataUpdatedAt` to +decide whether a query is fresh enough to be used as an initial value). + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +#### Parameters + +##### filters + +[`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryFilters`](../interfaces/QueryFilters.md)\, `"queryKey"`\> + +#### Returns + + \| [`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, readonly `unknown`[]\> + \| `undefined` + +#### See + +[QueryCache#findAll](#findall) + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const query = queryCache.find({ queryKey: ['posts'] }) +``` + +*** + +### findAll() + +```ts +findAll(filters?): Query[]; +``` + +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:186 + +An even more advanced method that can be used to get existing query instances from the cache +that partially match a query key. If no queries match, an empty array is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about queries in rare scenarios. + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +#### See + +[QueryCache#find](#find) + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const queries = queryCache.findAll({ queryKey: ['posts'] }) +``` + +*** + +### get() + +```ts +get(queryHash): + | Query + | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:140 + +Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none +exists. Unlike [QueryCache#find](#find), this looks up by the already-computed hash rather +than by `QueryFilters`. Used by plugins (e.g. broadcast/hydration) that already have a hash +to look up directly. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### queryHash + +`string` + +#### Returns + + \| [`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + \| `undefined` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() +const queryHash = hashKey(['posts']) + +const query = queryCache.get(queryHash) +``` + +*** + +### getAll() + +```ts +getAll(): Query[]; +``` + +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:151 + +Returns all queries within the cache. + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const queries = queryCache.getAll() +``` + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:6 + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:7 + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### remove() + +```ts +remove(query): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:114 + +Destroys the given `Query` and removes it from the cache, notifying subscribers with a +`'removed'` event. A no-op if the query is no longer the one currently stored under its hash +(e.g. it was already replaced). Used by plugins (e.g. the broadcast client) that mirror +removals across `QueryCache` instances. + +#### Parameters + +##### query + +[`Query`](Query.md)\<`any`, `any`, `any`, `any`\> + +#### Returns + +`void` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() +const query = queryCache.find({ queryKey: ['posts'] }) + +if (query) { + queryCache.remove(query) +} +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:4 + +#### Parameters + +##### listener + +`QueryCacheListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/angular/reference/classes/QueryClient.md b/docs/framework/angular/reference/classes/QueryClient.md new file mode 100644 index 00000000000..bdf6e3d07f9 --- /dev/null +++ b/docs/framework/angular/reference/classes/QueryClient.md @@ -0,0 +1,1455 @@ +--- +id: QueryClient +title: QueryClient +--- + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:23 + +`QueryClient` is used to interact with a cache of queries and mutations. It owns a +`QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds +the default options that are applied to queries and mutations created through it. + +```ts +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + staleTime: Infinity, + }, + }, +}) + +await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts }) +``` + +## Constructors + +### Constructor + +```ts +new QueryClient(config?): QueryClient; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:25 + +#### Parameters + +##### config? + +[`QueryClientConfig`](../interfaces/QueryClientConfig.md) + +#### Returns + +`QueryClient` + +## Methods + +### cancelQueries() + +```ts +cancelQueries(filters?, cancelOptions?): Promise; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:173 + +Cancels outgoing fetches for queries matching the given filters. Most useful when performing +optimistic updates, since any outgoing refetch that resolves afterwards would otherwise +overwrite the optimistic update. By default (`revert: true`), a cancelled query's data is +reverted to its state before the outgoing fetch started. + +The returned promise never rejects, even if individual cancellations fail. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +##### cancelOptions? + +[`CancelOptions`](../interfaces/CancelOptions.md) + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.cancelQueries({ queryKey: ['posts'], exact: true }) +``` + +*** + +### clear() + +```ts +clear(): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:420 + +Clears both the query cache and the mutation cache this client is connected to. + +#### Returns + +`void` + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +queryClient.clear() +``` + +*** + +### defaultMutationOptions() + +```ts +defaultMutationOptions(options?): T; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:408 + +The mutation counterpart of [QueryClient#defaultQueryOptions](#defaultqueryoptions). Called by framework +adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the +given `mutationKey`, then the client's `defaultOptions.mutations`, then the caller's options +on top. A no-op if the options are already defaulted (`_defaulted: true`). + +#### Type Parameters + +##### T + +`T` *extends* [`MutationOptions`](../interfaces/MutationOptions.md)\<`any`, `any`, `any`, `any`\> + +#### Parameters + +##### options? + +`T` + +#### Returns + +`T` + +*** + +### defaultQueryOptions() + +```ts +defaultQueryOptions(options): DefaultedQueryObserverOptions; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:401 + +Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the +caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the +given `queryKey`, then the client's own `defaultOptions.queries`, then the caller's options +on top. A no-op if the options are already defaulted (`_defaulted: true`). + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\> | [`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +*** + +### ~~ensureInfiniteQueryData()~~ + +```ts +ensureInfiniteQueryData(options): Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:274 + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`EnsureInfiniteQueryDataOptions`](../type-aliases/EnsureInfiniteQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\> + +#### Deprecated + +Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version. + +*** + +### ~~ensureQueryData()~~ + +```ts +ensureQueryData(options): Promise; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:77 + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### options + +[`EnsureQueryDataOptions`](../interfaces/EnsureQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Deprecated + +Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version. + +*** + +### ~~fetchInfiniteQuery()~~ + +```ts +fetchInfiniteQuery(options): Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:266 + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\> + +#### Deprecated + +Use queryClient.infiniteQuery(options) instead. This method will be removed in the next major version. + +*** + +### ~~fetchQuery()~~ + +```ts +fetchQuery(options): Promise; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:236 + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Deprecated + +Use queryClient.query(options) instead. This method will be removed in the next major version. + +*** + +### getDefaultOptions() + +```ts +getDefaultOptions(): DefaultOptions; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:326 + +Returns the default options that were set when creating the client, or via +[QueryClient#setDefaultOptions](#setdefaultoptions). + +#### Returns + +[`DefaultOptions`](../interfaces/DefaultOptions.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const defaultOptions = queryClient.getDefaultOptions() +``` + +*** + +### getMutationCache() + +```ts +getMutationCache(): MutationCache; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:313 + +Returns the mutation cache this client is connected to. + +#### Returns + +[`MutationCache`](MutationCache.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const mutationCache = queryClient.getMutationCache() +const mutations = mutationCache.findAll({ status: 'pending' }) +``` + +*** + +### getMutationDefaults() + +```ts +getMutationDefaults(mutationKey): OmitKeyof, "mutationKey">; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:394 + +Returns the default options registered for mutations whose mutation key partially matches +the given `mutationKey`, via [QueryClient#setMutationDefaults](#setmutationdefaults). If multiple registered +defaults match, they are merged together in registration order. + +#### Parameters + +##### mutationKey + +readonly `unknown`[] + +#### Returns + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`any`, `any`, `any`, `any`\>, `"mutationKey"`\> + +#### Example + +```ts +const defaultOptions = queryClient.getMutationDefaults(['addPost']) +``` + +*** + +### getQueriesData() + +```ts +getQueriesData(filters): [readonly unknown[], TQueryFnData | undefined][]; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:89 + +Imperative (non-reactive) way to retrieve the cached data of multiple queries at once. +Only queries matching the given filters are returned; if none match, an empty array is +returned. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters + +`TQueryFilters` + +#### Returns + +\[readonly `unknown`[], `TQueryFnData` \| `undefined`\][] + +#### See + +[QueryClient#getQueryData](#getquerydata) + +#### Example + +```ts +const data = queryClient.getQueriesData({ queryKey: ['posts'] }) +``` + +*** + +### getQueryCache() + +```ts +getQueryCache(): QueryCache; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:300 + +Returns the query cache this client is connected to. + +#### Returns + +[`QueryCache`](QueryCache.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const queryCache = queryClient.getQueryCache() +const queries = queryCache.findAll({ queryKey: ['posts'] }) +``` + +*** + +### getQueryData() + +```ts +getQueryData(queryKey): TInferredQueryFnData | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:73 + +Imperative (non-reactive) way to retrieve data for a QueryKey. +Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. + +Hint: Do not use this function inside a component, because it won't receive updates. +Use `useQuery` to create a `QueryObserver` that subscribes to changes. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +#### Returns + +`TInferredQueryFnData` \| `undefined` + +#### See + +[QueryClient#getQueriesData](#getqueriesdata) + +*** + +### getQueryDefaults() + +```ts +getQueryDefaults(queryKey): OmitKeyof, "queryKey">; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:371 + +Returns the default options registered for queries whose query key partially matches the +given `queryKey`, via [QueryClient#setQueryDefaults](#setquerydefaults). If multiple registered defaults +match, they are merged together in registration order. + +#### Parameters + +##### queryKey + +readonly `unknown`[] + +#### Returns + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`any`, `any`, `any`, `any`, `any`\>, `"queryKey"`\> + +#### Example + +```ts +const defaultOptions = queryClient.getQueryDefaults(['posts']) +``` + +*** + +### getQueryState() + +```ts +getQueryState(queryKey): + | QueryState + | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:136 + +Imperative (non-reactive) way to retrieve an existing query's state. If the query does not +exist, `undefined` is returned. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +##### TInferredError + +`TInferredError` = [`InferErrorFromTag`](../type-aliases/InferErrorFromTag.md)\<`TError`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +#### Returns + + \| [`QueryState`](../interfaces/QueryState.md)\<`TInferredQueryFnData`, `TInferredError`\> + \| `undefined` + +#### Example + +```ts +const state = queryClient.getQueryState(['posts']) +console.log(state?.dataUpdatedAt) +``` + +*** + +### infiniteQuery() + +```ts +infiniteQuery(options): Promise[] ? InfiniteData : TData>; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:262 + +Asynchronous method to fetch and cache an infinite query, resolving with an +[InfiniteData](../interfaces/InfiniteData.md) object or throwing with the error. + +Behaves like [QueryClient#query](#query), accepting the same options (minus +`initialPageParam`), plus the required `initialPageParam`, and an optional `pages` / +`getNextPageParam` pair used to refetch a fixed number of pages from the start. + +This method replaces the deprecated `fetchInfiniteQuery`, and — combined with +`{ staleTime: 'static' }` — the deprecated `ensureInfiniteQueryData`. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`InfiniteQueryExecuteOptions`](../type-aliases/InfiniteQueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`[] *extends* [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>[] ? [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\> : `TData`\> + +#### Example + +```ts +try { + const data = await queryClient.infiniteQuery({ queryKey, queryFn, initialPageParam: 0 }) + console.log(data.pages) +} catch (error) { + console.log(error) +} +``` + +*** + +### invalidateQueries() + +```ts +invalidateQueries(filters?, options?): Promise; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:187 + +Marks queries matching the given filters as invalidated. Unlike +[QueryClient#removeQueries](#removequeries), invalidated queries stay in the cache. + +Unless `filters.refetchType` is `'none'`, matching queries are then refetched via +[QueryClient#refetchQueries](#refetchqueries), using `filters.refetchType` if set, otherwise +`filters.type`, otherwise `'active'`. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`InvalidateQueryFilters`](../interfaces/InvalidateQueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`InvalidateOptions`](../interfaces/InvalidateOptions.md) + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' }) +``` + +*** + +### isFetching() + +```ts +isFetching(filters?): number; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:51 + +Returns the number of queries in the cache that are currently fetching, optionally +matching a set of filters. This includes background-fetching, loading new pages, and +loading more infinite query results. + +#### Type Parameters + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters? + +`TQueryFilters` + +#### Returns + +`number` + +#### Example + +```ts +if (queryClient.isFetching()) { + console.log('At least one query is fetching!') +} +``` + +*** + +### isMutating() + +```ts +isMutating(filters?): number; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:63 + +Returns the number of mutations in the cache that are currently pending, optionally +matching a set of filters. + +#### Type Parameters + +##### TMutationFilters + +`TMutationFilters` *extends* [`MutationFilters`](../interfaces/MutationFilters.md)\<`any`, `any`, `unknown`, `unknown`\> = [`MutationFilters`](../interfaces/MutationFilters.md)\<`unknown`, `Error`, `unknown`, `unknown`\> + +#### Parameters + +##### filters? + +`TMutationFilters` + +#### Returns + +`number` + +#### Example + +```ts +if (queryClient.isMutating()) { + console.log('At least one mutation is pending!') +} +``` + +*** + +### mount() + +```ts +mount(): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:32 + +Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start +listening for focus/online events and resume paused mutations. Ref-counted via an internal +mount count, so nested or multiple providers sharing the same `QueryClient` don't tear down +the shared listeners until the last one unmounts. + +#### Returns + +`void` + +*** + +### ~~prefetchInfiniteQuery()~~ + +```ts +prefetchInfiniteQuery(options): Promise; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:270 + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`void`\> + +#### Deprecated + +Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version. + +*** + +### ~~prefetchQuery()~~ + +```ts +prefetchQuery(options): Promise; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:240 + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### options + +[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Promise`\<`void`\> + +#### Deprecated + +Use queryClient.query(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version. + +*** + +### query() + +```ts +query(options): Promise; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:232 + +Asynchronous method to fetch and cache a query, resolving with the data or throwing with +the error. + +If the query already exists in the cache and its data is not stale (per the given +`staleTime`), the cached data is returned without fetching. Otherwise, the query is fetched +and the promise resolves once the fetch settles. If a `select` function is provided, it is +applied to the data in both cases (cached or freshly fetched) before it is returned. + +Unlike `useQuery`, retries are disabled by default here (`retry: false`) unless explicitly +configured, since there is no component to catch a thrown error and retry through re-render. + +The accepted options are a subset of `useQuery`'s options: fields that only make sense for a +reactive observer (e.g. `enabled`, `refetchInterval`, `refetchOnWindowFocus`, `notifyOnChangeProps`, +`throwOnError`, `suspense`, `placeholderData`) are not part of this method's options. + +This method replaces the deprecated `fetchQuery`, and — combined with +`{ staleTime: 'static' }` — the deprecated `ensureQueryData`. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`QueryExecuteOptions`](../interfaces/QueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +try { + const data = await queryClient.query({ queryKey, queryFn, staleTime: 10000 }) +} catch (error) { + console.log(error) +} +``` + +*** + +### refetchQueries() + +```ts +refetchQueries(filters?, options?): Promise; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:203 + +Refetches queries matching the given filters, regardless of whether they are stale. Without +filters, every query in the cache is refetched. Queries that are disabled, or static (only +have observers with a static `staleTime`), are never refetched. + +By default (`cancelRefetch: true`), a currently running fetch is cancelled before the new +one starts. The returned promise resolves once all matching queries have settled; it does +not reject on individual query failures unless `throwOnError` is set. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`RefetchQueryFilters`](../interfaces/RefetchQueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`RefetchOptions`](../interfaces/RefetchOptions.md) + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +// refetch all active queries partially matching a query key: +await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' }) +``` + +*** + +### removeQueries() + +```ts +removeQueries(filters?): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:148 + +Removes queries from the cache that match the given filters. Unlike +[QueryClient#invalidateQueries](#invalidatequeries) or [QueryClient#refetchQueries](#refetchqueries), this removes +matching queries from the cache instead of refetching them. Without filters, every query in +the cache is removed. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +#### Returns + +`void` + +#### Example + +```ts +queryClient.removeQueries({ queryKey: ['posts'], exact: true }) +``` + +*** + +### resetQueries() + +```ts +resetQueries(filters?, options?): Promise; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:159 + +Resets queries matching the given filters back to their initial state (e.g. any +`initialData`), notifying subscribers rather than removing them. Active queries among the +matched set are then refetched, and the returned promise resolves once that refetch settles. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`ResetOptions`](../interfaces/ResetOptions.md) + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.resetQueries({ queryKey: ['posts'], exact: true }) +``` + +*** + +### resumePausedMutations() + +```ts +resumePausedMutations(): Promise; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:287 + +Resumes mutations that were paused because there was no network connection. Does nothing +(resolving immediately) if the client is currently offline. + +#### Returns + +`Promise`\<`unknown`\> + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +await queryClient.resumePausedMutations() +``` + +*** + +### setDefaultOptions() + +```ts +setDefaultOptions(options): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:344 + +Dynamically sets the default options for this client, overwriting any previously defined +default options. + +#### Parameters + +##### options + +[`DefaultOptions`](../interfaces/DefaultOptions.md) + +#### Returns + +`void` + +#### See + +[QueryClient#getDefaultOptions](#getdefaultoptions) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +queryClient.setDefaultOptions({ + queries: { + staleTime: Infinity, + }, +}) +``` + +*** + +### setMutationDefaults() + +```ts +setMutationDefaults(mutationKey, options): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:383 + +Sets default options for mutations whose mutation key partially matches the given +`mutationKey`. As with [QueryClient#setQueryDefaults](#setquerydefaults), the order of registration +matters when several registered defaults match the same mutation key. + +#### Type Parameters + +##### TData + +`TData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TVariables + +`TVariables` = `void` + +##### TOnMutateResult + +`TOnMutateResult` = `unknown` + +#### Parameters + +##### mutationKey + +readonly `unknown`[] + +##### options + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> + +#### Returns + +`void` + +#### See + +[QueryClient#getMutationDefaults](#getmutationdefaults) + +#### Example + +```ts +queryClient.setMutationDefaults(['addPost'], { mutationFn: addPost }) +``` + +*** + +### setQueriesData() + +```ts +setQueriesData( + filters, + updater, + options?): [readonly unknown[], TQueryFnData | undefined][]; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:125 + +Synchronous way to immediately update the cached data of multiple queries at once, using +filters or partial query key matching. Only queries that already exist and match the given +filters are updated; no new cache entries are created. Internally this calls +[QueryClient#setQueryData](#setquerydata) for each matching query. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters + +`TQueryFilters` + +##### updater + +[`Updater`](../type-aliases/Updater.md)\<`NoInfer`\<`TQueryFnData`\> \| `undefined`, `NoInfer`\<`TQueryFnData`\> \| `undefined`\> + +##### options? + +[`SetDataOptions`](../interfaces/SetDataOptions.md) + +#### Returns + +\[readonly `unknown`[], `TQueryFnData` \| `undefined`\][] + +#### Example + +```ts +queryClient.setQueriesData({ queryKey: ['posts'] }, (oldPosts) => + oldPosts ? oldPosts.filter((post) => post.id !== deletedId) : oldPosts, +) +``` + +*** + +### setQueryData() + +```ts +setQueryData( + queryKey, + updater, + options?): NoInfer | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:111 + +Synchronous way to immediately update a query's cached data. If the updater (or the value +passed) resolves to `undefined`, the cache is left untouched and no query is created; +otherwise, if the query does not exist yet, it will be created. To update multiple queries +at once by partially matching query keys, use [QueryClient#setQueriesData](#setqueriesdata) instead. + +Updates must be performed immutably: do not mutate `oldData`, or data previously retrieved +via [QueryClient#getQueryData](#getquerydata), in place. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +The query key to set data for. + +##### updater + +[`Updater`](../type-aliases/Updater.md)\<`NoInfer`\<`TInferredQueryFnData`\> \| `undefined`, `NoInfer`\<`TInferredQueryFnData`\> \| `undefined`\> + +Either the new data, or a function that receives the current data (which +may be `undefined`) and returns the new data. + +##### options? + +[`SetDataOptions`](../interfaces/SetDataOptions.md) + +#### Returns + +`NoInfer`\<`TInferredQueryFnData`\> \| `undefined` + +#### Example + +```ts +queryClient.setQueryData(['posts'], newPosts) + +// Or, using an updater function that receives the current data: +queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost]) +``` + +*** + +### setQueryDefaults() + +```ts +setQueryDefaults(queryKey, options): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:360 + +Sets default options for queries whose query key partially matches the given `queryKey`. + +If several registered query defaults match a given query key, they are merged together in +registration order by [QueryClient#getQueryDefaults](#getquerydefaults), so register defaults from the +most generic key to the least generic one — more specific defaults should be registered +after more generic ones so they take precedence. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +#### Parameters + +##### queryKey + +readonly `unknown`[] + +##### options + +`Partial`\<[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`\>, `"queryKey"`\>\> + +#### Returns + +`void` + +#### Example + +```ts +queryClient.setQueryDefaults(['posts'], { queryFn: fetchPosts }) + +await queryClient.query({ queryKey: ['posts'] }) +``` + +*** + +### unmount() + +```ts +unmount(): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:38 + +The inverse of [QueryClient#mount](#mount) — called by a framework adapter's +`QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online +listeners once the mount count returns to `0`. + +#### Returns + +`void` diff --git a/docs/framework/angular/reference/classes/QueryObserver.md b/docs/framework/angular/reference/classes/QueryObserver.md new file mode 100644 index 00000000000..470cf95ced7 --- /dev/null +++ b/docs/framework/angular/reference/classes/QueryObserver.md @@ -0,0 +1,555 @@ +--- +id: QueryObserver +title: QueryObserver +--- + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:29 + +A `QueryObserver` watches a single query in the `QueryCache` and computes a +`QueryObserverResult` from its state, recomputing and notifying subscribers +whenever the underlying query (or the observer's options) changes. It is +the primitive that framework adapters (e.g. `useQuery`) build their hooks +on top of, but it can also be used directly to observe and switch between +queries outside of any framework. + +## Example + +```ts +const observer = new QueryObserver(queryClient, { + queryKey: ['posts'], + queryFn: fetchPosts, +}) + +const unsubscribe = observer.subscribe((result) => { + console.log(result.data) +}) +``` + +## Extends + +- `Subscribable`\<`QueryObserverListener`\<`TData`, `TError`\>\> + +## Extended by + +- [`InfiniteQueryObserver`](InfiniteQueryObserver.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Constructors + +### Constructor + +```ts +new QueryObserver(client, options): QueryObserver; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:32 + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`QueryObserver`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Overrides + +```ts +Subscribable>.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 + +#### Inherited from + +```ts +Subscribable.listeners +``` + +*** + +### options + +```ts +options: QueryObserverOptions; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:31 + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:33 + +#### Returns + +`void` + +*** + +### createResult() + +```ts +protected createResult(query, options): QueryObserverResult; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:136 + +#### Parameters + +##### query + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:53 + +Stops observing the current query: clears all listeners, cancels the +stale and refetch-interval timers, and removes this observer from the +query it was observing. + +#### Returns + +`void` + +*** + +### fetch() + +```ts +protected fetch(fetchOptions): Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:135 + +#### Parameters + +##### fetchOptions + +`ObserverFetchOptions` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchOptimistic() + +```ts +fetchOptimistic(options): Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:134 + +Fetches a query defined by the given options without affecting this +observer's own tracked query or result, and returns a promise that +resolves with the `QueryObserverResult` for that fetch. This is useful +for prefetching data that another observer (e.g. a query about to be +navigated to) will need, ahead of time. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.fetchOptimistic({ + queryKey: ['posts', 2], + queryFn: () => fetchPost(2), +}) +console.log(result.data) +``` + +*** + +### getCurrentQuery() + +```ts +getCurrentQuery(): Query; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:106 + +Returns the `Query` instance this observer is currently observing. + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): QueryObserverResult; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:88 + +Returns the most recently computed `QueryObserverResult` for the +observed query. This is a point-in-time read; to be notified of updates +as they happen, subscribe to the observer instead (its inherited +`subscribe` method). + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +#### Example + +```ts +const result = observer.getCurrentResult() +console.log(result.status, result.data) +``` + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(options): QueryObserverResult; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:75 + +Computes the result the observer would produce for the given (already-defaulted) options +right now, building the underlying `Query` if it doesn't exist yet, without waiting for a +subscription callback. Called by framework adapters on every render (e.g. `useQuery`) so the +returned value is available synchronously, ahead of `setOptions` triggering an actual fetch. + +#### Parameters + +##### options + +[`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:34 + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:35 + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### refetch() + +```ts +refetch(__namedParameters?): Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:117 + +Refetches the observed query and returns a promise that resolves with +the resulting `QueryObserverResult`. + +#### Parameters + +##### \_\_namedParameters? + +[`RefetchOptions`](../interfaces/RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.refetch({ cancelRefetch: false }) +console.log(result.data) +``` + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:68 + +Updates the observer's options. This will re-resolve the query being +observed (switching to a different query if the `queryKey` changed), +trigger a fetch if the new options require one and the observer has +subscribers, recompute the current result, and reschedule the stale and +refetch-interval timers as needed. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setOptions({ queryKey: ['posts', 1], queryFn: () => fetchPost(1) }) +// later: switch to a different query, reusing the same observer +observer.setOptions({ queryKey: ['posts', 2], queryFn: () => fetchPost(2) }) +``` + +*** + +### shouldFetchOnReconnect() + +```ts +shouldFetchOnReconnect(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:41 + +Returns whether the observed query is currently stale and configured +(via the `refetchOnReconnect` option) to refetch when the network +reconnects. + +#### Returns + +`boolean` + +*** + +### shouldFetchOnWindowFocus() + +```ts +shouldFetchOnWindowFocus(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:47 + +Returns whether the observed query is currently stale and configured +(via the `refetchOnWindowFocus` option) to refetch when the window +regains focus. + +#### Returns + +`boolean` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:4 + +#### Parameters + +##### listener + +`QueryObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` + +*** + +### trackProp() + +```ts +trackProp(key): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:102 + +Records that the given `QueryObserverResult` property was read, so a subsequent update only +notifies this observer if a tracked property actually changed. Normally called indirectly via +[QueryObserver#trackResult](#trackresult)'s proxy; exposed directly for adapters that track property +access themselves (e.g. through their own reactivity system) instead of via the proxy. + +#### Parameters + +##### key + +`"status"` | `"error"` | `"isSuccess"` | `"isError"` | `"isPending"` | `"data"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isPlaceholderData"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` + +#### Returns + +`void` + +*** + +### trackResult() + +```ts +trackResult(result, onPropTracked?): QueryObserverResult; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:95 + +Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via +[QueryObserver#trackProp](#trackprop) (and an optional `onPropTracked` callback). Used by framework +adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on +properties you actually read" behavior. + +#### Parameters + +##### result + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +##### onPropTracked? + +(`key`) => `void` + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### updateResult() + +```ts +updateResult(): void; +``` + +Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:142 + +Recomputes and stores the current result from the current query/options, notifying listeners +if it changed. Framework adapters call this right after subscribing to make sure no query +update was missed in the gap between creating the observer and subscribing to it. + +#### Returns + +`void` diff --git a/docs/framework/angular/reference/functions/defaultShouldDehydrateMutation.md b/docs/framework/angular/reference/functions/defaultShouldDehydrateMutation.md new file mode 100644 index 00000000000..2c6c020a881 --- /dev/null +++ b/docs/framework/angular/reference/functions/defaultShouldDehydrateMutation.md @@ -0,0 +1,23 @@ +--- +id: defaultShouldDehydrateMutation +title: defaultShouldDehydrateMutation +--- + +```ts +function defaultShouldDehydrateMutation(mutation): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/hydration.d.ts:77 + +The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are +currently paused (e.g. paused by `networkMode` while offline). + +## Parameters + +### mutation + +[`Mutation`](../classes/Mutation.md) + +## Returns + +`boolean` diff --git a/docs/framework/angular/reference/functions/defaultShouldDehydrateQuery.md b/docs/framework/angular/reference/functions/defaultShouldDehydrateQuery.md new file mode 100644 index 00000000000..5619987053f --- /dev/null +++ b/docs/framework/angular/reference/functions/defaultShouldDehydrateQuery.md @@ -0,0 +1,23 @@ +--- +id: defaultShouldDehydrateQuery +title: defaultShouldDehydrateQuery +--- + +```ts +function defaultShouldDehydrateQuery(query): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/hydration.d.ts:82 + +The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is +`'success'`. + +## Parameters + +### query + +[`Query`](../classes/Query.md) + +## Returns + +`boolean` diff --git a/docs/framework/angular/reference/functions/dehydrate.md b/docs/framework/angular/reference/functions/dehydrate.md new file mode 100644 index 00000000000..254a61d6c5e --- /dev/null +++ b/docs/framework/angular/reference/functions/dehydrate.md @@ -0,0 +1,43 @@ +--- +id: dehydrate +title: dehydrate +--- + +```ts +function dehydrate(client, options?): DehydratedState; +``` + +Defined in: packages/query-core/dist-ts/src/hydration.d.ts:101 + +Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`, +typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`. +Which queries/mutations are included, and how their data/errors are transformed, is controlled by `options`, +falling back to the client's `dehydrate` default options, and finally to `defaultShouldDehydrateQuery` / +`defaultShouldDehydrateMutation`. + +## Parameters + +### client + +[`QueryClient`](../classes/QueryClient.md) + +### options? + +[`DehydrateOptions`](../interfaces/DehydrateOptions.md) + +## Returns + +[`DehydratedState`](../interfaces/DehydratedState.md) + +## Example + +```ts +const queryClient = new QueryClient() + +await queryClient.prefetchQuery({ + queryKey: ['posts'], + queryFn: getPosts, +}) + +const dehydratedState = dehydrate(queryClient) +``` diff --git a/docs/framework/angular/reference/functions/dehydrateQuery.md b/docs/framework/angular/reference/functions/dehydrateQuery.md new file mode 100644 index 00000000000..07810f1cbe0 --- /dev/null +++ b/docs/framework/angular/reference/functions/dehydrateQuery.md @@ -0,0 +1,43 @@ +--- +id: dehydrateQuery +title: dehydrateQuery +--- + +```ts +function dehydrateQuery( + query, + serializeData?, + shouldRedactErrors?): DehydratedQuery; +``` + +Defined in: packages/query-core/dist-ts/src/hydration.d.ts:72 + +Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g. +`queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the +de/rehydrated data, typically with `useQuery` on the client. If the query is still `pending`, its in-flight +promise is dehydrated too so it can be resumed on the other side instead of re-fetched. + +## Parameters + +### query + +[`Query`](../classes/Query.md) + +The query to dehydrate. + +### serializeData? + +`TransformerFn` + +Optional transform applied to `query.state.data` before it is included in the snapshot. + +### shouldRedactErrors? + +(`error`) => `boolean` + +Optional predicate; if it returns `false` for the promise's rejection error, that +error is kept as-is instead of being redacted. + +## Returns + +`DehydratedQuery` diff --git a/docs/framework/angular/reference/functions/experimental_streamedQuery.md b/docs/framework/angular/reference/functions/experimental_streamedQuery.md new file mode 100644 index 00000000000..48e65d02788 --- /dev/null +++ b/docs/framework/angular/reference/functions/experimental_streamedQuery.md @@ -0,0 +1,52 @@ +--- +id: experimental_streamedQuery +title: experimental_streamedQuery +--- + +```ts +function experimental_streamedQuery(queryFn): QueryFunction; +``` + +Defined in: packages/query-core/dist-ts/src/streamedQuery.d.ts:38 + +This is a helper function to create a query function that streams data from an AsyncIterable. +Data will be an Array of all the chunks received. +The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. +The query will stay in fetchStatus 'fetching' until the stream ends. + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TData + +`TData` = `TQueryFnData`[] + +### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +## Parameters + +### queryFn + +`StreamedQueryParams`\<`TQueryFnData`, `TData`, `TQueryKey`\> + +The function that returns an AsyncIterable to stream data from. + +## Returns + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TData`, `TQueryKey`\> + +## Example + +```ts +await queryClient.query({ + queryKey: ['data'], + queryFn: streamedQuery({ + streamFn: fetchDataInChunks, + }), +}) +``` diff --git a/docs/framework/angular/reference/functions/hashKey.md b/docs/framework/angular/reference/functions/hashKey.md new file mode 100644 index 00000000000..fd9aaa2a57f --- /dev/null +++ b/docs/framework/angular/reference/functions/hashKey.md @@ -0,0 +1,30 @@ +--- +id: hashKey +title: hashKey +--- + +```ts +function hashKey(queryKey): string; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:131 + +Default query & mutation keys hash function. +Hashes the value into a stable hash. + +## Parameters + +### queryKey + +readonly `unknown`[] + +## Returns + +`string` + +## Example + +```ts +// Object keys are sorted, so key order doesn't affect the hash: +hashKey(['todos', { page: 1, filter: 'done' }]) // === '["todos",{"filter":"done","page":1}]' +``` diff --git a/docs/framework/angular/reference/functions/hydrate.md b/docs/framework/angular/reference/functions/hydrate.md new file mode 100644 index 00000000000..44a4d6ef3e7 --- /dev/null +++ b/docs/framework/angular/reference/functions/hydrate.md @@ -0,0 +1,49 @@ +--- +id: hydrate +title: hydrate +--- + +```ts +function hydrate( + client, + dehydratedState, + options?): void; +``` + +Defined in: packages/query-core/dist-ts/src/hydration.d.ts:119 + +Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the +client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`. +Queries not yet in the cache are built from the dehydrated snapshot; queries that already exist are only updated +when the dehydrated data is newer than what's already cached. Newly built queries have their `fetchStatus` reset +to `'idle'` so they don't hydrate stuck in a fetching state. If a dehydrated query still had an in-flight +promise, it is resumed via `query.fetch()` (reusing that promise as `initialPromise`) rather than re-invoking +`queryFn`. + +## Parameters + +### client + +[`QueryClient`](../classes/QueryClient.md) + +### dehydratedState + +`Partial`\<[`DehydratedState`](../interfaces/DehydratedState.md)\> + +### options? + +[`HydrateOptions`](../interfaces/HydrateOptions.md) + +## Returns + +`void` + +## Example + +```ts +// dehydratedState was produced by `dehydrate` on the server +// and sent to the client, e.g. embedded in server-rendered markup. +const queryClient = new QueryClient() + +hydrate(queryClient, dehydratedState) +``` diff --git a/docs/framework/angular/reference/functions/infiniteQueryOptions.md b/docs/framework/angular/reference/functions/infiniteQueryOptions.md index f1e3a235d48..1011653b452 100644 --- a/docs/framework/angular/reference/functions/infiniteQueryOptions.md +++ b/docs/framework/angular/reference/functions/infiniteQueryOptions.md @@ -9,7 +9,7 @@ title: infiniteQueryOptions function infiniteQueryOptions(options): CreateInfiniteQueryOptions & object & QueryKeyWithDataTag, TError>; ``` -Defined in: [infinite-query-options.ts:181](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L181) +Defined in: [packages/angular-query-experimental/src/infinite-query-options.ts:181](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L181) You can generally pass everything to `infiniteQueryOptions` that you can also pass to `injectInfiniteQuery`. These options can be shared across functions and imperative APIs such as @@ -30,7 +30,7 @@ This overload is selected when `initialData` is set. #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -100,7 +100,7 @@ export class Projects { function infiniteQueryOptions(options): OmitKeyof, "queryFn"> & object & QueryKeyWithDataTag, TError>; ``` -Defined in: [infinite-query-options.ts:255](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L255) +Defined in: [packages/angular-query-experimental/src/infinite-query-options.ts:255](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L255) You can generally pass everything to `infiniteQueryOptions` that you can also pass to `injectInfiniteQuery`. These options can be shared across functions and imperative APIs such as @@ -119,7 +119,7 @@ for. #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -195,7 +195,7 @@ export class Comments { function infiniteQueryOptions(options): CreateInfiniteQueryOptions & object & QueryKeyWithDataTag, TError>; ``` -Defined in: [infinite-query-options.ts:329](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L329) +Defined in: [packages/angular-query-experimental/src/infinite-query-options.ts:329](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L329) You can generally pass everything to `infiniteQueryOptions` that you can also pass to `injectInfiniteQuery`. These options can be shared across functions and imperative APIs such as @@ -214,7 +214,7 @@ for. #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey diff --git a/docs/framework/angular/reference/functions/injectInfiniteQuery.md b/docs/framework/angular/reference/functions/injectInfiniteQuery.md index 8f80b177691..2b121d5e4ac 100644 --- a/docs/framework/angular/reference/functions/injectInfiniteQuery.md +++ b/docs/framework/angular/reference/functions/injectInfiniteQuery.md @@ -9,7 +9,7 @@ title: injectInfiniteQuery function injectInfiniteQuery(injectInfiniteQueryFn, options?): DefinedCreateInfiniteQueryResult; ``` -Defined in: [inject-infinite-query.ts:83](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-infinite-query.ts#L83) +Defined in: [packages/angular-query-experimental/src/inject-infinite-query.ts:83](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-infinite-query.ts#L83) The options for `injectInfiniteQuery` are identical to `injectQuery`, with the addition of `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`. Infinite queries can @@ -30,7 +30,7 @@ so the resulting `data` signal is never `undefined` (unless a `select` changes ` #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -110,7 +110,7 @@ export class Projects { function injectInfiniteQuery(injectInfiniteQueryFn, options?): CreateInfiniteQueryResult; ``` -Defined in: [inject-infinite-query.ts:239](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-infinite-query.ts#L239) +Defined in: [packages/angular-query-experimental/src/inject-infinite-query.ts:239](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-infinite-query.ts#L239) Injects an infinite query: a declarative dependency on an asynchronous source of data that is tied to a unique key. Infinite queries can additively "load more" data onto an existing set of data, or @@ -128,7 +128,7 @@ unique key. Infinite queries can additively "load more" data onto an existing se #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -299,7 +299,7 @@ export class Comments { function injectInfiniteQuery(injectInfiniteQueryFn, options?): CreateInfiniteQueryResult; ``` -Defined in: [inject-infinite-query.ts:267](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-infinite-query.ts#L267) +Defined in: [packages/angular-query-experimental/src/inject-infinite-query.ts:267](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-infinite-query.ts#L267) This overload accepts the general [CreateInfiniteQueryOptions](../interfaces/CreateInfiniteQueryOptions.md) shape rather than the `initialData`-aware overloads above, so whether `data` is defined can't be inferred from the call site — @@ -318,7 +318,7 @@ options. #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey diff --git a/docs/framework/angular/reference/functions/injectIsFetching.md b/docs/framework/angular/reference/functions/injectIsFetching.md index abe3e4e8837..1d121851e47 100644 --- a/docs/framework/angular/reference/functions/injectIsFetching.md +++ b/docs/framework/angular/reference/functions/injectIsFetching.md @@ -7,7 +7,7 @@ title: injectIsFetching function injectIsFetching(filters?, options?): Signal; ``` -Defined in: [inject-is-fetching.ts:63](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-fetching.ts#L63) +Defined in: [packages/angular-query-experimental/src/inject-is-fetching.ts:63](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-fetching.ts#L63) Injects a signal that tracks the number of queries that your application is loading or fetching in the background (useful for app-wide loading indicators). @@ -16,9 +16,9 @@ background (useful for app-wide loading indicators). ### filters? -`QueryFilters`\ +[`QueryFilters`](../interfaces/QueryFilters.md)\ -The QueryFilters to narrow down the matched queries. +The [QueryFilters](../interfaces/QueryFilters.md) to narrow down the matched queries. ### options? diff --git a/docs/framework/angular/reference/functions/injectIsMutating.md b/docs/framework/angular/reference/functions/injectIsMutating.md index 2879f5986de..b3a8b063e60 100644 --- a/docs/framework/angular/reference/functions/injectIsMutating.md +++ b/docs/framework/angular/reference/functions/injectIsMutating.md @@ -7,7 +7,7 @@ title: injectIsMutating function injectIsMutating(filters?, options?): Signal; ``` -Defined in: [inject-is-mutating.ts:46](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-mutating.ts#L46) +Defined in: [packages/angular-query-experimental/src/inject-is-mutating.ts:46](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-mutating.ts#L46) Injects a signal that tracks the number of mutations that your application currently has `pending` (useful for app-wide loading indicators). @@ -16,9 +16,9 @@ Injects a signal that tracks the number of mutations that your application curre ### filters? -`MutationFilters`\<`unknown`, `Error`, `unknown`, `unknown`\> +[`MutationFilters`](../interfaces/MutationFilters.md)\<`unknown`, `Error`, `unknown`, `unknown`\> -The MutationFilters to narrow down the matched mutations. +The [MutationFilters](../interfaces/MutationFilters.md) to narrow down the matched mutations. ### options? diff --git a/docs/framework/angular/reference/functions/injectIsRestoring.md b/docs/framework/angular/reference/functions/injectIsRestoring.md index d3b3182cafe..c66a4901ce0 100644 --- a/docs/framework/angular/reference/functions/injectIsRestoring.md +++ b/docs/framework/angular/reference/functions/injectIsRestoring.md @@ -7,7 +7,7 @@ title: injectIsRestoring function injectIsRestoring(options?): Signal; ``` -Defined in: [inject-is-restoring.ts:35](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-restoring.ts#L35) +Defined in: [packages/angular-query-experimental/src/inject-is-restoring.ts:35](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-restoring.ts#L35) Injects a signal that tracks whether a restore (e.g. from a persisted client, wired up via `provideIsRestoring`) is currently in progress. `injectQuery` and friends also check this internally to diff --git a/docs/framework/angular/reference/functions/injectMutation.md b/docs/framework/angular/reference/functions/injectMutation.md index f5e5169d1c6..b4cca9d4cb3 100644 --- a/docs/framework/angular/reference/functions/injectMutation.md +++ b/docs/framework/angular/reference/functions/injectMutation.md @@ -7,7 +7,7 @@ title: injectMutation function injectMutation(injectMutationFn, options?): CreateMutationResult; ``` -Defined in: [inject-mutation.ts:174](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-mutation.ts#L174) +Defined in: [packages/angular-query-experimental/src/inject-mutation.ts:174](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-mutation.ts#L174) Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects. `injectMutation` is the function for that. Unlike queries, mutations are not run automatically. diff --git a/docs/framework/angular/reference/functions/injectMutationState.md b/docs/framework/angular/reference/functions/injectMutationState.md index 88c3abd5f6a..a96ac308998 100644 --- a/docs/framework/angular/reference/functions/injectMutationState.md +++ b/docs/framework/angular/reference/functions/injectMutationState.md @@ -7,16 +7,16 @@ title: injectMutationState function injectMutationState(injectMutationStateFn, options?): Signal; ``` -Defined in: [inject-mutation-state.ts:106](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-mutation-state.ts#L106) +Defined in: [packages/angular-query-experimental/src/inject-mutation-state.ts:106](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-mutation-state.ts#L106) Injects a signal that gives you access to all mutations in the `MutationCache`. You can pass `filters` -(MutationFilters) to narrow down your mutations, and `select` to transform the mutation state. +([MutationFilters](../interfaces/MutationFilters.md)) to narrow down your mutations, and `select` to transform the mutation state. ## Type Parameters ### TResult -`TResult` = `MutationState`\<`unknown`, `Error`, `unknown`, `unknown`\> +`TResult` = [`MutationState`](../interfaces/MutationState.md)\<`unknown`, `Error`, `unknown`, `unknown`\> ## Parameters diff --git a/docs/framework/angular/reference/functions/injectQuery.md b/docs/framework/angular/reference/functions/injectQuery.md index 8ef9d49cbfa..2dca2d7fb19 100644 --- a/docs/framework/angular/reference/functions/injectQuery.md +++ b/docs/framework/angular/reference/functions/injectQuery.md @@ -9,7 +9,7 @@ title: injectQuery function injectQuery(injectQueryFn, options?): DefinedCreateQueryResult; ``` -Defined in: [inject-query.ts:69](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-query.ts#L69) +Defined in: [packages/angular-query-experimental/src/inject-query.ts:69](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-query.ts#L69) This overload is selected when `initialData` is set on the options returned by `injectQueryFn`, so the resulting `data` signal is never `undefined` (unless a `select` changes `TData` to include `undefined`). @@ -94,7 +94,7 @@ export class Posts { function injectQuery(injectQueryFn, options?): CreateQueryResult; ``` -Defined in: [inject-query.ts:158](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-query.ts#L158) +Defined in: [packages/angular-query-experimental/src/inject-query.ts:158](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-query.ts#L158) Injects a query: a declarative dependency on an asynchronous source of data that is tied to a unique key. @@ -212,7 +212,7 @@ export class Posts { function injectQuery(injectQueryFn, options?): CreateQueryResult; ``` -Defined in: [inject-query.ts:185](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-query.ts#L185) +Defined in: [packages/angular-query-experimental/src/inject-query.ts:185](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-query.ts#L185) This overload accepts the general [CreateQueryOptions](../interfaces/CreateQueryOptions.md) shape rather than the `initialData`-aware overloads above, so whether `data` is defined can't be inferred from the call site — useful when wrapping diff --git a/docs/framework/angular/reference/functions/injectQueryClient.md b/docs/framework/angular/reference/functions/injectQueryClient.md index 58fd08281c1..a6f475f5e62 100644 --- a/docs/framework/angular/reference/functions/injectQueryClient.md +++ b/docs/framework/angular/reference/functions/injectQueryClient.md @@ -7,7 +7,7 @@ title: injectQueryClient function injectQueryClient(injectOptions): QueryClient; ``` -Defined in: [inject-query-client.ts:18](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-query-client.ts#L18) +Defined in: [packages/angular-query-experimental/src/inject-query-client.ts:18](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-query-client.ts#L18) Injects a `QueryClient` instance and allows passing a custom injector. @@ -21,7 +21,7 @@ Type of the options argument to inject and optionally a custom injector. ## Returns -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) The `QueryClient` instance. diff --git a/docs/framework/angular/reference/functions/isCancelledError.md b/docs/framework/angular/reference/functions/isCancelledError.md new file mode 100644 index 00000000000..c2aea390ea1 --- /dev/null +++ b/docs/framework/angular/reference/functions/isCancelledError.md @@ -0,0 +1,24 @@ +--- +id: isCancelledError +title: isCancelledError +--- + +```ts +function isCancelledError(value): value is CancelledError; +``` + +Defined in: packages/query-core/dist-ts/src/retryer.d.ts:55 + +## Parameters + +### value + +`any` + +## Returns + +`value is CancelledError` + +## Deprecated + +Use instanceof `CancelledError` instead. diff --git a/docs/framework/angular/reference/functions/keepPreviousData.md b/docs/framework/angular/reference/functions/keepPreviousData.md new file mode 100644 index 00000000000..9552f3b25b8 --- /dev/null +++ b/docs/framework/angular/reference/functions/keepPreviousData.md @@ -0,0 +1,40 @@ +--- +id: keepPreviousData +title: keepPreviousData +--- + +```ts +function keepPreviousData(previousData): T | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:164 + +Intended to be passed as a query's `placeholderData` option, for example +`placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new +query key is fetching, it keeps displaying the previously fetched data until the new data arrives. + +## Type Parameters + +### T + +`T` + +## Parameters + +### previousData + +`T` | `undefined` + +## Returns + +`T` \| `undefined` + +## Example + +```ts +new QueryObserver(queryClient, { + queryKey: ['posts', page], + queryFn: () => fetchPosts(page), + placeholderData: keepPreviousData, +}) +``` diff --git a/docs/framework/angular/reference/functions/matchMutation.md b/docs/framework/angular/reference/functions/matchMutation.md new file mode 100644 index 00000000000..aaac0d976b0 --- /dev/null +++ b/docs/framework/angular/reference/functions/matchMutation.md @@ -0,0 +1,38 @@ +--- +id: matchMutation +title: matchMutation +--- + +```ts +function matchMutation(filters, mutation): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:119 + +Checks whether a mutation matches the given [MutationFilters](../interfaces/MutationFilters.md). +Every filter that is specified must match; filters that are left unspecified are ignored. +If a `mutationKey` filter is provided but the mutation has no `mutationKey` of its own, it does not match. + +## Parameters + +### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) + +### mutation + +[`Mutation`](../classes/Mutation.md)\<`any`, `any`\> + +## Returns + +`boolean` + +## Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const matchingMutations = mutationCache + .getAll() + .filter((mutation) => matchMutation({ mutationKey: ['addPost'] }, mutation)) +``` diff --git a/docs/framework/angular/reference/functions/matchQuery.md b/docs/framework/angular/reference/functions/matchQuery.md new file mode 100644 index 00000000000..012ac43329d --- /dev/null +++ b/docs/framework/angular/reference/functions/matchQuery.md @@ -0,0 +1,37 @@ +--- +id: matchQuery +title: matchQuery +--- + +```ts +function matchQuery(filters, query): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:104 + +Checks whether a query matches the given [QueryFilters](../interfaces/QueryFilters.md). +Every filter that is specified must match; filters that are left unspecified are ignored. + +## Parameters + +### filters + +[`QueryFilters`](../interfaces/QueryFilters.md) + +### query + +[`Query`](../classes/Query.md)\<`any`, `any`, `any`, `any`\> + +## Returns + +`boolean` + +## Example + +```ts +const queryCache = queryClient.getQueryCache() + +const matchingQueries = queryCache + .getAll() + .filter((query) => matchQuery({ queryKey: ['posts'] }, query)) +``` diff --git a/docs/framework/angular/reference/functions/mutationOptions.md b/docs/framework/angular/reference/functions/mutationOptions.md index b18197c19ad..4b4a987169d 100644 --- a/docs/framework/angular/reference/functions/mutationOptions.md +++ b/docs/framework/angular/reference/functions/mutationOptions.md @@ -9,7 +9,7 @@ title: mutationOptions function mutationOptions(options): WithRequired, "mutationKey">; ``` -Defined in: [mutation-options.ts:40](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/mutation-options.ts#L40) +Defined in: [packages/angular-query-experimental/src/mutation-options.ts:40](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/mutation-options.ts#L40) You can generally pass everything to `mutationOptions` that you can also pass to `injectMutation`. A `mutationKey` is required on this overload so the mutation can be looked up later, e.g. with @@ -37,14 +37,14 @@ You can generally pass everything to `mutationOptions` that you can also pass to #### options -`WithRequired`\<[`CreateMutationOptions`](../interfaces/CreateMutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> +[`WithRequired`](../type-aliases/WithRequired.md)\<[`CreateMutationOptions`](../interfaces/CreateMutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> The mutation options to use, identical to what you'd pass to `injectMutation`, with a required `mutationKey`. ### Returns -`WithRequired`\<[`CreateMutationOptions`](../interfaces/CreateMutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> +[`WithRequired`](../type-aliases/WithRequired.md)\<[`CreateMutationOptions`](../interfaces/CreateMutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> The same options object, unchanged. @@ -85,7 +85,7 @@ export class SavingIndicator { function mutationOptions(options): Omit, "mutationKey">; ``` -Defined in: [mutation-options.ts:98](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/mutation-options.ts#L98) +Defined in: [packages/angular-query-experimental/src/mutation-options.ts:98](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/mutation-options.ts#L98) You can generally pass everything to `mutationOptions` that you can also pass to `injectMutation`. No `mutationKey` is required on this overload — use this when you don't need to target the mutation via a diff --git a/docs/framework/angular/reference/functions/noop.md b/docs/framework/angular/reference/functions/noop.md new file mode 100644 index 00000000000..7b8187ac6b7 --- /dev/null +++ b/docs/framework/angular/reference/functions/noop.md @@ -0,0 +1,32 @@ +--- +id: noop +title: noop +--- + +## Call Signature + +```ts +function noop(): void; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:85 + +A function that does nothing. + +### Returns + +`void` + +## Call Signature + +```ts +function noop(): undefined; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:86 + +A function that does nothing. + +### Returns + +`undefined` diff --git a/docs/framework/angular/reference/functions/partialMatchKey.md b/docs/framework/angular/reference/functions/partialMatchKey.md new file mode 100644 index 00000000000..0713f30cee2 --- /dev/null +++ b/docs/framework/angular/reference/functions/partialMatchKey.md @@ -0,0 +1,26 @@ +--- +id: partialMatchKey +title: partialMatchKey +--- + +```ts +function partialMatchKey(a, b): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:135 + +Checks if key `b` partially matches with key `a`. + +## Parameters + +### a + +readonly `unknown`[] + +### b + +readonly `unknown`[] + +## Returns + +`boolean` diff --git a/docs/framework/angular/reference/functions/provideAngularQuery.md b/docs/framework/angular/reference/functions/provideAngularQuery.md index 0efb348b8a0..d77bb0c7b7e 100644 --- a/docs/framework/angular/reference/functions/provideAngularQuery.md +++ b/docs/framework/angular/reference/functions/provideAngularQuery.md @@ -7,7 +7,7 @@ title: provideAngularQuery function provideAngularQuery(queryClient): Provider[]; ``` -Defined in: [providers.ts:121](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L121) +Defined in: [packages/angular-query-experimental/src/providers.ts:121](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L121) Sets up providers necessary to enable TanStack Query functionality for Angular applications. @@ -17,7 +17,7 @@ Allows configuring a `QueryClient`. ### queryClient -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) A `QueryClient` instance. diff --git a/docs/framework/angular/reference/functions/provideIsRestoring.md b/docs/framework/angular/reference/functions/provideIsRestoring.md index 44f5f476d3e..cd2847e5ddc 100644 --- a/docs/framework/angular/reference/functions/provideIsRestoring.md +++ b/docs/framework/angular/reference/functions/provideIsRestoring.md @@ -7,7 +7,7 @@ title: provideIsRestoring function provideIsRestoring(isRestoring): Provider; ``` -Defined in: [inject-is-restoring.ts:48](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-restoring.ts#L48) +Defined in: [packages/angular-query-experimental/src/inject-is-restoring.ts:48](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-restoring.ts#L48) Registers a provider for the restore state read by `injectIsRestoring`. Wire this up wherever you drive a restore yourself — e.g. a persist-client integration — so `injectQuery` and friends can defer subscribing diff --git a/docs/framework/angular/reference/functions/provideQueryClient.md b/docs/framework/angular/reference/functions/provideQueryClient.md index 76ae784100d..a599930ff20 100644 --- a/docs/framework/angular/reference/functions/provideQueryClient.md +++ b/docs/framework/angular/reference/functions/provideQueryClient.md @@ -7,7 +7,7 @@ title: provideQueryClient function provideQueryClient(queryClient): Provider; ``` -Defined in: [providers.ts:22](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L22) +Defined in: [packages/angular-query-experimental/src/providers.ts:22](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L22) Usually [provideTanStackQuery](provideTanStackQuery.md) is used once to set up TanStack Query and the [`QueryClient`](https://tanstack.com/query/latest/docs/reference/QueryClient) for the entire application — @@ -20,7 +20,7 @@ it calls `provideQueryClient` internally. Use `provideQueryClient` directly to p A `QueryClient` instance, or an `InjectionToken` which provides a `QueryClient`. -`QueryClient` | `InjectionToken`\<`QueryClient`\> +[`QueryClient`](../classes/QueryClient.md) | `InjectionToken`\<[`QueryClient`](../classes/QueryClient.md)\> ## Returns diff --git a/docs/framework/angular/reference/functions/provideTanStackQuery.md b/docs/framework/angular/reference/functions/provideTanStackQuery.md index e94975d12f8..0113a274dff 100644 --- a/docs/framework/angular/reference/functions/provideTanStackQuery.md +++ b/docs/framework/angular/reference/functions/provideTanStackQuery.md @@ -7,7 +7,7 @@ title: provideTanStackQuery function provideTanStackQuery(queryClient, ...features): Provider[]; ``` -Defined in: [providers.ts:102](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L102) +Defined in: [packages/angular-query-experimental/src/providers.ts:102](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L102) Sets up providers necessary to enable TanStack Query functionality for Angular applications. Allows configuring a `QueryClient` and optional features such as developer tools. @@ -18,7 +18,7 @@ configuring a `QueryClient` and optional features such as developer tools. A `QueryClient` instance, or an `InjectionToken` which provides a `QueryClient`. -`QueryClient` | `InjectionToken`\<`QueryClient`\> +[`QueryClient`](../classes/QueryClient.md) | `InjectionToken`\<[`QueryClient`](../classes/QueryClient.md)\> ### features diff --git a/docs/framework/angular/reference/functions/queryFeature.md b/docs/framework/angular/reference/functions/queryFeature.md index 86ef8b1543b..bd2bd0932c0 100644 --- a/docs/framework/angular/reference/functions/queryFeature.md +++ b/docs/framework/angular/reference/functions/queryFeature.md @@ -7,7 +7,7 @@ title: queryFeature function queryFeature(kind, providers): QueryFeature; ``` -Defined in: [providers.ts:143](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L143) +Defined in: [packages/angular-query-experimental/src/providers.ts:143](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L143) Helper function to create an object that represents a Query feature. diff --git a/docs/framework/angular/reference/functions/queryOptions.md b/docs/framework/angular/reference/functions/queryOptions.md index c3e6ce6229d..a1c901882e6 100644 --- a/docs/framework/angular/reference/functions/queryOptions.md +++ b/docs/framework/angular/reference/functions/queryOptions.md @@ -9,7 +9,7 @@ title: queryOptions function queryOptions(options): Omit, "queryFn"> & object & QueryKeyWithDataTag; ``` -Defined in: [query-options.ts:151](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/query-options.ts#L151) +Defined in: [packages/angular-query-experimental/src/query-options.ts:151](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/query-options.ts#L151) You can generally pass everything to `queryOptions` that you can also pass to `injectQuery`. These options can be shared across functions and imperative APIs such as `queryClient.fetchQuery`. `options.queryKey` is @@ -91,7 +91,7 @@ export class Posts { function queryOptions(options): OmitKeyof, "queryFn"> & object & QueryKeyWithDataTag; ``` -Defined in: [query-options.ts:200](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/query-options.ts#L200) +Defined in: [packages/angular-query-experimental/src/query-options.ts:200](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/query-options.ts#L200) You can generally pass everything to `queryOptions` that you can also pass to `injectQuery`. These options can be shared across functions and imperative APIs such as `queryClient.fetchQuery`. `options.queryKey` is @@ -168,7 +168,7 @@ export class Post { function queryOptions(options): CreateQueryOptions & object & QueryKeyWithDataTag; ``` -Defined in: [query-options.ts:281](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/query-options.ts#L281) +Defined in: [packages/angular-query-experimental/src/query-options.ts:281](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/query-options.ts#L281) You can generally pass everything to `queryOptions` that you can also pass to `injectQuery`. These options can be shared across functions and imperative APIs such as `queryClient.fetchQuery`. `options.queryKey` is diff --git a/docs/framework/angular/reference/functions/replaceEqualDeep.md b/docs/framework/angular/reference/functions/replaceEqualDeep.md new file mode 100644 index 00000000000..58d5b074f89 --- /dev/null +++ b/docs/framework/angular/reference/functions/replaceEqualDeep.md @@ -0,0 +1,41 @@ +--- +id: replaceEqualDeep +title: replaceEqualDeep +--- + +```ts +function replaceEqualDeep( + a, + b, + depth?): T; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:141 + +This function returns `a` if `b` is deeply equal. +If not, it will replace any deeply equal children of `b` with those of `a`. +This can be used for structural sharing between JSON values for example. + +## Type Parameters + +### T + +`T` + +## Parameters + +### a + +`unknown` + +### b + +`T` + +### depth? + +`number` + +## Returns + +`T` diff --git a/docs/framework/angular/reference/functions/shouldThrowError.md b/docs/framework/angular/reference/functions/shouldThrowError.md new file mode 100644 index 00000000000..4d0d27b37d9 --- /dev/null +++ b/docs/framework/angular/reference/functions/shouldThrowError.md @@ -0,0 +1,45 @@ +--- +id: shouldThrowError +title: shouldThrowError +--- + +```ts +function shouldThrowError(throwOnError, params): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:204 + +Resolves a `throwOnError` option to a boolean. +If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller, +additional context such as the query or mutation) and its result is returned, allowing the throwing +behavior to be decided per error. Otherwise, `throwOnError` itself is coerced to a boolean (`undefined` +resolves to `false`). + +## Type Parameters + +### T + +`T` *extends* (...`args`) => `boolean` + +## Parameters + +### throwOnError + +`boolean` | `T` | `undefined` + +### params + +`Parameters`\<`T`\> + +## Returns + +`boolean` + +## Example + +```ts +const throwOnError = + query.state.error && typeof options.throwOnError === 'function' + ? shouldThrowError(options.throwOnError, [query.state.error, query]) + : options.throwOnError +``` diff --git a/docs/framework/angular/reference/index.md b/docs/framework/angular/reference/index.md index 12ae163fcd1..bfeef0065bb 100644 --- a/docs/framework/angular/reference/index.md +++ b/docs/framework/angular/reference/index.md @@ -3,24 +3,93 @@ id: "@tanstack/angular-query-experimental" title: "@tanstack/angular-query-experimental" --- +## Classes + +- [CancelledError](classes/CancelledError.md) +- [InfiniteQueryObserver](classes/InfiniteQueryObserver.md) +- [Mutation](classes/Mutation.md) +- [MutationCache](classes/MutationCache.md) +- [MutationObserver](classes/MutationObserver.md) +- [QueriesObserver](classes/QueriesObserver.md) +- [Query](classes/Query.md) +- [QueryCache](classes/QueryCache.md) +- [QueryClient](classes/QueryClient.md) +- [QueryObserver](classes/QueryObserver.md) + ## Interfaces - [BaseMutationNarrowing](interfaces/BaseMutationNarrowing.md) - [BaseQueryNarrowing](interfaces/BaseQueryNarrowing.md) +- [CancelOptions](interfaces/CancelOptions.md) - [CreateBaseQueryOptions](interfaces/CreateBaseQueryOptions.md) - [CreateInfiniteQueryOptions](interfaces/CreateInfiniteQueryOptions.md) - [CreateMutationOptions](interfaces/CreateMutationOptions.md) - [CreateQueryOptions](interfaces/CreateQueryOptions.md) +- [DefaultOptions](interfaces/DefaultOptions.md) +- [DehydratedState](interfaces/DehydratedState.md) +- [DehydrateOptions](interfaces/DehydrateOptions.md) +- [~~EnsureQueryDataOptions~~](interfaces/EnsureQueryDataOptions.md) +- [FetchNextPageOptions](interfaces/FetchNextPageOptions.md) +- [FetchPreviousPageOptions](interfaces/FetchPreviousPageOptions.md) +- [~~FetchQueryOptions~~](interfaces/FetchQueryOptions.md) +- [HydrateOptions](interfaces/HydrateOptions.md) +- [InfiniteData](interfaces/InfiniteData.md) +- [InfiniteQueryObserverBaseResult](interfaces/InfiniteQueryObserverBaseResult.md) +- [InfiniteQueryObserverLoadingErrorResult](interfaces/InfiniteQueryObserverLoadingErrorResult.md) +- [InfiniteQueryObserverLoadingResult](interfaces/InfiniteQueryObserverLoadingResult.md) +- [InfiniteQueryObserverOptions](interfaces/InfiniteQueryObserverOptions.md) +- [InfiniteQueryObserverPendingResult](interfaces/InfiniteQueryObserverPendingResult.md) +- [InfiniteQueryObserverPlaceholderResult](interfaces/InfiniteQueryObserverPlaceholderResult.md) +- [InfiniteQueryObserverRefetchErrorResult](interfaces/InfiniteQueryObserverRefetchErrorResult.md) +- [InfiniteQueryObserverSuccessResult](interfaces/InfiniteQueryObserverSuccessResult.md) +- [InfiniteQueryPageParamsOptions](interfaces/InfiniteQueryPageParamsOptions.md) +- [InitialPageParam](interfaces/InitialPageParam.md) - [InjectInfiniteQueryOptions](interfaces/InjectInfiniteQueryOptions.md) - [InjectIsFetchingOptions](interfaces/InjectIsFetchingOptions.md) - [InjectIsMutatingOptions](interfaces/InjectIsMutatingOptions.md) - [InjectMutationOptions](interfaces/InjectMutationOptions.md) - [InjectMutationStateOptions](interfaces/InjectMutationStateOptions.md) - [InjectQueryOptions](interfaces/InjectQueryOptions.md) +- [InvalidateOptions](interfaces/InvalidateOptions.md) +- [InvalidateQueryFilters](interfaces/InvalidateQueryFilters.md) +- [MutateOptions](interfaces/MutateOptions.md) +- [MutationCacheConfig](interfaces/MutationCacheConfig.md) +- [MutationFilters](interfaces/MutationFilters.md) +- [MutationObserverBaseResult](interfaces/MutationObserverBaseResult.md) +- [MutationObserverErrorResult](interfaces/MutationObserverErrorResult.md) +- [MutationObserverIdleResult](interfaces/MutationObserverIdleResult.md) +- [MutationObserverLoadingResult](interfaces/MutationObserverLoadingResult.md) +- [MutationObserverOptions](interfaces/MutationObserverOptions.md) +- [MutationObserverSuccessResult](interfaces/MutationObserverSuccessResult.md) +- [MutationOptions](interfaces/MutationOptions.md) +- [MutationState](interfaces/MutationState.md) +- [NotifyEvent](interfaces/NotifyEvent.md) +- [QueriesObserverOptions](interfaces/QueriesObserverOptions.md) +- [QueryCacheConfig](interfaces/QueryCacheConfig.md) +- [QueryClientConfig](interfaces/QueryClientConfig.md) +- [QueryExecuteOptions](interfaces/QueryExecuteOptions.md) - [QueryFeature](interfaces/QueryFeature.md) +- [QueryFilters](interfaces/QueryFilters.md) +- [QueryObserverBaseResult](interfaces/QueryObserverBaseResult.md) +- [QueryObserverLoadingErrorResult](interfaces/QueryObserverLoadingErrorResult.md) +- [QueryObserverLoadingResult](interfaces/QueryObserverLoadingResult.md) +- [QueryObserverOptions](interfaces/QueryObserverOptions.md) +- [QueryObserverPendingResult](interfaces/QueryObserverPendingResult.md) +- [QueryObserverPlaceholderResult](interfaces/QueryObserverPlaceholderResult.md) +- [QueryObserverRefetchErrorResult](interfaces/QueryObserverRefetchErrorResult.md) +- [QueryObserverSuccessResult](interfaces/QueryObserverSuccessResult.md) +- [QueryOptions](interfaces/QueryOptions.md) +- [QueryState](interfaces/QueryState.md) +- [RefetchOptions](interfaces/RefetchOptions.md) +- [RefetchQueryFilters](interfaces/RefetchQueryFilters.md) +- [Register](interfaces/Register.md) +- [ResetOptions](interfaces/ResetOptions.md) +- [ResultOptions](interfaces/ResultOptions.md) +- [SetDataOptions](interfaces/SetDataOptions.md) ## Type Aliases +- [AnyDataTag](type-aliases/AnyDataTag.md) - [CreateBaseMutationResult](type-aliases/CreateBaseMutationResult.md) - [CreateBaseQueryResult](type-aliases/CreateBaseQueryResult.md) - [CreateInfiniteQueryResult](type-aliases/CreateInfiniteQueryResult.md) @@ -28,22 +97,101 @@ title: "@tanstack/angular-query-experimental" - [CreateMutateFunction](type-aliases/CreateMutateFunction.md) - [CreateMutationResult](type-aliases/CreateMutationResult.md) - [CreateQueryResult](type-aliases/CreateQueryResult.md) +- [DataTag](type-aliases/DataTag.md) +- [dataTagErrorSymbol](type-aliases/dataTagErrorSymbol.md) +- [dataTagSymbol](type-aliases/dataTagSymbol.md) +- [DefaultedInfiniteQueryObserverOptions](type-aliases/DefaultedInfiniteQueryObserverOptions.md) +- [DefaultedQueryObserverOptions](type-aliases/DefaultedQueryObserverOptions.md) +- [DefaultError](type-aliases/DefaultError.md) - [DefinedCreateInfiniteQueryResult](type-aliases/DefinedCreateInfiniteQueryResult.md) - [DefinedCreateQueryResult](type-aliases/DefinedCreateQueryResult.md) +- [DefinedInfiniteQueryObserverResult](type-aliases/DefinedInfiniteQueryObserverResult.md) - [DefinedInitialDataInfiniteOptions](type-aliases/DefinedInitialDataInfiniteOptions.md) - [DefinedInitialDataOptions](type-aliases/DefinedInitialDataOptions.md) +- [DefinedQueryObserverResult](type-aliases/DefinedQueryObserverResult.md) - [DevtoolsFeature](type-aliases/DevtoolsFeature.md) +- [DistributiveOmit](type-aliases/DistributiveOmit.md) +- [~~EnsureInfiniteQueryDataOptions~~](type-aliases/EnsureInfiniteQueryDataOptions.md) +- [~~FetchInfiniteQueryOptions~~](type-aliases/FetchInfiniteQueryOptions.md) +- [FetchStatus](type-aliases/FetchStatus.md) +- [GetNextPageParamFunction](type-aliases/GetNextPageParamFunction.md) +- [GetPreviousPageParamFunction](type-aliases/GetPreviousPageParamFunction.md) +- [InferDataFromTag](type-aliases/InferDataFromTag.md) +- [InferErrorFromTag](type-aliases/InferErrorFromTag.md) +- [InfiniteQueryExecuteOptions](type-aliases/InfiniteQueryExecuteOptions.md) +- [InfiniteQueryObserverResult](type-aliases/InfiniteQueryObserverResult.md) +- [InitialDataFunction](type-aliases/InitialDataFunction.md) +- [ManagedTimerId](type-aliases/ManagedTimerId.md) +- [MutateFunction](type-aliases/MutateFunction.md) +- [MutateFunctionRest](type-aliases/MutateFunctionRest.md) +- [MutationCacheNotifyEvent](type-aliases/MutationCacheNotifyEvent.md) +- [MutationFunction](type-aliases/MutationFunction.md) +- [MutationFunctionContext](type-aliases/MutationFunctionContext.md) +- [MutationKey](type-aliases/MutationKey.md) +- [MutationMeta](type-aliases/MutationMeta.md) +- [MutationObserverResult](type-aliases/MutationObserverResult.md) +- [MutationScope](type-aliases/MutationScope.md) +- [MutationStatus](type-aliases/MutationStatus.md) +- [NetworkMode](type-aliases/NetworkMode.md) +- [NonUndefinedGuard](type-aliases/NonUndefinedGuard.md) +- [NotifyEventType](type-aliases/NotifyEventType.md) +- [NotifyOnChangeProps](type-aliases/NotifyOnChangeProps.md) +- [OmitKeyof](type-aliases/OmitKeyof.md) +- [Override](type-aliases/Override.md) - [PersistQueryClientFeature](type-aliases/PersistQueryClientFeature.md) +- [PlaceholderDataFunction](type-aliases/PlaceholderDataFunction.md) - [QueriesOptions](type-aliases/QueriesOptions.md) +- [QueriesPlaceholderDataFunction](type-aliases/QueriesPlaceholderDataFunction.md) - [QueriesResults](type-aliases/QueriesResults.md) +- [QueryBooleanOption](type-aliases/QueryBooleanOption.md) +- [QueryCacheNotifyEvent](type-aliases/QueryCacheNotifyEvent.md) - [QueryFeatures](type-aliases/QueryFeatures.md) +- [QueryFunction](type-aliases/QueryFunction.md) +- [QueryFunctionContext](type-aliases/QueryFunctionContext.md) +- [QueryKey](type-aliases/QueryKey.md) +- [QueryKeyHashFunction](type-aliases/QueryKeyHashFunction.md) +- [QueryKeyWithDataTag](type-aliases/QueryKeyWithDataTag.md) +- [QueryMeta](type-aliases/QueryMeta.md) +- [QueryObserverResult](type-aliases/QueryObserverResult.md) +- [QueryPersister](type-aliases/QueryPersister.md) +- [QueryStatus](type-aliases/QueryStatus.md) +- [SkipToken](type-aliases/SkipToken.md) +- [StaleTime](type-aliases/StaleTime.md) +- [StaleTimeFunction](type-aliases/StaleTimeFunction.md) +- [ThrowOnError](type-aliases/ThrowOnError.md) +- [TimeoutCallback](type-aliases/TimeoutCallback.md) +- [TimeoutProvider](type-aliases/TimeoutProvider.md) - [UndefinedInitialDataInfiniteOptions](type-aliases/UndefinedInitialDataInfiniteOptions.md) - [UndefinedInitialDataOptions](type-aliases/UndefinedInitialDataOptions.md) +- [UnsetMarker](type-aliases/UnsetMarker.md) - [UnusedSkipTokenInfiniteOptions](type-aliases/UnusedSkipTokenInfiniteOptions.md) - [UnusedSkipTokenOptions](type-aliases/UnusedSkipTokenOptions.md) +- [Updater](type-aliases/Updater.md) +- [WithRequired](type-aliases/WithRequired.md) + +## Variables + +- [dataTagErrorSymbol](variables/dataTagErrorSymbol.md) +- [dataTagSymbol](variables/dataTagSymbol.md) +- [defaultScheduler](variables/defaultScheduler.md) +- [environmentManager](variables/environmentManager.md) +- [focusManager](variables/focusManager.md) +- [~~isServer~~](variables/isServer.md) +- [notifyManager](variables/notifyManager.md) +- [onlineManager](variables/onlineManager.md) +- [skipToken](variables/skipToken.md) +- [timeoutManager](variables/timeoutManager.md) +- [unsetMarker](variables/unsetMarker.md) ## Functions +- [defaultShouldDehydrateMutation](functions/defaultShouldDehydrateMutation.md) +- [defaultShouldDehydrateQuery](functions/defaultShouldDehydrateQuery.md) +- [dehydrate](functions/dehydrate.md) +- [dehydrateQuery](functions/dehydrateQuery.md) +- [experimental\_streamedQuery](functions/experimental_streamedQuery.md) +- [hashKey](functions/hashKey.md) +- [hydrate](functions/hydrate.md) - [infiniteQueryOptions](functions/infiniteQueryOptions.md) - [injectInfiniteQuery](functions/injectInfiniteQuery.md) - [injectIsFetching](functions/injectIsFetching.md) @@ -53,10 +201,18 @@ title: "@tanstack/angular-query-experimental" - [injectMutationState](functions/injectMutationState.md) - [injectQuery](functions/injectQuery.md) - [~~injectQueryClient~~](functions/injectQueryClient.md) +- [~~isCancelledError~~](functions/isCancelledError.md) +- [keepPreviousData](functions/keepPreviousData.md) +- [matchMutation](functions/matchMutation.md) +- [matchQuery](functions/matchQuery.md) - [mutationOptions](functions/mutationOptions.md) +- [noop](functions/noop.md) +- [partialMatchKey](functions/partialMatchKey.md) - [~~provideAngularQuery~~](functions/provideAngularQuery.md) - [provideIsRestoring](functions/provideIsRestoring.md) - [provideQueryClient](functions/provideQueryClient.md) - [provideTanStackQuery](functions/provideTanStackQuery.md) - [queryFeature](functions/queryFeature.md) - [queryOptions](functions/queryOptions.md) +- [replaceEqualDeep](functions/replaceEqualDeep.md) +- [shouldThrowError](functions/shouldThrowError.md) diff --git a/docs/framework/angular/reference/interfaces/BaseMutationNarrowing.md b/docs/framework/angular/reference/interfaces/BaseMutationNarrowing.md index 5ea77a60815..6a148af0310 100644 --- a/docs/framework/angular/reference/interfaces/BaseMutationNarrowing.md +++ b/docs/framework/angular/reference/interfaces/BaseMutationNarrowing.md @@ -3,7 +3,7 @@ id: BaseMutationNarrowing title: BaseMutationNarrowing --- -Defined in: [types.ts:328](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L328) +Defined in: [packages/angular-query-experimental/src/types.ts:328](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L328) The `isSuccess`/`isError`/`isPending`/`isIdle` methods on a mutation result. Each is both a `Signal` (its current boolean value is read reactively without calling it) and a type-guard function you can @@ -19,7 +19,7 @@ The type your mutation function resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your mutation function may throw. @@ -44,7 +44,7 @@ their `onMutateResult` parameter — useful for optimistic-update rollback data. isError: SignalFunction<(this) => this is CreateMutationResult, { mutate: CreateMutateFunction }> & { mutateAsync: CreateMutateAsyncFunction }>>; ``` -Defined in: [types.ts:351](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L351) +Defined in: [packages/angular-query-experimental/src/types.ts:351](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L351) *** @@ -54,7 +54,7 @@ Defined in: [types.ts:351](https://github.com/TanStack/query/blob/main/packages/ isIdle: SignalFunction<(this) => this is CreateMutationResult, { mutate: CreateMutateFunction }> & { mutateAsync: CreateMutateAsyncFunction }>>; ``` -Defined in: [types.ts:385](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L385) +Defined in: [packages/angular-query-experimental/src/types.ts:385](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L385) *** @@ -64,7 +64,7 @@ Defined in: [types.ts:385](https://github.com/TanStack/query/blob/main/packages/ isPending: SignalFunction<(this) => this is CreateMutationResult, { mutate: CreateMutateFunction }> & { mutateAsync: CreateMutateAsyncFunction }>>; ``` -Defined in: [types.ts:368](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L368) +Defined in: [packages/angular-query-experimental/src/types.ts:368](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L368) *** @@ -74,4 +74,4 @@ Defined in: [types.ts:368](https://github.com/TanStack/query/blob/main/packages/ isSuccess: SignalFunction<(this) => this is CreateMutationResult, { mutate: CreateMutateFunction }> & { mutateAsync: CreateMutateAsyncFunction }>>; ``` -Defined in: [types.ts:334](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L334) +Defined in: [packages/angular-query-experimental/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L334) diff --git a/docs/framework/angular/reference/interfaces/BaseQueryNarrowing.md b/docs/framework/angular/reference/interfaces/BaseQueryNarrowing.md index eaf5decb7bf..48ebe0aa8c7 100644 --- a/docs/framework/angular/reference/interfaces/BaseQueryNarrowing.md +++ b/docs/framework/angular/reference/interfaces/BaseQueryNarrowing.md @@ -3,7 +3,7 @@ id: BaseQueryNarrowing title: BaseQueryNarrowing --- -Defined in: [types.ts:83](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L83) +Defined in: [packages/angular-query-experimental/src/types.ts:83](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L83) The `isSuccess`/`isError`/`isPending` methods on a query result. Unlike `react-query`'s derived booleans, these are type-guard methods you call — `if (query.isSuccess())` — so that `query.data` narrows away @@ -20,7 +20,7 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. @@ -32,7 +32,7 @@ The type of errors your `queryFn` may throw. isError: (this) => this is CreateBaseQueryResult>; ``` -Defined in: [types.ts:91](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L91) +Defined in: [packages/angular-query-experimental/src/types.ts:91](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L91) #### Parameters @@ -52,7 +52,7 @@ Defined in: [types.ts:91](https://github.com/TanStack/query/blob/main/packages/a isPending: (this) => this is CreateBaseQueryResult>; ``` -Defined in: [types.ts:98](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L98) +Defined in: [packages/angular-query-experimental/src/types.ts:98](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L98) #### Parameters @@ -72,7 +72,7 @@ Defined in: [types.ts:98](https://github.com/TanStack/query/blob/main/packages/a isSuccess: (this) => this is CreateBaseQueryResult>; ``` -Defined in: [types.ts:84](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L84) +Defined in: [packages/angular-query-experimental/src/types.ts:84](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L84) #### Parameters diff --git a/docs/framework/angular/reference/interfaces/CancelOptions.md b/docs/framework/angular/reference/interfaces/CancelOptions.md new file mode 100644 index 00000000000..4e704d0bed7 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/CancelOptions.md @@ -0,0 +1,26 @@ +--- +id: CancelOptions +title: CancelOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:855 + +## Properties + +### revert? + +```ts +optional revert: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:856 + +*** + +### silent? + +```ts +optional silent: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:857 diff --git a/docs/framework/angular/reference/interfaces/CreateBaseQueryOptions.md b/docs/framework/angular/reference/interfaces/CreateBaseQueryOptions.md index f563462798b..919577cc6f8 100644 --- a/docs/framework/angular/reference/interfaces/CreateBaseQueryOptions.md +++ b/docs/framework/angular/reference/interfaces/CreateBaseQueryOptions.md @@ -3,15 +3,15 @@ id: CreateBaseQueryOptions title: CreateBaseQueryOptions --- -Defined in: [types.ts:34](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L34) +Defined in: [packages/angular-query-experimental/src/types.ts:34](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L34) The options shared across `angular-query-experimental`'s query functions. Extends -QueryObserverOptions from `@tanstack/query-core` as-is — unlike `react-query`, +[QueryObserverOptions](QueryObserverOptions.md) from `@tanstack/query-core` as-is — unlike `react-query`, `angular-query-experimental` has no extra framework-specific option here. ## Extends -- `QueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> +- [`QueryObserverOptions`](QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> ## Type Parameters @@ -23,7 +23,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. @@ -43,6 +43,575 @@ The type of the data actually held in the query cache — the input to `select` ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. + +## Properties + +### enabled? + +```ts +optional enabled: QueryBooleanOption; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:210 + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`enabled`](QueryObserverOptions.md#enabled) + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:120 + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`gcTime`](QueryObserverOptions.md#gctime) + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:160 + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialData`](QueryObserverOptions.md#initialdata) + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:164 + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialDataUpdatedAt`](QueryObserverOptions.md#initialdataupdatedat) + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:185 + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`maxPages`](QueryObserverOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:181 + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`meta`](QueryObserverOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:109 + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`networkMode`](QueryObserverOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:267 + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister()? + +```ts +optional persister: (queryFn, context, query) => TQueryFnData | Promise; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:133 + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Parameters + +##### queryFn + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TQueryFnData`, `NoInfer`\<`TQueryKey`\>, `never`\> + +##### context + +###### client + +[`QueryClient`](../classes/QueryClient.md) + +###### direction? + +`unknown` + +**Deprecated** + +if you want access to the direction, you can add it to the pageParam + +###### meta + +`Record`\<`string`, `unknown`\> \| `undefined` + +###### pageParam? + +`unknown` + +###### queryKey + +`NoInfer`\<`TQueryKey`\> + +###### signal + +`AbortSignal` + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`TQueryFnData` \| `Promise`\<`TQueryFnData`\> + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`persister`](QueryObserverOptions.md#persister) + +*** + +### placeholderData? + +```ts +optional placeholderData: + | NonFunctionGuard +| PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:292 + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`placeholderData`](QueryObserverOptions.md#placeholderdata) + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:128 + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryFn`](QueryObserverOptions.md#queryfn) + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:138 + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryHash`](QueryObserverOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:147 + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKey`](QueryObserverOptions.md#querykey) + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:151 + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKeyHashFn`](QueryObserverOptions.md#querykeyhashfn) + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:224 + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchInterval`](QueryObserverOptions.md#refetchinterval) + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:229 + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:253 + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnMount`](QueryObserverOptions.md#refetchonmount) + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:245 + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnReconnect`](QueryObserverOptions.md#refetchonreconnect) + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:237 + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnWindowFocus`](QueryObserverOptions.md#refetchonwindowfocus) + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:94 + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retry`](QueryObserverOptions.md#retry) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:104 + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:259 + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryOnMount`](QueryObserverOptions.md#retryonmount) + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:282 + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`select`](QueryObserverOptions.md#select) + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:218 + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`staleTime`](QueryObserverOptions.md#staletime) + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:172 + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`structuralSharing`](QueryObserverOptions.md#structuralsharing) + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:288 + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`suspense`](QueryObserverOptions.md#suspense) + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:275 + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`throwOnError`](QueryObserverOptions.md#throwonerror) diff --git a/docs/framework/angular/reference/interfaces/CreateInfiniteQueryOptions.md b/docs/framework/angular/reference/interfaces/CreateInfiniteQueryOptions.md index 5dba1476e96..48d73849f28 100644 --- a/docs/framework/angular/reference/interfaces/CreateInfiniteQueryOptions.md +++ b/docs/framework/angular/reference/interfaces/CreateInfiniteQueryOptions.md @@ -3,16 +3,16 @@ id: CreateInfiniteQueryOptions title: CreateInfiniteQueryOptions --- -Defined in: [types.ts:121](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L121) +Defined in: [packages/angular-query-experimental/src/types.ts:121](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L121) The options accepted by `injectInfiniteQuery`. Same as [CreateBaseQueryOptions](CreateBaseQueryOptions.md), minus `suspense` — which `angular-query-experimental` doesn't support, unlike `react-query` — extends -InfiniteQueryObserverOptions from `@tanstack/query-core` for the infinite-query-specific options +[InfiniteQueryObserverOptions](InfiniteQueryObserverOptions.md) from `@tanstack/query-core` for the infinite-query-specific options (`getNextPageParam`, `initialPageParam`, etc.). ## Extends -- `OmitKeyof`\<`InfiniteQueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"suspense"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"suspense"`\> ## Type Parameters @@ -24,7 +24,7 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. @@ -38,7 +38,7 @@ when no `select` is used. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. @@ -47,3 +47,602 @@ The type of your `queryKey`. `TPageParam` = `unknown` The type of the parameter passed to `queryFn` to fetch a given page. + +## Properties + +### enabled? + +```ts +optional enabled: QueryBooleanOption, TQueryKey>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:210 + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.enabled +``` + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:120 + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`gcTime`](QueryOptions.md#gctime) + +*** + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:200 + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +#### Inherited from + +```ts +OmitKeyof.getNextPageParam +``` + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:195 + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +#### Inherited from + +```ts +OmitKeyof.getPreviousPageParam +``` + +*** + +### initialData? + +```ts +optional initialData: + | InfiniteData +| InitialDataFunction>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:160 + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +OmitKeyof.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:164 + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +OmitKeyof.initialDataUpdatedAt +``` + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:188 + +#### Inherited from + +```ts +OmitKeyof.initialPageParam +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:185 + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`maxPages`](QueryOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:181 + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`meta`](QueryOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:109 + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`networkMode`](QueryOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:267 + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:133 + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +OmitKeyof.persister +``` + +*** + +### placeholderData? + +```ts +optional placeholderData: + | InfiniteData +| PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:292 + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +```ts +OmitKeyof.placeholderData +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:128 + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +OmitKeyof.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:138 + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`queryHash`](QueryOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:147 + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +OmitKeyof.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:151 + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +OmitKeyof.queryKeyHashFn +``` + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:224 + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchInterval +``` + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:229 + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:253 + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnMount +``` + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:245 + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnReconnect +``` + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:237 + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnWindowFocus +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:94 + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:104 + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption, TQueryKey>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:259 + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.retryOnMount +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:282 + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +[`InfiniteData`](InfiniteData.md) + +#### Returns + +`TData` + +#### Inherited from + +```ts +OmitKeyof.select +``` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction, TQueryKey>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:218 + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +```ts +OmitKeyof.staleTime +``` + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:172 + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.structuralSharing +``` + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError, TQueryKey>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:275 + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.throwOnError +``` diff --git a/docs/framework/angular/reference/interfaces/CreateMutationOptions.md b/docs/framework/angular/reference/interfaces/CreateMutationOptions.md index 91bfca38e06..89b74ef20af 100644 --- a/docs/framework/angular/reference/interfaces/CreateMutationOptions.md +++ b/docs/framework/angular/reference/interfaces/CreateMutationOptions.md @@ -3,14 +3,14 @@ id: CreateMutationOptions title: CreateMutationOptions --- -Defined in: [types.ts:224](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L224) +Defined in: [packages/angular-query-experimental/src/types.ts:224](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L224) -The options accepted by `injectMutation`. Same as MutationObserverOptions from +The options accepted by `injectMutation`. Same as [MutationObserverOptions](MutationObserverOptions.md) from `@tanstack/query-core`, minus the internal `_defaulted` flag. ## Extends -- `OmitKeyof`\<`MutationObserverOptions`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"_defaulted"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"_defaulted"`\> ## Type Parameters @@ -22,7 +22,7 @@ The type your mutation function resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your mutation function may throw. @@ -38,3 +38,285 @@ The type of the variable passed to `mutate`/`mutateAsync`. The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as their `onMutateResult` parameter — useful for optimistic-update rollback data. + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:722 + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`gcTime`](MutationOptions.md#gctime) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:725 + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`meta`](MutationOptions.md#meta) + +*** + +### mutationFn? + +```ts +optional mutationFn: MutationFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:713 + +#### Inherited from + +```ts +OmitKeyof.mutationFn +``` + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:714 + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`mutationKey`](MutationOptions.md#mutationkey) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:721 + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`networkMode`](MutationOptions.md#networkmode) + +*** + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:717 + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +OmitKeyof.onError +``` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, context) => TOnMutateResult | Promise; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:715 + +#### Parameters + +##### variables + +`TVariables` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`TOnMutateResult` \| `Promise`\<`TOnMutateResult`\> + +#### Inherited from + +```ts +OmitKeyof.onMutate +``` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:718 + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +OmitKeyof.onSettled +``` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:716 + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +OmitKeyof.onSuccess +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:719 + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:720 + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### scope? + +```ts +optional scope: MutationScope; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:726 + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`scope`](MutationOptions.md#scope) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean | (error) => boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:729 + +#### Inherited from + +```ts +OmitKeyof.throwOnError +``` diff --git a/docs/framework/angular/reference/interfaces/CreateQueryOptions.md b/docs/framework/angular/reference/interfaces/CreateQueryOptions.md index 52a56d7e8fb..0ba1e95f964 100644 --- a/docs/framework/angular/reference/interfaces/CreateQueryOptions.md +++ b/docs/framework/angular/reference/interfaces/CreateQueryOptions.md @@ -3,14 +3,14 @@ id: CreateQueryOptions title: CreateQueryOptions --- -Defined in: [types.ts:58](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L58) +Defined in: [packages/angular-query-experimental/src/types.ts:58](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L58) The options accepted by `injectQuery`. Same as [CreateBaseQueryOptions](CreateBaseQueryOptions.md), minus `suspense` — which `angular-query-experimental` doesn't support, unlike `react-query`. ## Extends -- `OmitKeyof`\<[`CreateBaseQueryOptions`](CreateBaseQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryFnData`, `TQueryKey`\>, `"suspense"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`CreateBaseQueryOptions`](CreateBaseQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryFnData`, `TQueryKey`\>, `"suspense"`\> ## Type Parameters @@ -22,7 +22,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. @@ -35,6 +35,595 @@ The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` when ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. + +## Properties + +### enabled? + +```ts +optional enabled: QueryBooleanOption; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:210 + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.enabled +``` + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:120 + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`gcTime`](QueryOptions.md#gctime) + +*** + +### initialData? + +```ts +optional initialData: + | TQueryFnData +| InitialDataFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:160 + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +OmitKeyof.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:164 + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +OmitKeyof.initialDataUpdatedAt +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:185 + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`maxPages`](QueryOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:181 + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`meta`](QueryOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:109 + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`networkMode`](QueryOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:267 + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister()? + +```ts +optional persister: (queryFn, context, query) => TQueryFnData | Promise; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:133 + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Parameters + +##### queryFn + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TQueryFnData`, `NoInfer`\<`TQueryKey`\>, `never`\> + +##### context + +###### client + +[`QueryClient`](../classes/QueryClient.md) + +###### direction? + +`unknown` + +**Deprecated** + +if you want access to the direction, you can add it to the pageParam + +###### meta + +`Record`\<`string`, `unknown`\> \| `undefined` + +###### pageParam? + +`unknown` + +###### queryKey + +`NoInfer`\<`TQueryKey`\> + +###### signal + +`AbortSignal` + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`TQueryFnData` \| `Promise`\<`TQueryFnData`\> + +#### Inherited from + +```ts +OmitKeyof.persister +``` + +*** + +### placeholderData? + +```ts +optional placeholderData: + | NonFunctionGuard +| PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:292 + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +```ts +OmitKeyof.placeholderData +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:128 + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +OmitKeyof.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:138 + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`queryHash`](QueryOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:147 + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +OmitKeyof.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:151 + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +OmitKeyof.queryKeyHashFn +``` + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:224 + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchInterval +``` + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:229 + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:253 + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnMount +``` + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:245 + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnReconnect +``` + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:237 + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnWindowFocus +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:94 + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:104 + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:259 + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.retryOnMount +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:282 + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryFnData` + +#### Returns + +`TData` + +#### Inherited from + +```ts +OmitKeyof.select +``` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:218 + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +```ts +OmitKeyof.staleTime +``` + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:172 + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.structuralSharing +``` + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:275 + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.throwOnError +``` diff --git a/docs/framework/angular/reference/interfaces/DefaultOptions.md b/docs/framework/angular/reference/interfaces/DefaultOptions.md new file mode 100644 index 00000000000..838ffd51fab --- /dev/null +++ b/docs/framework/angular/reference/interfaces/DefaultOptions.md @@ -0,0 +1,76 @@ +--- +id: DefaultOptions +title: DefaultOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:849 + +## Type Parameters + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### dehydrate? + +```ts +optional dehydrate: DehydrateOptions; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:853 + +*** + +### hydrate? + +```ts +optional hydrate: object; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:852 + +#### deserializeData? + +```ts +optional deserializeData: TransformerFn; +``` + +Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. + +#### mutations? + +```ts +optional mutations: MutationOptions; +``` + +Default options merged into every mutation restored from the dehydrated state. + +#### queries? + +```ts +optional queries: QueryOptions; +``` + +Default options merged into every query restored from the dehydrated state. + +*** + +### mutations? + +```ts +optional mutations: MutationObserverOptions; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:851 + +*** + +### queries? + +```ts +optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:850 diff --git a/docs/framework/angular/reference/interfaces/DehydrateOptions.md b/docs/framework/angular/reference/interfaces/DehydrateOptions.md new file mode 100644 index 00000000000..c822f2a2d8d --- /dev/null +++ b/docs/framework/angular/reference/interfaces/DehydrateOptions.md @@ -0,0 +1,89 @@ +--- +id: DehydrateOptions +title: DehydrateOptions +--- + +Defined in: packages/query-core/dist-ts/src/hydration.d.ts:10 + +Options for `dehydrate`, controlling which queries/mutations are included in the resulting `DehydratedState` and +how their data/errors are transformed before being serialized (e.g. for embedding in server-rendered markup). + +## Properties + +### serializeData? + +```ts +optional serializeData: TransformerFn; +``` + +Defined in: packages/query-core/dist-ts/src/hydration.d.ts:12 + +Transforms a query's `data` before it is dehydrated. Useful for non-JSON-serializable data. + +*** + +### shouldDehydrateMutation()? + +```ts +optional shouldDehydrateMutation: (mutation) => boolean; +``` + +Defined in: packages/query-core/dist-ts/src/hydration.d.ts:14 + +Predicate to decide whether a given `Mutation` should be dehydrated. Defaults to `defaultShouldDehydrateMutation`. + +#### Parameters + +##### mutation + +[`Mutation`](../classes/Mutation.md) + +#### Returns + +`boolean` + +*** + +### shouldDehydrateQuery()? + +```ts +optional shouldDehydrateQuery: (query) => boolean; +``` + +Defined in: packages/query-core/dist-ts/src/hydration.d.ts:16 + +Predicate to decide whether a given `Query` should be dehydrated. Defaults to `defaultShouldDehydrateQuery`. + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +*** + +### shouldRedactErrors()? + +```ts +optional shouldRedactErrors: (error) => boolean; +``` + +Defined in: packages/query-core/dist-ts/src/hydration.d.ts:22 + +Predicate to decide whether a query's error should be redacted before dehydration. Errors are redacted +(replaced with a generic `Error('redacted')`) unless this function is provided and returns `false` for the +given error, in which case the original error is kept. + +#### Parameters + +##### error + +`unknown` + +#### Returns + +`boolean` diff --git a/docs/framework/angular/reference/interfaces/DehydratedState.md b/docs/framework/angular/reference/interfaces/DehydratedState.md new file mode 100644 index 00000000000..13481944cad --- /dev/null +++ b/docs/framework/angular/reference/interfaces/DehydratedState.md @@ -0,0 +1,30 @@ +--- +id: DehydratedState +title: DehydratedState +--- + +Defined in: packages/query-core/dist-ts/src/hydration.d.ts:58 + +A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically +transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data +that has already been fetched, avoiding a redundant fetch on the client. + +## Properties + +### mutations + +```ts +mutations: DehydratedMutation[]; +``` + +Defined in: packages/query-core/dist-ts/src/hydration.d.ts:59 + +*** + +### queries + +```ts +queries: DehydratedQuery[]; +``` + +Defined in: packages/query-core/dist-ts/src/hydration.d.ts:60 diff --git a/docs/framework/angular/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/angular/reference/interfaces/EnsureQueryDataOptions.md new file mode 100644 index 00000000000..454919d1933 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/EnsureQueryDataOptions.md @@ -0,0 +1,343 @@ +--- +id: EnsureQueryDataOptions +title: EnsureQueryDataOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:322 + +## Deprecated + +## Extends + +- [`FetchQueryOptions`](FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### ~~gcTime?~~ + +```ts +optional gcTime: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:120 + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`gcTime`](FetchQueryOptions.md#gctime) + +*** + +### ~~initialData?~~ + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:160 + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialData`](FetchQueryOptions.md#initialdata) + +*** + +### ~~initialDataUpdatedAt?~~ + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:164 + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialDataUpdatedAt`](FetchQueryOptions.md#initialdataupdatedat) + +*** + +### ~~initialPageParam?~~ + +```ts +optional initialPageParam: undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:314 + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialPageParam`](FetchQueryOptions.md#initialpageparam) + +*** + +### ~~maxPages?~~ + +```ts +optional maxPages: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:185 + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`maxPages`](FetchQueryOptions.md#maxpages) + +*** + +### ~~meta?~~ + +```ts +optional meta: Record; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:181 + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`meta`](FetchQueryOptions.md#meta) + +*** + +### ~~networkMode?~~ + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:109 + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`networkMode`](FetchQueryOptions.md#networkmode) + +*** + +### ~~persister?~~ + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:133 + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`persister`](FetchQueryOptions.md#persister) + +*** + +### ~~queryFn?~~ + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:128 + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryFn`](FetchQueryOptions.md#queryfn) + +*** + +### ~~queryHash?~~ + +```ts +optional queryHash: string; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:138 + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryHash`](FetchQueryOptions.md#queryhash) + +*** + +### ~~queryKey~~ + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:147 + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryKey`](FetchQueryOptions.md#querykey) + +*** + +### ~~queryKeyHashFn?~~ + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:151 + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryKeyHashFn`](FetchQueryOptions.md#querykeyhashfn) + +*** + +### ~~retry?~~ + +```ts +optional retry: RetryValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:94 + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`retry`](FetchQueryOptions.md#retry) + +*** + +### ~~retryDelay?~~ + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:104 + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`retryDelay`](FetchQueryOptions.md#retrydelay) + +*** + +### ~~revalidateIfStale?~~ + +```ts +optional revalidateIfStale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:323 + +*** + +### ~~staleTime?~~ + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:319 + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`staleTime`](FetchQueryOptions.md#staletime) + +*** + +### ~~structuralSharing?~~ + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:172 + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`structuralSharing`](FetchQueryOptions.md#structuralsharing) diff --git a/docs/framework/angular/reference/interfaces/FetchNextPageOptions.md b/docs/framework/angular/reference/interfaces/FetchNextPageOptions.md new file mode 100644 index 00000000000..bd3ec3d10f9 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/FetchNextPageOptions.md @@ -0,0 +1,41 @@ +--- +id: FetchNextPageOptions +title: FetchNextPageOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:360 + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:369 + +If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, +whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + +If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:339 + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/angular/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/angular/reference/interfaces/FetchPreviousPageOptions.md new file mode 100644 index 00000000000..6be5afcbd0d --- /dev/null +++ b/docs/framework/angular/reference/interfaces/FetchPreviousPageOptions.md @@ -0,0 +1,41 @@ +--- +id: FetchPreviousPageOptions +title: FetchPreviousPageOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:371 + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:380 + +If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, +whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + +If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:339 + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/angular/reference/interfaces/FetchQueryOptions.md b/docs/framework/angular/reference/interfaces/FetchQueryOptions.md new file mode 100644 index 00000000000..9cf06e5ddae --- /dev/null +++ b/docs/framework/angular/reference/interfaces/FetchQueryOptions.md @@ -0,0 +1,357 @@ +--- +id: FetchQueryOptions +title: FetchQueryOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:313 + +## Deprecated + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Extended by + +- [`EnsureQueryDataOptions`](EnsureQueryDataOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### ~~gcTime?~~ + +```ts +optional gcTime: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:120 + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### ~~initialData?~~ + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:160 + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### ~~initialDataUpdatedAt?~~ + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:164 + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### ~~initialPageParam?~~ + +```ts +optional initialPageParam: undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:314 + +*** + +### ~~maxPages?~~ + +```ts +optional maxPages: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:185 + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### ~~meta?~~ + +```ts +optional meta: Record; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:181 + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### ~~networkMode?~~ + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:109 + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### ~~persister?~~ + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:133 + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### ~~queryFn?~~ + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:128 + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### ~~queryHash?~~ + +```ts +optional queryHash: string; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:138 + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### ~~queryKey~~ + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:147 + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### ~~queryKeyHashFn?~~ + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:151 + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### ~~retry?~~ + +```ts +optional retry: RetryValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:94 + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### ~~retryDelay?~~ + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:104 + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### ~~staleTime?~~ + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:319 + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +*** + +### ~~structuralSharing?~~ + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:172 + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` diff --git a/docs/framework/angular/reference/interfaces/HydrateOptions.md b/docs/framework/angular/reference/interfaces/HydrateOptions.md new file mode 100644 index 00000000000..85bcf407685 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/HydrateOptions.md @@ -0,0 +1,43 @@ +--- +id: HydrateOptions +title: HydrateOptions +--- + +Defined in: packages/query-core/dist-ts/src/hydration.d.ts:28 + +Options for `hydrate`, controlling the default options applied to queries/mutations restored from a +`DehydratedState`, and how to reverse any transformation applied by `DehydrateOptions.serializeData`. + +## Properties + +### defaultOptions? + +```ts +optional defaultOptions: object; +``` + +Defined in: packages/query-core/dist-ts/src/hydration.d.ts:29 + +#### deserializeData? + +```ts +optional deserializeData: TransformerFn; +``` + +Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. + +#### mutations? + +```ts +optional mutations: MutationOptions; +``` + +Default options merged into every mutation restored from the dehydrated state. + +#### queries? + +```ts +optional queries: QueryOptions; +``` + +Default options merged into every query restored from the dehydrated state. diff --git a/docs/framework/angular/reference/interfaces/InfiniteData.md b/docs/framework/angular/reference/interfaces/InfiniteData.md new file mode 100644 index 00000000000..cb30e058677 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/InfiniteData.md @@ -0,0 +1,36 @@ +--- +id: InfiniteData +title: InfiniteData +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:77 + +## Type Parameters + +### TData + +`TData` + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### pageParams + +```ts +pageParams: TPageParam[]; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:79 + +*** + +### pages + +```ts +pages: TData[]; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:78 diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult.md new file mode 100644 index 00000000000..2b4204d11b2 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -0,0 +1,577 @@ +--- +id: InfiniteQueryObserverBaseResult +title: InfiniteQueryObserverBaseResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:579 + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Extended by + +- [`InfiniteQueryObserverPendingResult`](InfiniteQueryObserverPendingResult.md) +- [`InfiniteQueryObserverLoadingResult`](InfiniteQueryObserverLoadingResult.md) +- [`InfiniteQueryObserverLoadingErrorResult`](InfiniteQueryObserverLoadingErrorResult.md) +- [`InfiniteQueryObserverRefetchErrorResult`](InfiniteQueryObserverRefetchErrorResult.md) +- [`InfiniteQueryObserverSuccessResult`](InfiniteQueryObserverSuccessResult.md) +- [`InfiniteQueryObserverPlaceholderResult`](InfiniteQueryObserverPlaceholderResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:388 + +The last successfully resolved data for the query. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:392 + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:397 + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:416 + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:401 + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:407 + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:412 + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:583 + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:587 + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:504 + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:591 + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:595 + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:421 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:430 + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:435 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:603 + +Will be `true` while fetching the next page with `fetchNextPage`. + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:611 + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:599 + +Will be `true` if the query failed while fetching the next page. + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:607 + +Will be `true` if the query failed while fetching the previous page. + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:440 + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:448 + +Will be `true` if the query failed while fetching for the first time. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:458 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:444 + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:462 + +Will be `true` if the data shown is the placeholder data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:466 + +Will be `true` if the query failed while refetching. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:475 + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:480 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:496 + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md new file mode 100644 index 00000000000..956726e7728 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverLoadingErrorResult +title: InfiniteQueryObserverLoadingErrorResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:640 + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:641 + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:392 + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:642 + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:416 + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:401 + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:407 + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:412 + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:583 + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:587 + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:504 + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:591 + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:595 + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:643 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:430 + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:435 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:603 + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:611 + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:648 + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:649 + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:645 + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:646 + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:458 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:644 + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:651 + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:647 + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:475 + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:650 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:652 + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult.md new file mode 100644 index 00000000000..d6520e425d0 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverLoadingResult +title: InfiniteQueryObserverLoadingResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:626 + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:627 + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:392 + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:628 + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:416 + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:401 + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:407 + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:412 + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:583 + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:587 + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:504 + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:591 + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:595 + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:629 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:430 + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:435 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:603 + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:611 + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:634 + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:635 + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:631 + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:632 + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:458 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:630 + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:637 + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:633 + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:475 + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:636 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:638 + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverOptions.md new file mode 100644 index 00000000000..e681041e19f --- /dev/null +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverOptions.md @@ -0,0 +1,605 @@ +--- +id: InfiniteQueryObserverOptions +title: InfiniteQueryObserverOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:300 + +## Extends + +- [`QueryObserverOptions`](QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`, `TPageParam`\>.[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md)\<`TQueryFnData`, `TPageParam`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### enabled? + +```ts +optional enabled: QueryBooleanOption, TQueryKey>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:210 + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`enabled`](QueryObserverOptions.md#enabled) + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:120 + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`gcTime`](QueryObserverOptions.md#gctime) + +*** + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:200 + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`getNextPageParam`](InfiniteQueryPageParamsOptions.md#getnextpageparam) + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:195 + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`getPreviousPageParam`](InfiniteQueryPageParamsOptions.md#getpreviouspageparam) + +*** + +### initialData? + +```ts +optional initialData: + | InfiniteData +| InitialDataFunction>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:160 + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialData`](QueryObserverOptions.md#initialdata) + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:164 + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialDataUpdatedAt`](QueryObserverOptions.md#initialdataupdatedat) + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:188 + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`initialPageParam`](InfiniteQueryPageParamsOptions.md#initialpageparam) + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:185 + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`maxPages`](QueryObserverOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:181 + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`meta`](QueryObserverOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:109 + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`networkMode`](QueryObserverOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:267 + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:133 + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`persister`](QueryObserverOptions.md#persister) + +*** + +### placeholderData? + +```ts +optional placeholderData: + | InfiniteData +| PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:292 + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`placeholderData`](QueryObserverOptions.md#placeholderdata) + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:128 + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryFn`](QueryObserverOptions.md#queryfn) + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:138 + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryHash`](QueryObserverOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:147 + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKey`](QueryObserverOptions.md#querykey) + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:151 + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKeyHashFn`](QueryObserverOptions.md#querykeyhashfn) + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:224 + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchInterval`](QueryObserverOptions.md#refetchinterval) + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:229 + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:253 + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnMount`](QueryObserverOptions.md#refetchonmount) + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:245 + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnReconnect`](QueryObserverOptions.md#refetchonreconnect) + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:237 + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnWindowFocus`](QueryObserverOptions.md#refetchonwindowfocus) + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:94 + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retry`](QueryObserverOptions.md#retry) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:104 + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption, TQueryKey>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:259 + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryOnMount`](QueryObserverOptions.md#retryonmount) + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:282 + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +[`InfiniteData`](InfiniteData.md) + +#### Returns + +`TData` + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`select`](QueryObserverOptions.md#select) + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction, TQueryKey>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:218 + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`staleTime`](QueryObserverOptions.md#staletime) + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:172 + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`structuralSharing`](QueryObserverOptions.md#structuralsharing) + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:288 + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`suspense`](QueryObserverOptions.md#suspense) + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError, TQueryKey>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:275 + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`throwOnError`](QueryObserverOptions.md#throwonerror) diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult.md new file mode 100644 index 00000000000..71b2ad1203c --- /dev/null +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverPendingResult +title: InfiniteQueryObserverPendingResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:613 + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:614 + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:392 + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:615 + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:416 + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:401 + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:407 + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:412 + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:583 + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:587 + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:504 + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:591 + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:595 + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:616 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:430 + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:435 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:603 + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:611 + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:620 + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:621 + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:440 + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:618 + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:458 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:617 + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:623 + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:619 + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:475 + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:622 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:624 + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md new file mode 100644 index 00000000000..d9fea0e9b28 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverPlaceholderResult +title: InfiniteQueryObserverPlaceholderResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:680 + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:681 + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:392 + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:683 + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:416 + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:401 + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:407 + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:412 + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:583 + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:587 + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:504 + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:591 + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:595 + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:682 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:430 + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:435 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:603 + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:611 + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:690 + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:691 + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:685 + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:686 + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:458 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:684 + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:689 + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:687 + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:475 + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:688 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:692 + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md new file mode 100644 index 00000000000..64b206abc12 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverRefetchErrorResult +title: InfiniteQueryObserverRefetchErrorResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:654 + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:655 + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:392 + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:656 + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:416 + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:401 + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:407 + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:412 + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:583 + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:587 + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:504 + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:591 + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:595 + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:657 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:430 + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:435 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:603 + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:611 + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:599 + +Will be `true` if the query failed while fetching the next page. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:607 + +Will be `true` if the query failed while fetching the previous page. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:659 + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:660 + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:458 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:658 + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:663 + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:661 + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:475 + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:662 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:664 + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult.md new file mode 100644 index 00000000000..4753b83e279 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverSuccessResult +title: InfiniteQueryObserverSuccessResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:666 + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:667 + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:392 + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:668 + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:416 + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:401 + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:407 + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:412 + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:583 + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:587 + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:504 + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:591 + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:595 + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:669 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:430 + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:435 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:603 + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:611 + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:674 + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:675 + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:671 + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:672 + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:458 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:670 + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:677 + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:673 + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:475 + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:676 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:678 + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/angular/reference/interfaces/InfiniteQueryPageParamsOptions.md new file mode 100644 index 00000000000..06590765c43 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -0,0 +1,64 @@ +--- +id: InfiniteQueryPageParamsOptions +title: InfiniteQueryPageParamsOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:190 + +## Extends + +- [`InitialPageParam`](InitialPageParam.md)\<`TPageParam`\> + +## Extended by + +- [`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:200 + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:195 + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:188 + +#### Inherited from + +[`InitialPageParam`](InitialPageParam.md).[`initialPageParam`](InitialPageParam.md#initialpageparam) diff --git a/docs/framework/angular/reference/interfaces/InitialPageParam.md b/docs/framework/angular/reference/interfaces/InitialPageParam.md new file mode 100644 index 00000000000..66e3e97f9f1 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/InitialPageParam.md @@ -0,0 +1,26 @@ +--- +id: InitialPageParam +title: InitialPageParam +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:187 + +## Extended by + +- [`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md) + +## Type Parameters + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:188 diff --git a/docs/framework/angular/reference/interfaces/InjectInfiniteQueryOptions.md b/docs/framework/angular/reference/interfaces/InjectInfiniteQueryOptions.md index 0f1389379cc..a1f2d541d09 100644 --- a/docs/framework/angular/reference/interfaces/InjectInfiniteQueryOptions.md +++ b/docs/framework/angular/reference/interfaces/InjectInfiniteQueryOptions.md @@ -3,7 +3,7 @@ id: InjectInfiniteQueryOptions title: InjectInfiniteQueryOptions --- -Defined in: [inject-infinite-query.ts:25](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-infinite-query.ts#L25) +Defined in: [packages/angular-query-experimental/src/inject-infinite-query.ts:25](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-infinite-query.ts#L25) ## Properties @@ -13,7 +13,7 @@ Defined in: [inject-infinite-query.ts:25](https://github.com/TanStack/query/blob optional injector: Injector; ``` -Defined in: [inject-infinite-query.ts:31](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-infinite-query.ts#L31) +Defined in: [packages/angular-query-experimental/src/inject-infinite-query.ts:31](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-infinite-query.ts#L31) The `Injector` in which to create the infinite query. diff --git a/docs/framework/angular/reference/interfaces/InjectIsFetchingOptions.md b/docs/framework/angular/reference/interfaces/InjectIsFetchingOptions.md index 5fdd5353595..799b9a4498f 100644 --- a/docs/framework/angular/reference/interfaces/InjectIsFetchingOptions.md +++ b/docs/framework/angular/reference/interfaces/InjectIsFetchingOptions.md @@ -3,7 +3,7 @@ id: InjectIsFetchingOptions title: InjectIsFetchingOptions --- -Defined in: [inject-is-fetching.ts:13](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-fetching.ts#L13) +Defined in: [packages/angular-query-experimental/src/inject-is-fetching.ts:13](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-fetching.ts#L13) ## Properties @@ -13,7 +13,7 @@ Defined in: [inject-is-fetching.ts:13](https://github.com/TanStack/query/blob/ma optional injector: Injector; ``` -Defined in: [inject-is-fetching.ts:19](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-fetching.ts#L19) +Defined in: [packages/angular-query-experimental/src/inject-is-fetching.ts:19](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-fetching.ts#L19) The `Injector` in which to create the isFetching signal. diff --git a/docs/framework/angular/reference/interfaces/InjectIsMutatingOptions.md b/docs/framework/angular/reference/interfaces/InjectIsMutatingOptions.md index a76749f1724..344f84f0d9c 100644 --- a/docs/framework/angular/reference/interfaces/InjectIsMutatingOptions.md +++ b/docs/framework/angular/reference/interfaces/InjectIsMutatingOptions.md @@ -3,7 +3,7 @@ id: InjectIsMutatingOptions title: InjectIsMutatingOptions --- -Defined in: [inject-is-mutating.ts:13](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-mutating.ts#L13) +Defined in: [packages/angular-query-experimental/src/inject-is-mutating.ts:13](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-mutating.ts#L13) ## Properties @@ -13,7 +13,7 @@ Defined in: [inject-is-mutating.ts:13](https://github.com/TanStack/query/blob/ma optional injector: Injector; ``` -Defined in: [inject-is-mutating.ts:19](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-mutating.ts#L19) +Defined in: [packages/angular-query-experimental/src/inject-is-mutating.ts:19](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-mutating.ts#L19) The `Injector` in which to create the isMutating signal. diff --git a/docs/framework/angular/reference/interfaces/InjectMutationOptions.md b/docs/framework/angular/reference/interfaces/InjectMutationOptions.md index 893c8e0732f..8f012549d6c 100644 --- a/docs/framework/angular/reference/interfaces/InjectMutationOptions.md +++ b/docs/framework/angular/reference/interfaces/InjectMutationOptions.md @@ -3,7 +3,7 @@ id: InjectMutationOptions title: InjectMutationOptions --- -Defined in: [inject-mutation.ts:28](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-mutation.ts#L28) +Defined in: [packages/angular-query-experimental/src/inject-mutation.ts:28](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-mutation.ts#L28) ## Properties @@ -13,7 +13,7 @@ Defined in: [inject-mutation.ts:28](https://github.com/TanStack/query/blob/main/ optional injector: Injector; ``` -Defined in: [inject-mutation.ts:34](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-mutation.ts#L34) +Defined in: [packages/angular-query-experimental/src/inject-mutation.ts:34](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-mutation.ts#L34) The `Injector` in which to create the mutation. diff --git a/docs/framework/angular/reference/interfaces/InjectMutationStateOptions.md b/docs/framework/angular/reference/interfaces/InjectMutationStateOptions.md index 73b944e27da..8fe8ce53c0d 100644 --- a/docs/framework/angular/reference/interfaces/InjectMutationStateOptions.md +++ b/docs/framework/angular/reference/interfaces/InjectMutationStateOptions.md @@ -3,7 +3,7 @@ id: InjectMutationStateOptions title: InjectMutationStateOptions --- -Defined in: [inject-mutation-state.ts:40](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-mutation-state.ts#L40) +Defined in: [packages/angular-query-experimental/src/inject-mutation-state.ts:40](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-mutation-state.ts#L40) ## Properties @@ -13,7 +13,7 @@ Defined in: [inject-mutation-state.ts:40](https://github.com/TanStack/query/blob optional injector: Injector; ``` -Defined in: [inject-mutation-state.ts:46](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-mutation-state.ts#L46) +Defined in: [packages/angular-query-experimental/src/inject-mutation-state.ts:46](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-mutation-state.ts#L46) The `Injector` in which to create the mutation state signal. diff --git a/docs/framework/angular/reference/interfaces/InjectQueryOptions.md b/docs/framework/angular/reference/interfaces/InjectQueryOptions.md index c778d341dcc..418835acb0d 100644 --- a/docs/framework/angular/reference/interfaces/InjectQueryOptions.md +++ b/docs/framework/angular/reference/interfaces/InjectQueryOptions.md @@ -3,7 +3,7 @@ id: InjectQueryOptions title: InjectQueryOptions --- -Defined in: [inject-query.ts:20](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-query.ts#L20) +Defined in: [packages/angular-query-experimental/src/inject-query.ts:20](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-query.ts#L20) ## Properties @@ -13,7 +13,7 @@ Defined in: [inject-query.ts:20](https://github.com/TanStack/query/blob/main/pac optional injector: Injector; ``` -Defined in: [inject-query.ts:26](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-query.ts#L26) +Defined in: [packages/angular-query-experimental/src/inject-query.ts:26](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-query.ts#L26) The `Injector` in which to create the query. diff --git a/docs/framework/angular/reference/interfaces/InvalidateOptions.md b/docs/framework/angular/reference/interfaces/InvalidateOptions.md new file mode 100644 index 00000000000..b9379fc841d --- /dev/null +++ b/docs/framework/angular/reference/interfaces/InvalidateOptions.md @@ -0,0 +1,44 @@ +--- +id: InvalidateOptions +title: InvalidateOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:356 + +## Extends + +- [`RefetchOptions`](RefetchOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:349 + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`cancelRefetch`](RefetchOptions.md#cancelrefetch) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:339 + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`throwOnError`](RefetchOptions.md#throwonerror) diff --git a/docs/framework/angular/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/angular/reference/interfaces/InvalidateQueryFilters.md new file mode 100644 index 00000000000..098a8172342 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/InvalidateQueryFilters.md @@ -0,0 +1,135 @@ +--- +id: InvalidateQueryFilters +title: InvalidateQueryFilters +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:351 + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extends + +- [`QueryFilters`](QueryFilters.md)\<`TQueryKey`\> + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:21 + +Match query key exactly + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`exact`](QueryFilters.md#exact) + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:37 + +Include queries matching their fetchStatus + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`fetchStatus`](QueryFilters.md#fetchstatus) + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:25 + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`predicate`](QueryFilters.md#predicate) + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:29 + +Include queries matching this query key + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`queryKey`](QueryFilters.md#querykey) + +*** + +### refetchType? + +```ts +optional refetchType: QueryTypeFilter | "none"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:352 + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:33 + +Include or exclude stale queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`stale`](QueryFilters.md#stale) + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:17 + +Filter to active queries, inactive queries or all queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/angular/reference/interfaces/MutateOptions.md b/docs/framework/angular/reference/interfaces/MutateOptions.md new file mode 100644 index 00000000000..eecdf77cdff --- /dev/null +++ b/docs/framework/angular/reference/interfaces/MutateOptions.md @@ -0,0 +1,124 @@ +--- +id: MutateOptions +title: MutateOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:731 + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => void; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:733 + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => void; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:734 + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => void; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:732 + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` diff --git a/docs/framework/angular/reference/interfaces/MutationCacheConfig.md b/docs/framework/angular/reference/interfaces/MutationCacheConfig.md new file mode 100644 index 00000000000..9834d8b1fd0 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/MutationCacheConfig.md @@ -0,0 +1,161 @@ +--- +id: MutationCacheConfig +title: MutationCacheConfig +--- + +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:16 + +Global callbacks that fire for every mutation handled by a `MutationCache`, regardless of which +component or observer triggered it. They differ from the `defaultOptions` provided to a +`QueryClient` in two ways: `defaultOptions` can be overridden by each mutation, while these +callbacks are always called, and `onMutate` here does not allow returning a result. + +If a callback returns a promise, it will be awaited before the mutation continues. + +## Properties + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:18 + +Called when any mutation in the cache encounters an error. + +#### Parameters + +##### error + +`Error` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, mutation, context) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:22 + +Called before any mutation in the cache executes. + +#### Parameters + +##### variables + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:24 + +Called when any mutation in the cache is settled, either successfully or with an error. + +#### Parameters + +##### data + +`unknown` + +##### error + +`Error` | `null` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:20 + +Called when any mutation in the cache is successful. + +#### Parameters + +##### data + +`unknown` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` diff --git a/docs/framework/angular/reference/interfaces/MutationFilters.md b/docs/framework/angular/reference/interfaces/MutationFilters.md new file mode 100644 index 00000000000..e4a6959ffbf --- /dev/null +++ b/docs/framework/angular/reference/interfaces/MutationFilters.md @@ -0,0 +1,85 @@ +--- +id: MutationFilters +title: MutationFilters +--- + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:43 + +Filters used to select mutations, for example in `mutationCache.findAll` or `queryClient.isMutating`. +All provided filters must match; filters that are left unspecified are ignored. + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:47 + +Match mutation key exactly + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:55 + +Include mutations matching this mutation key + +*** + +### predicate()? + +```ts +optional predicate: (mutation) => boolean; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:51 + +Include mutations matching this predicate function + +#### Parameters + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`boolean` + +*** + +### status? + +```ts +optional status: MutationStatus; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:59 + +Filter by mutation status diff --git a/docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md new file mode 100644 index 00000000000..d9599c54af6 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md @@ -0,0 +1,291 @@ +--- +id: MutationObserverBaseResult +title: MutationObserverBaseResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:744 + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationState`](MutationState.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Extended by + +- [`MutationObserverIdleResult`](MutationObserverIdleResult.md) +- [`MutationObserverLoadingResult`](MutationObserverLoadingResult.md) +- [`MutationObserverErrorResult`](MutationObserverErrorResult.md) +- [`MutationObserverSuccessResult`](MutationObserverSuccessResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:22 + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationState`](MutationState.md).[`context`](MutationState.md#context) + +*** + +### data + +```ts +data: TData | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:748 + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationState`](MutationState.md).[`data`](MutationState.md#data) + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:757 + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationState`](MutationState.md).[`error`](MutationState.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:35 + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationState`](MutationState.md).[`failureCount`](MutationState.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:39 + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationState`](MutationState.md).[`failureReason`](MutationState.md#failurereason) + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:762 + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +*** + +### isIdle + +```ts +isIdle: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:767 + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:44 + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationState`](MutationState.md).[`isPaused`](MutationState.md#ispaused) + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:772 + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:777 + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:797 + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:801 + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +*** + +### status + +```ts +status: MutationStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:786 + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationState`](MutationState.md).[`status`](MutationState.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:56 + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationState`](MutationState.md).[`submittedAt`](MutationState.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:752 + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationState`](MutationState.md).[`variables`](MutationState.md#variables) diff --git a/docs/framework/angular/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/angular/reference/interfaces/MutationObserverErrorResult.md new file mode 100644 index 00000000000..bd010e5549e --- /dev/null +++ b/docs/framework/angular/reference/interfaces/MutationObserverErrorResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverErrorResult +title: MutationObserverErrorResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:823 + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:22 + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:824 + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:825 + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:35 + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:39 + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:827 + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:828 + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:44 + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:829 + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:830 + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:797 + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:801 + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:831 + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:56 + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:826 + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/angular/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/angular/reference/interfaces/MutationObserverIdleResult.md new file mode 100644 index 00000000000..5e7fbd3253a --- /dev/null +++ b/docs/framework/angular/reference/interfaces/MutationObserverIdleResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverIdleResult +title: MutationObserverIdleResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:803 + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:22 + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:804 + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:806 + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:35 + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:39 + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:807 + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:808 + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:44 + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:809 + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:810 + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:797 + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:801 + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "idle"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:811 + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:56 + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:805 + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/angular/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/angular/reference/interfaces/MutationObserverLoadingResult.md new file mode 100644 index 00000000000..a56fe5fcc80 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/MutationObserverLoadingResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverLoadingResult +title: MutationObserverLoadingResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:813 + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:22 + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:814 + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:816 + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:35 + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:39 + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:817 + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:818 + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:44 + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:819 + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:820 + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:797 + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:801 + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:821 + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:56 + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:815 + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/angular/reference/interfaces/MutationObserverOptions.md b/docs/framework/angular/reference/interfaces/MutationObserverOptions.md new file mode 100644 index 00000000000..09b360cc3a5 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/MutationObserverOptions.md @@ -0,0 +1,290 @@ +--- +id: MutationObserverOptions +title: MutationObserverOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:728 + +## Extends + +- [`MutationOptions`](MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:722 + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`gcTime`](MutationOptions.md#gctime) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:725 + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`meta`](MutationOptions.md#meta) + +*** + +### mutationFn? + +```ts +optional mutationFn: MutationFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:713 + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`mutationFn`](MutationOptions.md#mutationfn) + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:714 + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`mutationKey`](MutationOptions.md#mutationkey) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:721 + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`networkMode`](MutationOptions.md#networkmode) + +*** + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:717 + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onError`](MutationOptions.md#onerror) + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, context) => TOnMutateResult | Promise; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:715 + +#### Parameters + +##### variables + +`TVariables` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`TOnMutateResult` \| `Promise`\<`TOnMutateResult`\> + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onMutate`](MutationOptions.md#onmutate) + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:718 + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onSettled`](MutationOptions.md#onsettled) + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:716 + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onSuccess`](MutationOptions.md#onsuccess) + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:719 + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`retry`](MutationOptions.md#retry) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:720 + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`retryDelay`](MutationOptions.md#retrydelay) + +*** + +### scope? + +```ts +optional scope: MutationScope; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:726 + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`scope`](MutationOptions.md#scope) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean | (error) => boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:729 diff --git a/docs/framework/angular/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/angular/reference/interfaces/MutationObserverSuccessResult.md new file mode 100644 index 00000000000..580d357a294 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/MutationObserverSuccessResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverSuccessResult +title: MutationObserverSuccessResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:833 + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:22 + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: TData; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:834 + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:835 + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:35 + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:39 + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:837 + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:838 + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:44 + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:839 + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:840 + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:797 + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:801 + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:841 + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:56 + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:836 + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/angular/reference/interfaces/MutationOptions.md b/docs/framework/angular/reference/interfaces/MutationOptions.md new file mode 100644 index 00000000000..090bb10ec79 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/MutationOptions.md @@ -0,0 +1,232 @@ +--- +id: MutationOptions +title: MutationOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:712 + +## Extended by + +- [`MutationObserverOptions`](MutationObserverOptions.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:722 + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:725 + +*** + +### mutationFn? + +```ts +optional mutationFn: MutationFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:713 + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:714 + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:721 + +*** + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:717 + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, context) => TOnMutateResult | Promise; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:715 + +#### Parameters + +##### variables + +`TVariables` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`TOnMutateResult` \| `Promise`\<`TOnMutateResult`\> + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:718 + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:716 + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:719 + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:720 + +*** + +### scope? + +```ts +optional scope: MutationScope; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:726 diff --git a/docs/framework/angular/reference/interfaces/MutationState.md b/docs/framework/angular/reference/interfaces/MutationState.md new file mode 100644 index 00000000000..a23ec056f2b --- /dev/null +++ b/docs/framework/angular/reference/interfaces/MutationState.md @@ -0,0 +1,142 @@ +--- +id: MutationState +title: MutationState +--- + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:17 + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extended by + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:22 + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +*** + +### data + +```ts +data: TData | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:26 + +The last successfully resolved data for the mutation. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:31 + +The error object for the mutation, if the last attempt resulted in an error. +- Defaults to `null`. + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:35 + +The number of times the mutation function has failed for the current attempt. + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:39 + +The reason the current attempt failed, as reported by the retryer. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:44 + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +*** + +### status + +```ts +status: MutationStatus; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:48 + +The status of the mutation. + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:56 + +The timestamp for when the mutation was submitted. + +*** + +### variables + +```ts +variables: TVariables | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:52 + +The variables the mutation was last called with. diff --git a/docs/framework/angular/reference/interfaces/NotifyEvent.md b/docs/framework/angular/reference/interfaces/NotifyEvent.md new file mode 100644 index 00000000000..46dca30007d --- /dev/null +++ b/docs/framework/angular/reference/interfaces/NotifyEvent.md @@ -0,0 +1,16 @@ +--- +id: NotifyEvent +title: NotifyEvent +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:863 + +## Properties + +### type + +```ts +type: NotifyEventType; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:864 diff --git a/docs/framework/angular/reference/interfaces/QueriesObserverOptions.md b/docs/framework/angular/reference/interfaces/QueriesObserverOptions.md new file mode 100644 index 00000000000..2702657fb0b --- /dev/null +++ b/docs/framework/angular/reference/interfaces/QueriesObserverOptions.md @@ -0,0 +1,27 @@ +--- +id: QueriesObserverOptions +title: QueriesObserverOptions +--- + +Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:7 + +## Type Parameters + +### TCombinedResult + +`TCombinedResult` = [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +## Properties + +### combine? + +```ts +optional combine: CombineFn; +``` + +Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:14 + +A function that combines the array of `QueryObserverResult`s (one per +observed query) into a single value. The combined value is memoized and +only recomputed when one of the underlying results, the query hashes, or +the `combine` function itself changes. diff --git a/docs/framework/angular/reference/interfaces/QueryCacheConfig.md b/docs/framework/angular/reference/interfaces/QueryCacheConfig.md new file mode 100644 index 00000000000..9869f2e196f --- /dev/null +++ b/docs/framework/angular/reference/interfaces/QueryCacheConfig.md @@ -0,0 +1,92 @@ +--- +id: QueryCacheConfig +title: QueryCacheConfig +--- + +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:13 + +Global callbacks that fire for every query handled by a `QueryCache`, regardless of which +component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can +override, these callbacks are always called. + +## Properties + +### onError()? + +```ts +optional onError: (error, query) => void; +``` + +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:15 + +Called when any query in the cache encounters an error. + +#### Parameters + +##### error + +`Error` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, query) => void; +``` + +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:19 + +Called when any query in the cache is settled, either successfully or with an error. + +#### Parameters + +##### data + +`unknown` + +##### error + +`Error` | `null` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, query) => void; +``` + +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:17 + +Called when any query in the cache is successful. + +#### Parameters + +##### data + +`unknown` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` diff --git a/docs/framework/angular/reference/interfaces/QueryClientConfig.md b/docs/framework/angular/reference/interfaces/QueryClientConfig.md new file mode 100644 index 00000000000..f3f0d1778ff --- /dev/null +++ b/docs/framework/angular/reference/interfaces/QueryClientConfig.md @@ -0,0 +1,36 @@ +--- +id: QueryClientConfig +title: QueryClientConfig +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:844 + +## Properties + +### defaultOptions? + +```ts +optional defaultOptions: DefaultOptions; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:847 + +*** + +### mutationCache? + +```ts +optional mutationCache: MutationCache; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:846 + +*** + +### queryCache? + +```ts +optional queryCache: QueryCache; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:845 diff --git a/docs/framework/angular/reference/interfaces/QueryExecuteOptions.md b/docs/framework/angular/reference/interfaces/QueryExecuteOptions.md new file mode 100644 index 00000000000..6ce7fce21a2 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/QueryExecuteOptions.md @@ -0,0 +1,375 @@ +--- +id: QueryExecuteOptions +title: QueryExecuteOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:303 + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](QueryOptions.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:120 + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:160 + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:164 + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### initialPageParam? + +```ts +optional initialPageParam: undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:304 + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:185 + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:181 + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:109 + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:133 + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:128 + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:138 + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:147 + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:151 + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:94 + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:104 + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:305 + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:310 + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:172 + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` diff --git a/docs/framework/angular/reference/interfaces/QueryFeature.md b/docs/framework/angular/reference/interfaces/QueryFeature.md index 916e0a4659d..11d0aaf6bb7 100644 --- a/docs/framework/angular/reference/interfaces/QueryFeature.md +++ b/docs/framework/angular/reference/interfaces/QueryFeature.md @@ -3,7 +3,7 @@ id: QueryFeature title: QueryFeature --- -Defined in: [providers.ts:132](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L132) +Defined in: [packages/angular-query-experimental/src/providers.ts:132](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L132) Helper type to represent a Query feature. @@ -21,7 +21,7 @@ Helper type to represent a Query feature. ɵkind: TFeatureKind; ``` -Defined in: [providers.ts:133](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L133) +Defined in: [packages/angular-query-experimental/src/providers.ts:133](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L133) *** @@ -31,4 +31,4 @@ Defined in: [providers.ts:133](https://github.com/TanStack/query/blob/main/packa ɵproviders: Provider[]; ``` -Defined in: [providers.ts:134](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L134) +Defined in: [packages/angular-query-experimental/src/providers.ts:134](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L134) diff --git a/docs/framework/angular/reference/interfaces/QueryFilters.md b/docs/framework/angular/reference/interfaces/QueryFilters.md new file mode 100644 index 00000000000..af6418db837 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/QueryFilters.md @@ -0,0 +1,102 @@ +--- +id: QueryFilters +title: QueryFilters +--- + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:13 + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extended by + +- [`InvalidateQueryFilters`](InvalidateQueryFilters.md) +- [`RefetchQueryFilters`](RefetchQueryFilters.md) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:21 + +Match query key exactly + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:37 + +Include queries matching their fetchStatus + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:25 + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:29 + +Include queries matching this query key + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:33 + +Include or exclude stale queries + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:17 + +Filter to active queries, inactive queries or all queries diff --git a/docs/framework/angular/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/angular/reference/interfaces/QueryObserverBaseResult.md new file mode 100644 index 00000000000..91c0d8449eb --- /dev/null +++ b/docs/framework/angular/reference/interfaces/QueryObserverBaseResult.md @@ -0,0 +1,358 @@ +--- +id: QueryObserverBaseResult +title: QueryObserverBaseResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:384 + +## Extended by + +- [`QueryObserverPendingResult`](QueryObserverPendingResult.md) +- [`QueryObserverLoadingResult`](QueryObserverLoadingResult.md) +- [`QueryObserverLoadingErrorResult`](QueryObserverLoadingErrorResult.md) +- [`QueryObserverRefetchErrorResult`](QueryObserverRefetchErrorResult.md) +- [`QueryObserverSuccessResult`](QueryObserverSuccessResult.md) +- [`QueryObserverPlaceholderResult`](QueryObserverPlaceholderResult.md) +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:388 + +The last successfully resolved data for the query. + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:392 + +The timestamp for when the query most recently returned the `status` as `"success"`. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:397 + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:416 + +The sum of all errors. + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:401 + +The timestamp for when the query most recently returned the `status` as `"error"`. + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:407 + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:412 + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:504 + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 + +`true` if this observer is enabled, `false` otherwise. + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:421 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 + +Will be `true` if the query has been fetched. + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:430 + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:435 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:440 + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +*** + +### isLoadingError + +```ts +isLoadingError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:448 + +Will be `true` if the query failed while fetching for the first time. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:458 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:444 + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:462 + +Will be `true` if the data shown is the placeholder data. + +*** + +### isRefetchError + +```ts +isRefetchError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:466 + +Will be `true` if the query failed while refetching. + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:475 + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:480 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:496 + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. diff --git a/docs/framework/angular/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/angular/reference/interfaces/QueryObserverLoadingErrorResult.md new file mode 100644 index 00000000000..9d4b6021bb0 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverLoadingErrorResult +title: QueryObserverLoadingErrorResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:529 + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:530 + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:392 + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:531 + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:416 + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:401 + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:407 + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:412 + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:504 + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:532 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:430 + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:435 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:534 + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:535 + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:458 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:533 + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:538 + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:536 + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:475 + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:537 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:539 + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/angular/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/angular/reference/interfaces/QueryObserverLoadingResult.md new file mode 100644 index 00000000000..9900069ea66 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/QueryObserverLoadingResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverLoadingResult +title: QueryObserverLoadingResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:517 + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:518 + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:392 + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:519 + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:416 + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:401 + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:407 + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:412 + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:504 + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:520 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:430 + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:435 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:522 + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:523 + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:458 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:521 + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:526 + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:524 + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:475 + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:525 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:527 + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/angular/reference/interfaces/QueryObserverOptions.md b/docs/framework/angular/reference/interfaces/QueryObserverOptions.md new file mode 100644 index 00000000000..8cfd8b82561 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/QueryObserverOptions.md @@ -0,0 +1,542 @@ +--- +id: QueryObserverOptions +title: QueryObserverOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:203 + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](QueryOptions.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Extended by + +- [`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md) +- [`CreateBaseQueryOptions`](CreateBaseQueryOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### enabled? + +```ts +optional enabled: QueryBooleanOption; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:210 + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:120 + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:160 + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:164 + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:185 + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:181 + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:109 + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:267 + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:133 + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### placeholderData? + +```ts +optional placeholderData: + | NonFunctionGuard +| PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:292 + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:128 + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:138 + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:147 + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:151 + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:224 + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:229 + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:253 + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:245 + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:237 + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:94 + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:104 + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:259 + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:282 + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:218 + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:172 + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:288 + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:275 + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. diff --git a/docs/framework/angular/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/angular/reference/interfaces/QueryObserverPendingResult.md new file mode 100644 index 00000000000..d4a52d6ae6d --- /dev/null +++ b/docs/framework/angular/reference/interfaces/QueryObserverPendingResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverPendingResult +title: QueryObserverPendingResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:506 + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:507 + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:392 + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:508 + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:416 + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:401 + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:407 + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:412 + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:504 + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:509 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:430 + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:435 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:440 + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:511 + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:458 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:510 + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:514 + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:512 + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:475 + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:513 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:515 + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/angular/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/angular/reference/interfaces/QueryObserverPlaceholderResult.md new file mode 100644 index 00000000000..5b2a91f6f2d --- /dev/null +++ b/docs/framework/angular/reference/interfaces/QueryObserverPlaceholderResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverPlaceholderResult +title: QueryObserverPlaceholderResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:565 + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:566 + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:392 + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:568 + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:416 + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:401 + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:407 + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:412 + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:504 + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:567 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:430 + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:435 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:570 + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:571 + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:458 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:569 + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:574 + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:572 + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:475 + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:573 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:575 + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/angular/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/angular/reference/interfaces/QueryObserverRefetchErrorResult.md new file mode 100644 index 00000000000..5677a114ddc --- /dev/null +++ b/docs/framework/angular/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverRefetchErrorResult +title: QueryObserverRefetchErrorResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:541 + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:542 + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:392 + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:543 + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:416 + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:401 + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:407 + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:412 + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:504 + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:544 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:430 + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:435 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:546 + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:547 + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:458 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:545 + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:550 + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:548 + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:475 + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:549 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:551 + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/angular/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/angular/reference/interfaces/QueryObserverSuccessResult.md new file mode 100644 index 00000000000..bac555610c7 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/QueryObserverSuccessResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverSuccessResult +title: QueryObserverSuccessResult +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:553 + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:554 + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:392 + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:555 + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:416 + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:401 + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:407 + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:412 + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:504 + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:556 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:430 + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:435 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:558 + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:559 + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:458 + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:557 + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:562 + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:560 + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:475 + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:561 + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:563 + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/angular/reference/interfaces/QueryOptions.md b/docs/framework/angular/reference/interfaces/QueryOptions.md new file mode 100644 index 00000000000..3f4bcc9b526 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/QueryOptions.md @@ -0,0 +1,240 @@ +--- +id: QueryOptions +title: QueryOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:86 + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:120 + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +*** + +### initialData? + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:160 + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:164 + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:185 + +Maximum number of pages to store in the data of an infinite query. + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:181 + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:109 + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:133 + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +*** + +### queryFn? + +```ts +optional queryFn: + | QueryFunction + | typeof skipToken; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:128 + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:138 + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:147 + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:151 + +If specified, this function is used to hash the `queryKey` to a string. + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:94 + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:104 + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:172 + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. diff --git a/docs/framework/angular/reference/interfaces/QueryState.md b/docs/framework/angular/reference/interfaces/QueryState.md new file mode 100644 index 00000000000..c0449d51e59 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/QueryState.md @@ -0,0 +1,175 @@ +--- +id: QueryState +title: QueryState +--- + +Defined in: packages/query-core/dist-ts/src/query.d.ts:17 + +The raw state stored on a `Query` instance. This is the underlying state +that observer results (e.g. `QueryObserverResult`) are derived from. + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:21 + +The last successfully resolved data for the query. + +*** + +### dataUpdateCount + +```ts +dataUpdateCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:25 + +The number of times the query has successfully resolved. + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:29 + +The timestamp for when the query most recently returned the `status` as `"success"`. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:34 + +The error object for the query, if the last attempt resulted in an error. +- Defaults to `null`. + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:38 + +The sum of all errors, incremented every time the query resolves with an error. + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:42 + +The timestamp for when the query most recently returned the `status` as `"error"`. + +*** + +### fetchFailureCount + +```ts +fetchFailureCount: number; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:48 + +The failure count for the current fetch. +- Incremented every time the fetch fails. +- Reset to `0` when the fetch succeeds. + +*** + +### fetchFailureReason + +```ts +fetchFailureReason: TError | null; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:53 + +The reason the current fetch failed, as reported by the retryer. +- Reset to `null` when the fetch succeeds. + +*** + +### fetchMeta + +```ts +fetchMeta: FetchMeta | null; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:58 + +Metadata passed to the currently in-flight (or most recent) fetch, e.g. the +`fetchMore` direction for infinite queries. + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:77 + +The fetch status of the query. +- `fetching`: the `queryFn` is currently executing. +- `paused`: a fetch wanted to run but has been paused (see network mode). +- `idle`: the query is not fetching. + +*** + +### isInvalidated + +```ts +isInvalidated: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:63 + +Whether the query has been marked as invalidated via `invalidate()`. +- Reset to `false` whenever the query resolves successfully. + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: packages/query-core/dist-ts/src/query.d.ts:70 + +The status of the query. +- `pending` if there's no cached data and no attempt was finished yet. +- `error` if the last attempt resulted in an error. +- `success` if the query has data. diff --git a/docs/framework/angular/reference/interfaces/RefetchOptions.md b/docs/framework/angular/reference/interfaces/RefetchOptions.md new file mode 100644 index 00000000000..88ca9aed42d --- /dev/null +++ b/docs/framework/angular/reference/interfaces/RefetchOptions.md @@ -0,0 +1,45 @@ +--- +id: RefetchOptions +title: RefetchOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:341 + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Extended by + +- [`InvalidateOptions`](InvalidateOptions.md) +- [`ResetOptions`](ResetOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:349 + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:339 + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/angular/reference/interfaces/RefetchQueryFilters.md b/docs/framework/angular/reference/interfaces/RefetchQueryFilters.md new file mode 100644 index 00000000000..245019de966 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/RefetchQueryFilters.md @@ -0,0 +1,125 @@ +--- +id: RefetchQueryFilters +title: RefetchQueryFilters +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:354 + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extends + +- [`QueryFilters`](QueryFilters.md)\<`TQueryKey`\> + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:21 + +Match query key exactly + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`exact`](QueryFilters.md#exact) + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:37 + +Include queries matching their fetchStatus + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`fetchStatus`](QueryFilters.md#fetchstatus) + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:25 + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`predicate`](QueryFilters.md#predicate) + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:29 + +Include queries matching this query key + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`queryKey`](QueryFilters.md#querykey) + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:33 + +Include or exclude stale queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`stale`](QueryFilters.md#stale) + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:17 + +Filter to active queries, inactive queries or all queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/angular/reference/interfaces/Register.md b/docs/framework/angular/reference/interfaces/Register.md new file mode 100644 index 00000000000..68e892cf726 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/Register.md @@ -0,0 +1,6 @@ +--- +id: Register +title: Register +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:15 diff --git a/docs/framework/angular/reference/interfaces/ResetOptions.md b/docs/framework/angular/reference/interfaces/ResetOptions.md new file mode 100644 index 00000000000..520cd8e49bc --- /dev/null +++ b/docs/framework/angular/reference/interfaces/ResetOptions.md @@ -0,0 +1,44 @@ +--- +id: ResetOptions +title: ResetOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:358 + +## Extends + +- [`RefetchOptions`](RefetchOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:349 + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`cancelRefetch`](RefetchOptions.md#cancelrefetch) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:339 + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`throwOnError`](RefetchOptions.md#throwonerror) diff --git a/docs/framework/angular/reference/interfaces/ResultOptions.md b/docs/framework/angular/reference/interfaces/ResultOptions.md new file mode 100644 index 00000000000..7408f5f9e1f --- /dev/null +++ b/docs/framework/angular/reference/interfaces/ResultOptions.md @@ -0,0 +1,22 @@ +--- +id: ResultOptions +title: ResultOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:338 + +## Extended by + +- [`RefetchOptions`](RefetchOptions.md) +- [`FetchNextPageOptions`](FetchNextPageOptions.md) +- [`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +## Properties + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:339 diff --git a/docs/framework/angular/reference/interfaces/SetDataOptions.md b/docs/framework/angular/reference/interfaces/SetDataOptions.md new file mode 100644 index 00000000000..287dd808a9c --- /dev/null +++ b/docs/framework/angular/reference/interfaces/SetDataOptions.md @@ -0,0 +1,16 @@ +--- +id: SetDataOptions +title: SetDataOptions +--- + +Defined in: packages/query-core/dist-ts/src/types.d.ts:859 + +## Properties + +### updatedAt? + +```ts +optional updatedAt: number; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:860 diff --git a/docs/framework/angular/reference/type-aliases/AnyDataTag.md b/docs/framework/angular/reference/type-aliases/AnyDataTag.md new file mode 100644 index 00000000000..72172d8055e --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/AnyDataTag.md @@ -0,0 +1,30 @@ +--- +id: AnyDataTag +title: AnyDataTag +--- + +```ts +type AnyDataTag = object; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:29 + +## Properties + +### \[dataTagErrorSymbol\] + +```ts +[dataTagErrorSymbol]: any; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:31 + +*** + +### \[dataTagSymbol\] + +```ts +[dataTagSymbol]: any; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:30 diff --git a/docs/framework/angular/reference/type-aliases/CreateBaseMutationResult.md b/docs/framework/angular/reference/type-aliases/CreateBaseMutationResult.md index f593d6ce62d..30408338654 100644 --- a/docs/framework/angular/reference/type-aliases/CreateBaseMutationResult.md +++ b/docs/framework/angular/reference/type-aliases/CreateBaseMutationResult.md @@ -9,10 +9,10 @@ type CreateBaseMutationResult = Over }> & object; ``` -Defined in: [types.ts:284](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L284) +Defined in: [packages/angular-query-experimental/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L284) The pre-`Signal` shape [CreateMutationResult](CreateMutationResult.md) is built from — not what `injectMutation` actually -returns. Same as MutationObserverResult from `@tanstack/query-core`, with `mutate` narrowed to the +returns. Same as [MutationObserverResult](MutationObserverResult.md) from `@tanstack/query-core`, with `mutate` narrowed to the fire-and-forget [CreateMutateFunction](CreateMutateFunction.md) signature, plus the added `mutateAsync`. ## Type Declaration @@ -35,7 +35,7 @@ The type your mutation function resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your mutation function may throw. diff --git a/docs/framework/angular/reference/type-aliases/CreateBaseQueryResult.md b/docs/framework/angular/reference/type-aliases/CreateBaseQueryResult.md index 988a2074f36..f632a3e04a7 100644 --- a/docs/framework/angular/reference/type-aliases/CreateBaseQueryResult.md +++ b/docs/framework/angular/reference/type-aliases/CreateBaseQueryResult.md @@ -7,10 +7,10 @@ title: CreateBaseQueryResult type CreateBaseQueryResult = BaseQueryNarrowing & MapToSignals>; ``` -Defined in: [types.ts:149](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L149) +Defined in: [packages/angular-query-experimental/src/types.ts:149](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L149) The result of `injectQuery` when `initialData` isn't set — `data` may be `undefined` while the query is -`pending`. Same shape as QueryObserverResult from `@tanstack/query-core`, but value fields (like +`pending`. Same shape as [QueryObserverResult](QueryObserverResult.md) from `@tanstack/query-core`, but value fields (like `data`, `error`, `status`) are exposed as a `Signal` — read them with `query.data()`, not `query.data` — while function fields (like `refetch`) are called directly, unchanged. `isSuccess`/`isError`/`isPending` are [BaseQueryNarrowing](../interfaces/BaseQueryNarrowing.md) type-guard methods rather than plain booleans. @@ -26,10 +26,10 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TState -`TState` = `QueryObserverResult`\<`TData`, `TError`\> +`TState` = [`QueryObserverResult`](QueryObserverResult.md)\<`TData`, `TError`\> diff --git a/docs/framework/angular/reference/type-aliases/CreateInfiniteQueryResult.md b/docs/framework/angular/reference/type-aliases/CreateInfiniteQueryResult.md index b5d12e1b9d3..e0b6a6981f4 100644 --- a/docs/framework/angular/reference/type-aliases/CreateInfiniteQueryResult.md +++ b/docs/framework/angular/reference/type-aliases/CreateInfiniteQueryResult.md @@ -7,10 +7,10 @@ title: CreateInfiniteQueryResult type CreateInfiniteQueryResult = BaseQueryNarrowing & MapToSignals>; ``` -Defined in: [types.ts:191](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L191) +Defined in: [packages/angular-query-experimental/src/types.ts:191](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L191) The result of `injectInfiniteQuery` when `initialData` isn't set — `data` may be `undefined` while the -query is `pending`. Same shape as InfiniteQueryObserverResult from `@tanstack/query-core`, but +query is `pending`. Same shape as [InfiniteQueryObserverResult](InfiniteQueryObserverResult.md) from `@tanstack/query-core`, but value fields are exposed as a `Signal` while function fields (like `fetchNextPage`) are called directly, unchanged. @@ -24,6 +24,6 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. diff --git a/docs/framework/angular/reference/type-aliases/CreateMutateAsyncFunction.md b/docs/framework/angular/reference/type-aliases/CreateMutateAsyncFunction.md index af507a45388..fe72322f8cd 100644 --- a/docs/framework/angular/reference/type-aliases/CreateMutateAsyncFunction.md +++ b/docs/framework/angular/reference/type-aliases/CreateMutateAsyncFunction.md @@ -7,7 +7,7 @@ title: CreateMutateAsyncFunction type CreateMutateAsyncFunction = MutateFunction; ``` -Defined in: [types.ts:266](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L266) +Defined in: [packages/angular-query-experimental/src/types.ts:266](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L266) The type of `mutateAsync`, as returned by `injectMutation`. Similar to [CreateMutateFunction](CreateMutateFunction.md), but returns a promise which can be awaited. @@ -22,7 +22,7 @@ The type your mutation function resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your mutation function may throw. diff --git a/docs/framework/angular/reference/type-aliases/CreateMutateFunction.md b/docs/framework/angular/reference/type-aliases/CreateMutateFunction.md index 62ffebc6351..9960203a068 100644 --- a/docs/framework/angular/reference/type-aliases/CreateMutateFunction.md +++ b/docs/framework/angular/reference/type-aliases/CreateMutateFunction.md @@ -7,7 +7,7 @@ title: CreateMutateFunction type CreateMutateFunction = (...args) => void; ``` -Defined in: [types.ts:245](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L245) +Defined in: [packages/angular-query-experimental/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L245) The type of `mutate`, as returned by `injectMutation`. Forwards the variables (and an optional per-call `onSuccess`/`onError`/`onSettled`) to the underlying `mutate` call. Fire-and-forget — errors are surfaced @@ -23,7 +23,7 @@ The type your mutation function resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your mutation function may throw. @@ -44,7 +44,7 @@ their `onMutateResult` parameter — useful for optimistic-update rollback data. ### args -...`Parameters`\<`MutateFunction`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> +...`Parameters`\<[`MutateFunction`](MutateFunction.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> ## Returns diff --git a/docs/framework/angular/reference/type-aliases/CreateMutationResult.md b/docs/framework/angular/reference/type-aliases/CreateMutationResult.md index a355e7a1eca..7a167bee22c 100644 --- a/docs/framework/angular/reference/type-aliases/CreateMutationResult.md +++ b/docs/framework/angular/reference/type-aliases/CreateMutationResult.md @@ -7,7 +7,7 @@ title: CreateMutationResult type CreateMutationResult = BaseMutationNarrowing & MapToSignals>; ``` -Defined in: [types.ts:416](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L416) +Defined in: [packages/angular-query-experimental/src/types.ts:416](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L416) The result of `injectMutation`. Based on [CreateBaseMutationResult](CreateBaseMutationResult.md), but value fields are exposed as a `Signal` — read them with `mutation.data()`, not `mutation.data` — while function fields (`mutate`, @@ -24,7 +24,7 @@ The type your mutation function resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your mutation function may throw. diff --git a/docs/framework/angular/reference/type-aliases/CreateQueryResult.md b/docs/framework/angular/reference/type-aliases/CreateQueryResult.md index c1a4fb1bc5d..2e57945064b 100644 --- a/docs/framework/angular/reference/type-aliases/CreateQueryResult.md +++ b/docs/framework/angular/reference/type-aliases/CreateQueryResult.md @@ -7,7 +7,7 @@ title: CreateQueryResult type CreateQueryResult = CreateBaseQueryResult; ``` -Defined in: [types.ts:162](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L162) +Defined in: [packages/angular-query-experimental/src/types.ts:162](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L162) The result of `injectQuery`. Same as [CreateBaseQueryResult](CreateBaseQueryResult.md). @@ -21,6 +21,6 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. diff --git a/docs/framework/angular/reference/type-aliases/DataTag.md b/docs/framework/angular/reference/type-aliases/DataTag.md new file mode 100644 index 00000000000..625108004be --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/DataTag.md @@ -0,0 +1,24 @@ +--- +id: DataTag +title: DataTag +--- + +```ts +type DataTag = TType extends AnyDataTag ? TType : TType & object; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:33 + +## Type Parameters + +### TType + +`TType` + +### TValue + +`TValue` + +### TError + +`TError` = [`UnsetMarker`](UnsetMarker.md) diff --git a/docs/framework/angular/reference/type-aliases/DefaultError.md b/docs/framework/angular/reference/type-aliases/DefaultError.md new file mode 100644 index 00000000000..470a0cbe9b7 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/DefaultError.md @@ -0,0 +1,10 @@ +--- +id: DefaultError +title: DefaultError +--- + +```ts +type DefaultError = Register extends object ? TError : Error; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:17 diff --git a/docs/framework/angular/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/angular/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md new file mode 100644 index 00000000000..6ce38df0aa3 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -0,0 +1,32 @@ +--- +id: DefaultedInfiniteQueryObserverOptions +title: DefaultedInfiniteQueryObserverOptions +--- + +```ts +type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:302 + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` diff --git a/docs/framework/angular/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/angular/reference/type-aliases/DefaultedQueryObserverOptions.md new file mode 100644 index 00000000000..16295c87bca --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -0,0 +1,32 @@ +--- +id: DefaultedQueryObserverOptions +title: DefaultedQueryObserverOptions +--- + +```ts +type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:299 + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/angular/reference/type-aliases/DefinedCreateInfiniteQueryResult.md b/docs/framework/angular/reference/type-aliases/DefinedCreateInfiniteQueryResult.md index 4b56723f9ab..382b86bdbd1 100644 --- a/docs/framework/angular/reference/type-aliases/DefinedCreateInfiniteQueryResult.md +++ b/docs/framework/angular/reference/type-aliases/DefinedCreateInfiniteQueryResult.md @@ -7,10 +7,10 @@ title: DefinedCreateInfiniteQueryResult type DefinedCreateInfiniteQueryResult = MapToSignals; ``` -Defined in: [types.ts:205](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L205) +Defined in: [packages/angular-query-experimental/src/types.ts:205](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L205) The result of `injectInfiniteQuery` when `initialData` is set — `data` is never `undefined`. Same shape as -DefinedInfiniteQueryObserverResult from `@tanstack/query-core`, but value fields are exposed as a +[DefinedInfiniteQueryObserverResult](DefinedInfiniteQueryObserverResult.md) from `@tanstack/query-core`, but value fields are exposed as a `Signal` while function fields are called directly, unchanged. ## Type Parameters @@ -23,10 +23,10 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TDefinedInfiniteQueryObserver -`TDefinedInfiniteQueryObserver` = `DefinedInfiniteQueryObserverResult`\<`TData`, `TError`\> +`TDefinedInfiniteQueryObserver` = [`DefinedInfiniteQueryObserverResult`](DefinedInfiniteQueryObserverResult.md)\<`TData`, `TError`\> diff --git a/docs/framework/angular/reference/type-aliases/DefinedCreateQueryResult.md b/docs/framework/angular/reference/type-aliases/DefinedCreateQueryResult.md index 36e9b1de9de..934f51485d1 100644 --- a/docs/framework/angular/reference/type-aliases/DefinedCreateQueryResult.md +++ b/docs/framework/angular/reference/type-aliases/DefinedCreateQueryResult.md @@ -7,10 +7,10 @@ title: DefinedCreateQueryResult type DefinedCreateQueryResult = BaseQueryNarrowing & MapToSignals>; ``` -Defined in: [types.ts:175](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L175) +Defined in: [packages/angular-query-experimental/src/types.ts:175](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L175) The result of `injectQuery` when `initialData` is set — `data` is never `undefined`. Same shape as -DefinedQueryObserverResult from `@tanstack/query-core`, but value fields are exposed as a +[DefinedQueryObserverResult](DefinedQueryObserverResult.md) from `@tanstack/query-core`, but value fields are exposed as a `Signal` while function fields are called directly, unchanged. ## Type Parameters @@ -23,10 +23,10 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TState -`TState` = `DefinedQueryObserverResult`\<`TData`, `TError`\> +`TState` = [`DefinedQueryObserverResult`](DefinedQueryObserverResult.md)\<`TData`, `TError`\> diff --git a/docs/framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult.md new file mode 100644 index 00000000000..fd10c3af111 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -0,0 +1,22 @@ +--- +id: DefinedInfiniteQueryObserverResult +title: DefinedInfiniteQueryObserverResult +--- + +```ts +type DefinedInfiniteQueryObserverResult = + | InfiniteQueryObserverRefetchErrorResult +| InfiniteQueryObserverSuccessResult; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:694 + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/angular/reference/type-aliases/DefinedInitialDataInfiniteOptions.md b/docs/framework/angular/reference/type-aliases/DefinedInitialDataInfiniteOptions.md index b0cef845357..d4b42457136 100644 --- a/docs/framework/angular/reference/type-aliases/DefinedInitialDataInfiniteOptions.md +++ b/docs/framework/angular/reference/type-aliases/DefinedInitialDataInfiniteOptions.md @@ -7,7 +7,7 @@ title: DefinedInitialDataInfiniteOptions type DefinedInitialDataInfiniteOptions = CreateInfiniteQueryOptions & object; ``` -Defined in: [infinite-query-options.ts:109](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L109) +Defined in: [packages/angular-query-experimental/src/infinite-query-options.ts:109](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L109) The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is set — `data` is never `undefined` (unless a `select` changes `TData` to include `undefined`). @@ -39,20 +39,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/angular/reference/type-aliases/DefinedInitialDataOptions.md b/docs/framework/angular/reference/type-aliases/DefinedInitialDataOptions.md index 36e867b0423..e37476fa74d 100644 --- a/docs/framework/angular/reference/type-aliases/DefinedInitialDataOptions.md +++ b/docs/framework/angular/reference/type-aliases/DefinedInitialDataOptions.md @@ -7,7 +7,7 @@ title: DefinedInitialDataOptions type DefinedInitialDataOptions = Omit, "queryFn"> & object; ``` -Defined in: [query-options.ts:80](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/query-options.ts#L80) +Defined in: [packages/angular-query-experimental/src/query-options.ts:80](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/query-options.ts#L80) The options accepted by the `queryOptions` overload selected when `initialData` is set — `data` is never `undefined` (unless a `select` changes `TData` to include `undefined`). @@ -48,7 +48,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -60,6 +60,6 @@ The type `data` ends up as after `select` runs. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/angular/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/angular/reference/type-aliases/DefinedQueryObserverResult.md new file mode 100644 index 00000000000..70947ba3fca --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/DefinedQueryObserverResult.md @@ -0,0 +1,22 @@ +--- +id: DefinedQueryObserverResult +title: DefinedQueryObserverResult +--- + +```ts +type DefinedQueryObserverResult = + | QueryObserverRefetchErrorResult +| QueryObserverSuccessResult; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:577 + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/angular/reference/type-aliases/DevtoolsFeature.md b/docs/framework/angular/reference/type-aliases/DevtoolsFeature.md index 2ec2614ef8b..2db12a400ab 100644 --- a/docs/framework/angular/reference/type-aliases/DevtoolsFeature.md +++ b/docs/framework/angular/reference/type-aliases/DevtoolsFeature.md @@ -7,7 +7,7 @@ title: DevtoolsFeature type DevtoolsFeature = QueryFeature<"Devtools">; ``` -Defined in: [providers.ts:155](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L155) +Defined in: [packages/angular-query-experimental/src/providers.ts:155](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L155) A type alias that represents a feature which enables developer tools. The type is used to describe the return value of the `withDevtools` function. diff --git a/docs/framework/angular/reference/type-aliases/DistributiveOmit.md b/docs/framework/angular/reference/type-aliases/DistributiveOmit.md new file mode 100644 index 00000000000..d710c6aaa83 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/DistributiveOmit.md @@ -0,0 +1,20 @@ +--- +id: DistributiveOmit +title: DistributiveOmit +--- + +```ts +type DistributiveOmit = TObject extends any ? Omit : never; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:10 + +## Type Parameters + +### TObject + +`TObject` + +### TKey + +`TKey` *extends* keyof `TObject` diff --git a/docs/framework/angular/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/angular/reference/type-aliases/EnsureInfiniteQueryDataOptions.md new file mode 100644 index 00000000000..251a65fd131 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -0,0 +1,42 @@ +--- +id: EnsureInfiniteQueryDataOptions +title: EnsureInfiniteQueryDataOptions +--- + +```ts +type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:326 + +## Type Declaration + +### ~~revalidateIfStale?~~ + +```ts +optional revalidateIfStale: boolean; +``` + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Deprecated diff --git a/docs/framework/angular/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/angular/reference/type-aliases/FetchInfiniteQueryOptions.md new file mode 100644 index 00000000000..f3f02a26062 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -0,0 +1,34 @@ +--- +id: FetchInfiniteQueryOptions +title: FetchInfiniteQueryOptions +--- + +```ts +type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:337 + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Deprecated diff --git a/docs/framework/angular/reference/type-aliases/FetchStatus.md b/docs/framework/angular/reference/type-aliases/FetchStatus.md new file mode 100644 index 00000000000..cfa8b902067 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/FetchStatus.md @@ -0,0 +1,10 @@ +--- +id: FetchStatus +title: FetchStatus +--- + +```ts +type FetchStatus = "fetching" | "paused" | "idle"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:383 diff --git a/docs/framework/angular/reference/type-aliases/GetNextPageParamFunction.md b/docs/framework/angular/reference/type-aliases/GetNextPageParamFunction.md new file mode 100644 index 00000000000..9eb463cbdde --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/GetNextPageParamFunction.md @@ -0,0 +1,42 @@ +--- +id: GetNextPageParamFunction +title: GetNextPageParamFunction +--- + +```ts +type GetNextPageParamFunction = (lastPage, allPages, lastPageParam, allPageParams) => TPageParam | undefined | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:76 + +## Type Parameters + +### TPageParam + +`TPageParam` + +### TQueryFnData + +`TQueryFnData` = `unknown` + +## Parameters + +### lastPage + +`TQueryFnData` + +### allPages + +`TQueryFnData`[] + +### lastPageParam + +`TPageParam` + +### allPageParams + +`TPageParam`[] + +## Returns + +`TPageParam` \| `undefined` \| `null` diff --git a/docs/framework/angular/reference/type-aliases/GetPreviousPageParamFunction.md b/docs/framework/angular/reference/type-aliases/GetPreviousPageParamFunction.md new file mode 100644 index 00000000000..32342382c21 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/GetPreviousPageParamFunction.md @@ -0,0 +1,42 @@ +--- +id: GetPreviousPageParamFunction +title: GetPreviousPageParamFunction +--- + +```ts +type GetPreviousPageParamFunction = (firstPage, allPages, firstPageParam, allPageParams) => TPageParam | undefined | null; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:75 + +## Type Parameters + +### TPageParam + +`TPageParam` + +### TQueryFnData + +`TQueryFnData` = `unknown` + +## Parameters + +### firstPage + +`TQueryFnData` + +### allPages + +`TQueryFnData`[] + +### firstPageParam + +`TPageParam` + +### allPageParams + +`TPageParam`[] + +## Returns + +`TPageParam` \| `undefined` \| `null` diff --git a/docs/framework/angular/reference/type-aliases/InferDataFromTag.md b/docs/framework/angular/reference/type-aliases/InferDataFromTag.md new file mode 100644 index 00000000000..5002e47659c --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/InferDataFromTag.md @@ -0,0 +1,20 @@ +--- +id: InferDataFromTag +title: InferDataFromTag +--- + +```ts +type InferDataFromTag = TTaggedQueryKey extends DataTag ? TaggedValue : TQueryFnData; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:40 + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` + +### TTaggedQueryKey + +`TTaggedQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/angular/reference/type-aliases/InferErrorFromTag.md b/docs/framework/angular/reference/type-aliases/InferErrorFromTag.md new file mode 100644 index 00000000000..d09b9c92ff3 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/InferErrorFromTag.md @@ -0,0 +1,20 @@ +--- +id: InferErrorFromTag +title: InferErrorFromTag +--- + +```ts +type InferErrorFromTag = TTaggedQueryKey extends DataTag ? TaggedError extends UnsetMarker ? TError : TaggedError : TError; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:41 + +## Type Parameters + +### TError + +`TError` + +### TTaggedQueryKey + +`TTaggedQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/angular/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/angular/reference/type-aliases/InfiniteQueryExecuteOptions.md new file mode 100644 index 00000000000..a898492d34e --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -0,0 +1,32 @@ +--- +id: InfiniteQueryExecuteOptions +title: InfiniteQueryExecuteOptions +--- + +```ts +type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:335 + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` diff --git a/docs/framework/angular/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/angular/reference/type-aliases/InfiniteQueryObserverResult.md new file mode 100644 index 00000000000..cd9b2615e8c --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/InfiniteQueryObserverResult.md @@ -0,0 +1,25 @@ +--- +id: InfiniteQueryObserverResult +title: InfiniteQueryObserverResult +--- + +```ts +type InfiniteQueryObserverResult = + | DefinedInfiniteQueryObserverResult + | InfiniteQueryObserverLoadingErrorResult + | InfiniteQueryObserverLoadingResult + | InfiniteQueryObserverPendingResult +| InfiniteQueryObserverPlaceholderResult; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:695 + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/angular/reference/type-aliases/InitialDataFunction.md b/docs/framework/angular/reference/type-aliases/InitialDataFunction.md new file mode 100644 index 00000000000..716025e656c --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/InitialDataFunction.md @@ -0,0 +1,20 @@ +--- +id: InitialDataFunction +title: InitialDataFunction +--- + +```ts +type InitialDataFunction = () => T | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:70 + +## Type Parameters + +### T + +`T` + +## Returns + +`T` \| `undefined` diff --git a/docs/framework/angular/reference/type-aliases/ManagedTimerId.md b/docs/framework/angular/reference/type-aliases/ManagedTimerId.md new file mode 100644 index 00000000000..48ac22cfbde --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/ManagedTimerId.md @@ -0,0 +1,19 @@ +--- +id: ManagedTimerId +title: ManagedTimerId +--- + +```ts +type ManagedTimerId = + | number + | { + [toPrimitive]: () => number; +}; +``` + +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:16 + +Wrapping `setTimeout` is awkward from a typing perspective because platform +typings may extend the return type of `setTimeout`. For example, NodeJS +typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be +able to return such a type. diff --git a/docs/framework/angular/reference/type-aliases/MutateFunction.md b/docs/framework/angular/reference/type-aliases/MutateFunction.md new file mode 100644 index 00000000000..21ba61ea438 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/MutateFunction.md @@ -0,0 +1,38 @@ +--- +id: MutateFunction +title: MutateFunction +--- + +```ts +type MutateFunction = (...rest) => Promise; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:743 + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Parameters + +### rest + +...[`MutateFunctionRest`](MutateFunctionRest.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Returns + +`Promise`\<`TData`\> diff --git a/docs/framework/angular/reference/type-aliases/MutateFunctionRest.md b/docs/framework/angular/reference/type-aliases/MutateFunctionRest.md new file mode 100644 index 00000000000..fc226535f95 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/MutateFunctionRest.md @@ -0,0 +1,28 @@ +--- +id: MutateFunctionRest +title: MutateFunctionRest +--- + +```ts +type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:736 + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` diff --git a/docs/framework/angular/reference/type-aliases/MutationCacheNotifyEvent.md b/docs/framework/angular/reference/type-aliases/MutationCacheNotifyEvent.md new file mode 100644 index 00000000000..ac7423a48e7 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/MutationCacheNotifyEvent.md @@ -0,0 +1,20 @@ +--- +id: MutationCacheNotifyEvent +title: MutationCacheNotifyEvent +--- + +```ts +type MutationCacheNotifyEvent = + | NotifyEventMutationAdded + | NotifyEventMutationRemoved + | NotifyEventMutationObserverAdded + | NotifyEventMutationObserverRemoved + | NotifyEventMutationObserverOptionsUpdated + | NotifyEventMutationUpdated; +``` + +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:59 + +The event passed to a `MutationCache` subscriber. Fired whenever a mutation is added or removed +from the cache, its state is updated, or one of its observers is added, removed, or has its +options updated. diff --git a/docs/framework/angular/reference/type-aliases/MutationFunction.md b/docs/framework/angular/reference/type-aliases/MutationFunction.md new file mode 100644 index 00000000000..a0cdf4a0a9a --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/MutationFunction.md @@ -0,0 +1,34 @@ +--- +id: MutationFunction +title: MutationFunction +--- + +```ts +type MutationFunction = (variables, context) => Promise; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:711 + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TVariables + +`TVariables` = `unknown` + +## Parameters + +### variables + +`TVariables` + +### context + +[`MutationFunctionContext`](MutationFunctionContext.md) + +## Returns + +`Promise`\<`TData`\> diff --git a/docs/framework/angular/reference/type-aliases/MutationFunctionContext.md b/docs/framework/angular/reference/type-aliases/MutationFunctionContext.md new file mode 100644 index 00000000000..d89f80b019e --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/MutationFunctionContext.md @@ -0,0 +1,40 @@ +--- +id: MutationFunctionContext +title: MutationFunctionContext +--- + +```ts +type MutationFunctionContext = object; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:706 + +## Properties + +### client + +```ts +client: QueryClient; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:707 + +*** + +### meta + +```ts +meta: MutationMeta | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:708 + +*** + +### mutationKey? + +```ts +optional mutationKey: MutationKey; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:709 diff --git a/docs/framework/angular/reference/type-aliases/MutationKey.md b/docs/framework/angular/reference/type-aliases/MutationKey.md new file mode 100644 index 00000000000..8c704ce1029 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/MutationKey.md @@ -0,0 +1,10 @@ +--- +id: MutationKey +title: MutationKey +--- + +```ts +type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:696 diff --git a/docs/framework/angular/reference/type-aliases/MutationMeta.md b/docs/framework/angular/reference/type-aliases/MutationMeta.md new file mode 100644 index 00000000000..68f70c02138 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/MutationMeta.md @@ -0,0 +1,10 @@ +--- +id: MutationMeta +title: MutationMeta +--- + +```ts +type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:703 diff --git a/docs/framework/angular/reference/type-aliases/MutationObserverResult.md b/docs/framework/angular/reference/type-aliases/MutationObserverResult.md new file mode 100644 index 00000000000..b4a85e897e5 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/MutationObserverResult.md @@ -0,0 +1,32 @@ +--- +id: MutationObserverResult +title: MutationObserverResult +--- + +```ts +type MutationObserverResult = + | MutationObserverIdleResult + | MutationObserverLoadingResult + | MutationObserverErrorResult +| MutationObserverSuccessResult; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:843 + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` diff --git a/docs/framework/angular/reference/type-aliases/MutationScope.md b/docs/framework/angular/reference/type-aliases/MutationScope.md new file mode 100644 index 00000000000..9d665f75b98 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/MutationScope.md @@ -0,0 +1,20 @@ +--- +id: MutationScope +title: MutationScope +--- + +```ts +type MutationScope = object; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:700 + +## Properties + +### id + +```ts +id: string; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:701 diff --git a/docs/framework/angular/reference/type-aliases/MutationStatus.md b/docs/framework/angular/reference/type-aliases/MutationStatus.md new file mode 100644 index 00000000000..3687df72ad0 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/MutationStatus.md @@ -0,0 +1,10 @@ +--- +id: MutationStatus +title: MutationStatus +--- + +```ts +type MutationStatus = "idle" | "pending" | "success" | "error"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:699 diff --git a/docs/framework/angular/reference/type-aliases/NetworkMode.md b/docs/framework/angular/reference/type-aliases/NetworkMode.md new file mode 100644 index 00000000000..bf1d4beb5b2 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/NetworkMode.md @@ -0,0 +1,10 @@ +--- +id: NetworkMode +title: NetworkMode +--- + +```ts +type NetworkMode = "online" | "always" | "offlineFirst"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:84 diff --git a/docs/framework/angular/reference/type-aliases/NonUndefinedGuard.md b/docs/framework/angular/reference/type-aliases/NonUndefinedGuard.md new file mode 100644 index 00000000000..2b3d791fe6b --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/NonUndefinedGuard.md @@ -0,0 +1,16 @@ +--- +id: NonUndefinedGuard +title: NonUndefinedGuard +--- + +```ts +type NonUndefinedGuard = T extends undefined ? never : T; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:9 + +## Type Parameters + +### T + +`T` diff --git a/docs/framework/angular/reference/type-aliases/NotifyEventType.md b/docs/framework/angular/reference/type-aliases/NotifyEventType.md new file mode 100644 index 00000000000..219ad984119 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/NotifyEventType.md @@ -0,0 +1,17 @@ +--- +id: NotifyEventType +title: NotifyEventType +--- + +```ts +type NotifyEventType = + | "added" + | "removed" + | "updated" + | "observerAdded" + | "observerRemoved" + | "observerResultsUpdated" + | "observerOptionsUpdated"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:862 diff --git a/docs/framework/angular/reference/type-aliases/NotifyOnChangeProps.md b/docs/framework/angular/reference/type-aliases/NotifyOnChangeProps.md new file mode 100644 index 00000000000..df9661cae57 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/NotifyOnChangeProps.md @@ -0,0 +1,17 @@ +--- +id: NotifyOnChangeProps +title: NotifyOnChangeProps +--- + +```ts +type NotifyOnChangeProps = + | keyof InfiniteQueryObserverResult[] + | "all" + | undefined + | () => + | keyof InfiniteQueryObserverResult[] + | "all" + | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:85 diff --git a/docs/framework/angular/reference/type-aliases/OmitKeyof.md b/docs/framework/angular/reference/type-aliases/OmitKeyof.md new file mode 100644 index 00000000000..111b9a8793e --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/OmitKeyof.md @@ -0,0 +1,28 @@ +--- +id: OmitKeyof +title: OmitKeyof +--- + +```ts +type OmitKeyof = Omit; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:11 + +## Type Parameters + +### TObject + +`TObject` + +### TKey + +`TKey` *extends* `TStrictly` *extends* `"safely"` ? + \| keyof `TObject` + \| `string` & `Record`\<`never`, `never`\> + \| `number` & `Record`\<`never`, `never`\> + \| `symbol` & `Record`\<`never`, `never`\> : keyof `TObject` + +### TStrictly + +`TStrictly` *extends* `"strictly"` \| `"safely"` = `"strictly"` diff --git a/docs/framework/angular/reference/type-aliases/Override.md b/docs/framework/angular/reference/type-aliases/Override.md new file mode 100644 index 00000000000..ae9348d04df --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/Override.md @@ -0,0 +1,20 @@ +--- +id: Override +title: Override +--- + +```ts +type Override = { [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey] }; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:12 + +## Type Parameters + +### TTargetA + +`TTargetA` + +### TTargetB + +`TTargetB` diff --git a/docs/framework/angular/reference/type-aliases/PersistQueryClientFeature.md b/docs/framework/angular/reference/type-aliases/PersistQueryClientFeature.md index cb5f2440ccc..e094e32a970 100644 --- a/docs/framework/angular/reference/type-aliases/PersistQueryClientFeature.md +++ b/docs/framework/angular/reference/type-aliases/PersistQueryClientFeature.md @@ -7,7 +7,7 @@ title: PersistQueryClientFeature type PersistQueryClientFeature = QueryFeature<"PersistQueryClient">; ``` -Defined in: [providers.ts:161](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L161) +Defined in: [packages/angular-query-experimental/src/providers.ts:161](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L161) A type alias that represents a feature which enables persistence. The type is used to describe the return value of the `withPersistQueryClient` function. diff --git a/docs/framework/angular/reference/type-aliases/PlaceholderDataFunction.md b/docs/framework/angular/reference/type-aliases/PlaceholderDataFunction.md new file mode 100644 index 00000000000..4565cc4bb51 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/PlaceholderDataFunction.md @@ -0,0 +1,42 @@ +--- +id: PlaceholderDataFunction +title: PlaceholderDataFunction +--- + +```ts +type PlaceholderDataFunction = (previousData, previousQuery) => TQueryData | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:72 + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +## Parameters + +### previousData + +`TQueryData` | `undefined` + +### previousQuery + +[`Query`](../classes/Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> | `undefined` + +## Returns + +`TQueryData` \| `undefined` diff --git a/docs/framework/angular/reference/type-aliases/QueriesOptions.md b/docs/framework/angular/reference/type-aliases/QueriesOptions.md index 02313675d29..a0f51826b76 100644 --- a/docs/framework/angular/reference/type-aliases/QueriesOptions.md +++ b/docs/framework/angular/reference/type-aliases/QueriesOptions.md @@ -7,7 +7,7 @@ title: QueriesOptions type QueriesOptions = TDepth["length"] extends MAXIMUM_DEPTH ? QueryObserverOptionsForCreateQueries[] : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetCreateQueryOptionsForCreateQueries] : T extends [infer Head, ...(infer Tails)] ? QueriesOptions<[...Tails], [...TResults, GetCreateQueryOptionsForCreateQueries], [...TDepth, 1]> : ReadonlyArray extends T ? T : T extends QueryObserverOptionsForCreateQueries[] ? QueryObserverOptionsForCreateQueries[] : QueryObserverOptionsForCreateQueries[]; ``` -Defined in: [inject-queries.ts:154](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-queries.ts#L154) +Defined in: [packages/angular-query-experimental/src/inject-queries.ts:154](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-queries.ts#L154) The `queries` array accepted by `injectQueries`. Recursively unwraps each tuple element so every entry's `queryFn`/`select`/`throwOnError` are inferred individually, up to 20 elements — past that, tuple diff --git a/docs/framework/angular/reference/type-aliases/QueriesPlaceholderDataFunction.md b/docs/framework/angular/reference/type-aliases/QueriesPlaceholderDataFunction.md new file mode 100644 index 00000000000..ef02e6aea3b --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/QueriesPlaceholderDataFunction.md @@ -0,0 +1,30 @@ +--- +id: QueriesPlaceholderDataFunction +title: QueriesPlaceholderDataFunction +--- + +```ts +type QueriesPlaceholderDataFunction = (previousData, previousQuery) => TQueryData | undefined; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:73 + +## Type Parameters + +### TQueryData + +`TQueryData` + +## Parameters + +### previousData + +`undefined` + +### previousQuery + +`undefined` + +## Returns + +`TQueryData` \| `undefined` diff --git a/docs/framework/angular/reference/type-aliases/QueriesResults.md b/docs/framework/angular/reference/type-aliases/QueriesResults.md index b44ac22ee82..e31cb61caef 100644 --- a/docs/framework/angular/reference/type-aliases/QueriesResults.md +++ b/docs/framework/angular/reference/type-aliases/QueriesResults.md @@ -7,7 +7,7 @@ title: QueriesResults type QueriesResults = TDepth["length"] extends MAXIMUM_DEPTH ? CreateQueryResult[] : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetCreateQueryResult] : T extends [infer Head, ...(infer Tails)] ? QueriesResults<[...Tails], [...TResults, GetCreateQueryResult], [...TDepth, 1]> : { [K in keyof T]: GetCreateQueryResult }; ``` -Defined in: [inject-queries.ts:205](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-queries.ts#L205) +Defined in: [packages/angular-query-experimental/src/inject-queries.ts:205](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-queries.ts#L205) The result type returned by `injectQueries`, when no `combine` is provided. Mirrors [QueriesOptions](QueriesOptions.md): each tuple element's result type is inferred individually, up to 20 elements — past that, tuple recursion diff --git a/docs/framework/angular/reference/type-aliases/QueryBooleanOption.md b/docs/framework/angular/reference/type-aliases/QueryBooleanOption.md new file mode 100644 index 00000000000..ac3db8265dd --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/QueryBooleanOption.md @@ -0,0 +1,28 @@ +--- +id: QueryBooleanOption +title: QueryBooleanOption +--- + +```ts +type QueryBooleanOption = boolean | (query) => boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:45 + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/angular/reference/type-aliases/QueryCacheNotifyEvent.md b/docs/framework/angular/reference/type-aliases/QueryCacheNotifyEvent.md new file mode 100644 index 00000000000..c6d8466de6a --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/QueryCacheNotifyEvent.md @@ -0,0 +1,21 @@ +--- +id: QueryCacheNotifyEvent +title: QueryCacheNotifyEvent +--- + +```ts +type QueryCacheNotifyEvent = + | NotifyEventQueryAdded + | NotifyEventQueryRemoved + | NotifyEventQueryUpdated + | NotifyEventQueryObserverAdded + | NotifyEventQueryObserverRemoved + | NotifyEventQueryObserverResultsUpdated + | NotifyEventQueryObserverOptionsUpdated; +``` + +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:58 + +The event passed to a `QueryCache` subscriber. Fired whenever a query is added or removed from +the cache, its state is updated (e.g. via `query.setState` or `queryClient.removeQueries`), or +one of its observers is added, removed, or has its results or options updated. diff --git a/docs/framework/angular/reference/type-aliases/QueryFeatures.md b/docs/framework/angular/reference/type-aliases/QueryFeatures.md index ca829d2faf2..ea04f398ffc 100644 --- a/docs/framework/angular/reference/type-aliases/QueryFeatures.md +++ b/docs/framework/angular/reference/type-aliases/QueryFeatures.md @@ -9,7 +9,7 @@ type QueryFeatures = | PersistQueryClientFeature; ``` -Defined in: [providers.ts:170](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L170) +Defined in: [packages/angular-query-experimental/src/providers.ts:170](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L170) A type alias that represents all Query features available for use with `provideTanStackQuery`. Features can be enabled by adding special functions to the `provideTanStackQuery` call. diff --git a/docs/framework/angular/reference/type-aliases/QueryFunction.md b/docs/framework/angular/reference/type-aliases/QueryFunction.md new file mode 100644 index 00000000000..19002dc23ef --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/QueryFunction.md @@ -0,0 +1,34 @@ +--- +id: QueryFunction +title: QueryFunction +--- + +```ts +type QueryFunction = (context) => T | Promise; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:42 + +## Type Parameters + +### T + +`T` = `unknown` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Parameters + +### context + +[`QueryFunctionContext`](QueryFunctionContext.md)\<`TQueryKey`, `TPageParam`\> + +## Returns + +`T` \| `Promise`\<`T`\> diff --git a/docs/framework/angular/reference/type-aliases/QueryFunctionContext.md b/docs/framework/angular/reference/type-aliases/QueryFunctionContext.md new file mode 100644 index 00000000000..827204a9f79 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/QueryFunctionContext.md @@ -0,0 +1,20 @@ +--- +id: QueryFunctionContext +title: QueryFunctionContext +--- + +```ts +type QueryFunctionContext = [TPageParam] extends [never] ? object : object; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:47 + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` diff --git a/docs/framework/angular/reference/type-aliases/QueryKey.md b/docs/framework/angular/reference/type-aliases/QueryKey.md new file mode 100644 index 00000000000..029efdb5756 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/QueryKey.md @@ -0,0 +1,10 @@ +--- +id: QueryKey +title: QueryKey +--- + +```ts +type QueryKey = Register extends object ? TQueryKey extends ReadonlyArray ? TQueryKey : TQueryKey extends unknown[] ? TQueryKey : ReadonlyArray : ReadonlyArray; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:20 diff --git a/docs/framework/angular/reference/type-aliases/QueryKeyHashFunction.md b/docs/framework/angular/reference/type-aliases/QueryKeyHashFunction.md new file mode 100644 index 00000000000..a72fc668ede --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/QueryKeyHashFunction.md @@ -0,0 +1,26 @@ +--- +id: QueryKeyHashFunction +title: QueryKeyHashFunction +--- + +```ts +type QueryKeyHashFunction = (queryKey) => string; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:74 + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) + +## Parameters + +### queryKey + +`TQueryKey` + +## Returns + +`string` diff --git a/docs/framework/angular/reference/type-aliases/QueryKeyWithDataTag.md b/docs/framework/angular/reference/type-aliases/QueryKeyWithDataTag.md new file mode 100644 index 00000000000..8d165d440ee --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/QueryKeyWithDataTag.md @@ -0,0 +1,34 @@ +--- +id: QueryKeyWithDataTag +title: QueryKeyWithDataTag +--- + +```ts +type QueryKeyWithDataTag = object; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:37 + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +## Properties + +### queryKey + +```ts +queryKey: DataTag; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:38 diff --git a/docs/framework/angular/reference/type-aliases/QueryMeta.md b/docs/framework/angular/reference/type-aliases/QueryMeta.md new file mode 100644 index 00000000000..bc344eb6a6b --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/QueryMeta.md @@ -0,0 +1,10 @@ +--- +id: QueryMeta +title: QueryMeta +--- + +```ts +type QueryMeta = Register extends object ? TQueryMeta extends Record ? TQueryMeta : Record : Record; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:81 diff --git a/docs/framework/angular/reference/type-aliases/QueryObserverResult.md b/docs/framework/angular/reference/type-aliases/QueryObserverResult.md new file mode 100644 index 00000000000..53aa9f89f43 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/QueryObserverResult.md @@ -0,0 +1,25 @@ +--- +id: QueryObserverResult +title: QueryObserverResult +--- + +```ts +type QueryObserverResult = + | DefinedQueryObserverResult + | QueryObserverLoadingErrorResult + | QueryObserverLoadingResult + | QueryObserverPendingResult +| QueryObserverPlaceholderResult; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:578 + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/angular/reference/type-aliases/QueryPersister.md b/docs/framework/angular/reference/type-aliases/QueryPersister.md new file mode 100644 index 00000000000..ae2aac53628 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/QueryPersister.md @@ -0,0 +1,24 @@ +--- +id: QueryPersister +title: QueryPersister +--- + +```ts +type QueryPersister = [TPageParam] extends [never] ? (queryFn, context, query) => T | Promise : (queryFn, context, query) => T | Promise; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:46 + +## Type Parameters + +### T + +`T` = `unknown` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` diff --git a/docs/framework/angular/reference/type-aliases/QueryStatus.md b/docs/framework/angular/reference/type-aliases/QueryStatus.md new file mode 100644 index 00000000000..e78d78304f8 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/QueryStatus.md @@ -0,0 +1,10 @@ +--- +id: QueryStatus +title: QueryStatus +--- + +```ts +type QueryStatus = "pending" | "error" | "success"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:382 diff --git a/docs/framework/angular/reference/type-aliases/SkipToken.md b/docs/framework/angular/reference/type-aliases/SkipToken.md new file mode 100644 index 00000000000..1844f3508c9 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/SkipToken.md @@ -0,0 +1,12 @@ +--- +id: SkipToken +title: SkipToken +--- + +```ts +type SkipToken = typeof skipToken; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:184 + +The type of the [skipToken](../variables/skipToken.md) sentinel value. diff --git a/docs/framework/angular/reference/type-aliases/StaleTime.md b/docs/framework/angular/reference/type-aliases/StaleTime.md new file mode 100644 index 00000000000..c67335d2b64 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/StaleTime.md @@ -0,0 +1,10 @@ +--- +id: StaleTime +title: StaleTime +--- + +```ts +type StaleTime = number | "static"; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:43 diff --git a/docs/framework/angular/reference/type-aliases/StaleTimeFunction.md b/docs/framework/angular/reference/type-aliases/StaleTimeFunction.md new file mode 100644 index 00000000000..92275e24061 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/StaleTimeFunction.md @@ -0,0 +1,28 @@ +--- +id: StaleTimeFunction +title: StaleTimeFunction +--- + +```ts +type StaleTimeFunction = StaleTime | (query) => StaleTime; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:44 + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/angular/reference/type-aliases/ThrowOnError.md b/docs/framework/angular/reference/type-aliases/ThrowOnError.md new file mode 100644 index 00000000000..438480ec438 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/ThrowOnError.md @@ -0,0 +1,28 @@ +--- +id: ThrowOnError +title: ThrowOnError +--- + +```ts +type ThrowOnError = boolean | (error, query) => boolean; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:202 + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` + +### TError + +`TError` + +### TQueryData + +`TQueryData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/angular/reference/type-aliases/TimeoutCallback.md b/docs/framework/angular/reference/type-aliases/TimeoutCallback.md new file mode 100644 index 00000000000..fdd610e7977 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/TimeoutCallback.md @@ -0,0 +1,27 @@ +--- +id: TimeoutCallback +title: TimeoutCallback +--- + +```ts +type TimeoutCallback = (_) => void; +``` + +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:9 + +TimeoutManager does not support passing arguments to the callback. + +`(_: void)` is the argument type inferred by TypeScript's default typings for +`setTimeout(cb, number)`. +If we don't accept a single void argument, then +`new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. + +## Parameters + +### \_ + +`void` + +## Returns + +`void` diff --git a/docs/framework/angular/reference/type-aliases/TimeoutProvider.md b/docs/framework/angular/reference/type-aliases/TimeoutProvider.md new file mode 100644 index 00000000000..e51973f15be --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/TimeoutProvider.md @@ -0,0 +1,106 @@ +--- +id: TimeoutProvider +title: TimeoutProvider +--- + +```ts +type TimeoutProvider = object; +``` + +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:22 + +Backend for timer functions. + +## Type Parameters + +### TTimerId + +`TTimerId` *extends* [`ManagedTimerId`](ManagedTimerId.md) = [`ManagedTimerId`](ManagedTimerId.md) + +## Properties + +### clearInterval() + +```ts +readonly clearInterval: (intervalId) => void; +``` + +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:26 + +#### Parameters + +##### intervalId + +`TTimerId` | `undefined` + +#### Returns + +`void` + +*** + +### clearTimeout() + +```ts +readonly clearTimeout: (timeoutId) => void; +``` + +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:24 + +#### Parameters + +##### timeoutId + +`TTimerId` | `undefined` + +#### Returns + +`void` + +*** + +### setInterval() + +```ts +readonly setInterval: (callback, delay) => TTimerId; +``` + +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:25 + +#### Parameters + +##### callback + +[`TimeoutCallback`](TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +`TTimerId` + +*** + +### setTimeout() + +```ts +readonly setTimeout: (callback, delay) => TTimerId; +``` + +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:23 + +#### Parameters + +##### callback + +[`TimeoutCallback`](TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +`TTimerId` diff --git a/docs/framework/angular/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md b/docs/framework/angular/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md index ea99866a0f0..e657351693d 100644 --- a/docs/framework/angular/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md +++ b/docs/framework/angular/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md @@ -7,7 +7,7 @@ title: UndefinedInitialDataInfiniteOptions type UndefinedInitialDataInfiniteOptions = CreateInfiniteQueryOptions & object; ``` -Defined in: [infinite-query-options.ts:24](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L24) +Defined in: [packages/angular-query-experimental/src/infinite-query-options.ts:24](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L24) The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set — `data` may be `undefined` while the query is `pending`. @@ -38,20 +38,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/angular/reference/type-aliases/UndefinedInitialDataOptions.md b/docs/framework/angular/reference/type-aliases/UndefinedInitialDataOptions.md index 28e2b4d2fbb..3814e441388 100644 --- a/docs/framework/angular/reference/type-aliases/UndefinedInitialDataOptions.md +++ b/docs/framework/angular/reference/type-aliases/UndefinedInitialDataOptions.md @@ -7,7 +7,7 @@ title: UndefinedInitialDataOptions type UndefinedInitialDataOptions = CreateQueryOptions & object; ``` -Defined in: [query-options.ts:22](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/query-options.ts#L22) +Defined in: [packages/angular-query-experimental/src/query-options.ts:22](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/query-options.ts#L22) The options accepted by the `queryOptions` overload selected when no `initialData` is set — `data` may be `undefined` while the query is `pending`. @@ -38,7 +38,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -50,6 +50,6 @@ The type `data` ends up as after `select` runs. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/angular/reference/type-aliases/UnsetMarker.md b/docs/framework/angular/reference/type-aliases/UnsetMarker.md new file mode 100644 index 00000000000..43e02873465 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/UnsetMarker.md @@ -0,0 +1,10 @@ +--- +id: UnsetMarker +title: UnsetMarker +--- + +```ts +type UnsetMarker = typeof unsetMarker; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:28 diff --git a/docs/framework/angular/reference/type-aliases/UnusedSkipTokenInfiniteOptions.md b/docs/framework/angular/reference/type-aliases/UnusedSkipTokenInfiniteOptions.md index 499287c4f00..ec9ab5c61dd 100644 --- a/docs/framework/angular/reference/type-aliases/UnusedSkipTokenInfiniteOptions.md +++ b/docs/framework/angular/reference/type-aliases/UnusedSkipTokenInfiniteOptions.md @@ -7,7 +7,7 @@ title: UnusedSkipTokenInfiniteOptions type UnusedSkipTokenInfiniteOptions = OmitKeyof, "queryFn"> & object; ``` -Defined in: [infinite-query-options.ts:64](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L64) +Defined in: [packages/angular-query-experimental/src/infinite-query-options.ts:64](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L64) The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set and `queryFn` is not `skipToken` — same as [UndefinedInitialDataInfiniteOptions](UndefinedInitialDataInfiniteOptions.md), but `queryFn` may not be @@ -36,20 +36,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/angular/reference/type-aliases/UnusedSkipTokenOptions.md b/docs/framework/angular/reference/type-aliases/UnusedSkipTokenOptions.md index dc85f4f9732..854d773b68e 100644 --- a/docs/framework/angular/reference/type-aliases/UnusedSkipTokenOptions.md +++ b/docs/framework/angular/reference/type-aliases/UnusedSkipTokenOptions.md @@ -7,7 +7,7 @@ title: UnusedSkipTokenOptions type UnusedSkipTokenOptions = OmitKeyof, "queryFn"> & object; ``` -Defined in: [query-options.ts:50](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/query-options.ts#L50) +Defined in: [packages/angular-query-experimental/src/query-options.ts:50](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/query-options.ts#L50) The options accepted by the `queryOptions` overload selected when no `initialData` is set and `queryFn` is not `skipToken` — same as [UndefinedInitialDataOptions](UndefinedInitialDataOptions.md), but `queryFn` may not be `skipToken`. @@ -35,7 +35,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -47,6 +47,6 @@ The type `data` ends up as after `select` runs. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/angular/reference/type-aliases/Updater.md b/docs/framework/angular/reference/type-aliases/Updater.md new file mode 100644 index 00000000000..eb2c7ee2f91 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/Updater.md @@ -0,0 +1,35 @@ +--- +id: Updater +title: Updater +--- + +```ts +type Updater = TOutput | (input) => TOutput; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:76 + +Either a plain value of type `TOutput`, or a function that receives `TInput` and returns `TOutput`. +Used for example by `setQueryData`-style updaters, which accept either the new data directly or a +function that computes it from the previous data. See functionalUpdate. + +## Type Parameters + +### TInput + +`TInput` + +### TOutput + +`TOutput` + +## Example + +```ts +queryClient.setQueryData(['posts'], newPosts) + +// Or, using an updater function that receives the current data: +queryClient.setQueryData(['posts'], (oldPosts) => + oldPosts ? [...oldPosts, newPost] : oldPosts, +) +``` diff --git a/docs/framework/angular/reference/type-aliases/WithRequired.md b/docs/framework/angular/reference/type-aliases/WithRequired.md new file mode 100644 index 00000000000..74ffe926792 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/WithRequired.md @@ -0,0 +1,20 @@ +--- +id: WithRequired +title: WithRequired +--- + +```ts +type WithRequired = TTarget & { [_ in TKey]: {} }; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:296 + +## Type Parameters + +### TTarget + +`TTarget` + +### TKey + +`TKey` *extends* keyof `TTarget` diff --git a/docs/framework/angular/reference/type-aliases/dataTagErrorSymbol.md b/docs/framework/angular/reference/type-aliases/dataTagErrorSymbol.md new file mode 100644 index 00000000000..c1c29257408 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/dataTagErrorSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagErrorSymbol +title: dataTagErrorSymbol +--- + +```ts +type dataTagErrorSymbol = typeof dataTagErrorSymbol; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:25 diff --git a/docs/framework/angular/reference/type-aliases/dataTagSymbol.md b/docs/framework/angular/reference/type-aliases/dataTagSymbol.md new file mode 100644 index 00000000000..0935b5bd1a6 --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/dataTagSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagSymbol +title: dataTagSymbol +--- + +```ts +type dataTagSymbol = typeof dataTagSymbol; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:23 diff --git a/docs/framework/angular/reference/variables/dataTagErrorSymbol.md b/docs/framework/angular/reference/variables/dataTagErrorSymbol.md new file mode 100644 index 00000000000..73f8a605c98 --- /dev/null +++ b/docs/framework/angular/reference/variables/dataTagErrorSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagErrorSymbol +title: dataTagErrorSymbol +--- + +```ts +const dataTagErrorSymbol: unique symbol; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:25 diff --git a/docs/framework/angular/reference/variables/dataTagSymbol.md b/docs/framework/angular/reference/variables/dataTagSymbol.md new file mode 100644 index 00000000000..14cbc63ec9b --- /dev/null +++ b/docs/framework/angular/reference/variables/dataTagSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagSymbol +title: dataTagSymbol +--- + +```ts +const dataTagSymbol: unique symbol; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:23 diff --git a/docs/framework/angular/reference/variables/defaultScheduler.md b/docs/framework/angular/reference/variables/defaultScheduler.md new file mode 100644 index 00000000000..260ac9572c2 --- /dev/null +++ b/docs/framework/angular/reference/variables/defaultScheduler.md @@ -0,0 +1,13 @@ +--- +id: defaultScheduler +title: defaultScheduler +--- + +```ts +const defaultScheduler: ScheduleFunction; +``` + +Defined in: packages/query-core/dist-ts/src/notifyManager.d.ts:10 + +Default scheduling function used by the notify manager. +Schedules the callback with the system's `setTimeout(callback, 0)`. diff --git a/docs/framework/angular/reference/variables/environmentManager.md b/docs/framework/angular/reference/variables/environmentManager.md new file mode 100644 index 00000000000..04aed247301 --- /dev/null +++ b/docs/framework/angular/reference/variables/environmentManager.md @@ -0,0 +1,38 @@ +--- +id: environmentManager +title: environmentManager +--- + +```ts +const environmentManager: object; +``` + +Defined in: packages/query-core/dist-ts/src/environmentManager.d.ts:9 + +Manages environment detection used by TanStack Query internals. + +## Type Declaration + +### isServer + +```ts +isServer: typeof isServer; +``` + +### setIsServer() + +```ts +setIsServer(isServerValue): void; +``` + +Overrides the server check globally. + +#### Parameters + +##### isServerValue + +`IsServerValue` + +#### Returns + +`void` diff --git a/docs/framework/angular/reference/variables/focusManager.md b/docs/framework/angular/reference/variables/focusManager.md new file mode 100644 index 00000000000..44cf649a6de --- /dev/null +++ b/docs/framework/angular/reference/variables/focusManager.md @@ -0,0 +1,12 @@ +--- +id: focusManager +title: focusManager +--- + +```ts +const focusManager: FocusManager; +``` + +Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:71 + +Singleton instance of FocusManager, used to manage and observe the focus state within TanStack Query. diff --git a/docs/framework/angular/reference/variables/isServer.md b/docs/framework/angular/reference/variables/isServer.md new file mode 100644 index 00000000000..ad725a61580 --- /dev/null +++ b/docs/framework/angular/reference/variables/isServer.md @@ -0,0 +1,14 @@ +--- +id: isServer +title: isServer +--- + +```ts +const isServer: boolean; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:81 + +## Deprecated + +use `environmentManager.isServer()` instead. diff --git a/docs/framework/angular/reference/variables/notifyManager.md b/docs/framework/angular/reference/variables/notifyManager.md new file mode 100644 index 00000000000..a8d4ab6335d --- /dev/null +++ b/docs/framework/angular/reference/variables/notifyManager.md @@ -0,0 +1,156 @@ +--- +id: notifyManager +title: notifyManager +--- + +```ts +const notifyManager: object; +``` + +Defined in: packages/query-core/dist-ts/src/notifyManager.d.ts:61 + +Handles scheduling and batching callbacks in TanStack Query. + +## Type Declaration + +### batch() + +```ts +readonly batch: (callback) => T; +``` + +Batches all updates scheduled inside the passed callback. +This is mainly used internally to optimize query client updating. +Batches can be nested; the queue is only flushed once the outermost `batch` call finishes. +The return value of `callback` is passed through. + +#### Type Parameters + +##### T + +`T` + +#### Parameters + +##### callback + +() => `T` + +#### Returns + +`T` + +### batchCalls() + +```ts +readonly batchCalls: (callback) => BatchCallsCallback; +``` + +All calls to the wrapped function will be batched. + +#### Type Parameters + +##### T + +`T` *extends* `unknown`[] + +#### Parameters + +##### callback + +`BatchCallsCallback`\<`T`\> + +#### Returns + +`BatchCallsCallback`\<`T`\> + +### schedule() + +```ts +readonly schedule: (callback) => void; +``` + +Schedules a function to be run on the next batch. +By default, the batch is run with a `setTimeout`, but this can be configured via `setScheduler`. + +#### Parameters + +##### callback + +`NotifyCallback` + +#### Returns + +`void` + +### setBatchNotifyFunction() + +```ts +readonly setBatchNotifyFunction: (fn) => void; +``` + +Use this method to set a custom function to batch notifications together into a single tick. +By default React Query will use the batch function provided by ReactDOM or React Native. + +#### Parameters + +##### fn + +`BatchNotifyFunction` + +#### Returns + +`void` + +### setNotifyFunction() + +```ts +readonly setNotifyFunction: (fn) => void; +``` + +Use this method to set a custom notify function. +This can be used to for example wrap notifications with `React.act` while running tests. + +#### Parameters + +##### fn + +`NotifyFunction` + +#### Returns + +`void` + +### setScheduler() + +```ts +readonly setScheduler: (fn) => void; +``` + +Configures a custom callback that schedules when the next batch runs. +The default behavior is `setTimeout(callback, 0)`. + +#### Parameters + +##### fn + +`ScheduleFunction` + +#### Returns + +`void` + +#### Example + +```ts +import { notifyManager } from '@tanstack/query-core' + +// Schedule batches in the next microtask +notifyManager.setScheduler(queueMicrotask) + +// Schedule batches before the next frame is rendered +notifyManager.setScheduler(requestAnimationFrame) + +// Schedule batches some time in the future +notifyManager.setScheduler((cb) => setTimeout(cb, 10)) +``` diff --git a/docs/framework/angular/reference/variables/onlineManager.md b/docs/framework/angular/reference/variables/onlineManager.md new file mode 100644 index 00000000000..b3539b52b37 --- /dev/null +++ b/docs/framework/angular/reference/variables/onlineManager.md @@ -0,0 +1,12 @@ +--- +id: onlineManager +title: onlineManager +--- + +```ts +const onlineManager: OnlineManager; +``` + +Defined in: packages/query-core/dist-ts/src/onlineManager.d.ts:60 + +Singleton instance of OnlineManager, used to manage and observe the online state within TanStack Query. diff --git a/docs/framework/angular/reference/variables/skipToken.md b/docs/framework/angular/reference/variables/skipToken.md new file mode 100644 index 00000000000..8c964c7d8e6 --- /dev/null +++ b/docs/framework/angular/reference/variables/skipToken.md @@ -0,0 +1,23 @@ +--- +id: skipToken +title: skipToken +--- + +```ts +const skipToken: unique symbol; +``` + +Defined in: packages/query-core/dist-ts/src/utils.d.ts:180 + +Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent +to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`, +a query disabled via `skipToken` cannot be triggered with `refetch`. + +## Example + +```ts +new QueryObserver(queryClient, { + queryKey: ['post', postId], + queryFn: postId != null ? () => fetchPost(postId) : skipToken, +}) +``` diff --git a/docs/framework/angular/reference/variables/timeoutManager.md b/docs/framework/angular/reference/variables/timeoutManager.md new file mode 100644 index 00000000000..554e83c7d57 --- /dev/null +++ b/docs/framework/angular/reference/variables/timeoutManager.md @@ -0,0 +1,12 @@ +--- +id: timeoutManager +title: timeoutManager +--- + +```ts +const timeoutManager: TimeoutManager; +``` + +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:147 + +Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/angular/reference/variables/unsetMarker.md b/docs/framework/angular/reference/variables/unsetMarker.md new file mode 100644 index 00000000000..1a34fc7d2e0 --- /dev/null +++ b/docs/framework/angular/reference/variables/unsetMarker.md @@ -0,0 +1,10 @@ +--- +id: unsetMarker +title: unsetMarker +--- + +```ts +const unsetMarker: unique symbol; +``` + +Defined in: packages/query-core/dist-ts/src/types.d.ts:27 diff --git a/docs/framework/lit/reference/classes/CancelledError.md b/docs/framework/lit/reference/classes/CancelledError.md new file mode 100644 index 00000000000..dd8b31d2c24 --- /dev/null +++ b/docs/framework/lit/reference/classes/CancelledError.md @@ -0,0 +1,75 @@ +--- +id: CancelledError +title: CancelledError +--- + +Defined in: [packages/query-core/src/retryer.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L77) + +The error thrown by a `Retryer` (and surfaced to `query.promise`/`mutation`) when a fetch is cancelled, e.g. via +`query.cancel()`. `revert`, if `true`, tells the caller to restore the state the query was in before the fetch +started instead of surfacing the error. `silent`, if `true`, tells the caller to suppress this error and instead +resolve with the promise of the fetch that triggered the cancellation. + +## Example + +```ts +query.cancel() + +try { + await query.promise +} catch (error) { + if (error instanceof CancelledError) { + // the fetch was cancelled, e.g. via `query.cancel()` + } +} +``` + +## Extends + +- `Error` + +## Constructors + +### Constructor + +```ts +new CancelledError(options?): CancelledError; +``` + +Defined in: [packages/query-core/src/retryer.ts:80](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L80) + +#### Parameters + +##### options? + +[`CancelOptions`](../interfaces/CancelOptions.md) + +#### Returns + +`CancelledError` + +#### Overrides + +```ts +Error.constructor +``` + +## Properties + +### revert? + +```ts +optional revert: boolean; +``` + +Defined in: [packages/query-core/src/retryer.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L78) + +*** + +### silent? + +```ts +optional silent: boolean; +``` + +Defined in: [packages/query-core/src/retryer.ts:79](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L79) diff --git a/docs/framework/lit/reference/classes/InfiniteQueryObserver.md b/docs/framework/lit/reference/classes/InfiniteQueryObserver.md new file mode 100644 index 00000000000..af43087a3ad --- /dev/null +++ b/docs/framework/lit/reference/classes/InfiniteQueryObserver.md @@ -0,0 +1,665 @@ +--- +id: InfiniteQueryObserver +title: InfiniteQueryObserver +--- + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L41) + +An `InfiniteQueryObserver` extends `QueryObserver` to observe and switch +between infinite queries. It augments the base `QueryObserverResult` with +infinite-query-specific fields and methods, such as `hasNextPage` and +`fetchNextPage`, and is the primitive that framework adapters (e.g. +`useInfiniteQuery`) build their hooks on top of. + +## Example + +```ts +const observer = new InfiniteQueryObserver(queryClient, { + queryKey: ['projects'], + queryFn: ({ pageParam }) => fetchProjects(pageParam), + initialPageParam: 0, + getNextPageParam: (lastPage) => lastPage.nextCursor, +}) + +const unsubscribe = observer.subscribe((result) => console.log(result)) +``` + +## Extends + +- [`QueryObserver`](QueryObserver.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Constructors + +### Constructor + +```ts +new InfiniteQueryObserver(client, options): InfiniteQueryObserver; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L83) + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`InfiniteQueryObserver`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`constructor`](QueryObserver.md#constructor) + +## Properties + +### fetch + +```ts +protected fetch: ReplaceReturnType<(fetchOptions) => Promise>, Promise>>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:72](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L72) + +#### Overrides + +```ts +QueryObserver.fetch +``` + +*** + +### getCurrentResult + +```ts +getCurrentResult: ReplaceReturnType<() => QueryObserverResult, InfiniteQueryObserverResult>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L60) + +Returns the most recently computed `QueryObserverResult` for the +observed query. This is a point-in-time read; to be notified of updates +as they happen, subscribe to the observer instead (its inherited +`subscribe` method). + +#### Example + +```ts +const result = observer.getCurrentResult() +console.log(result.status, result.data) +``` + +#### Overrides + +```ts +QueryObserver.getCurrentResult +``` + +*** + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`listeners`](QueryObserver.md#listeners) + +*** + +### options + +```ts +options: QueryObserverOptions, TQueryKey>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L89) + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`options`](QueryObserver.md#options) + +*** + +### subscribe() + +```ts +subscribe: (listener) => () => void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L55) + +#### Parameters + +##### listener + +`InfiniteQueryObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Overrides + +```ts +QueryObserver.subscribe +``` + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L96) + +#### Returns + +`void` + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`bindMethods`](QueryObserver.md#bindmethods) + +*** + +### createResult() + +```ts +protected createResult(query, options): InfiniteQueryObserverResult; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:201](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L201) + +#### Parameters + +##### query + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`createResult`](QueryObserver.md#createresult) + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L161) + +Stops observing the current query: clears all listeners, cancels the +stale and refetch-interval timers, and removes this observer from the +query it was observing. + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`destroy`](QueryObserver.md#destroy) + +*** + +### fetchNextPage() + +```ts +fetchNextPage(options?): Promise>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L161) + +Fetches the next page of the infinite query and returns a promise that +resolves with the resulting `InfiniteQueryObserverResult`. The page +param used for the fetch is determined by `getNextPageParam`, which +receives the current pages/page params and whose result also determines +`hasNextPage`. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](../interfaces/FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const { hasNextPage } = observer.getCurrentResult() + +if (hasNextPage) { + await observer.fetchNextPage() +} +``` + +#### See + +[InfiniteQueryObserver#fetchPreviousPage](#fetchpreviouspage) + +*** + +### fetchOptimistic() + +```ts +fetchOptimistic(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:395](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L395) + +Fetches a query defined by the given options without affecting this +observer's own tracked query or result, and returns a promise that +resolves with the `QueryObserverResult` for that fetch. This is useful +for prefetching data that another observer (e.g. a query about to be +navigated to) will need, ahead of time. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.fetchOptimistic({ + queryKey: ['posts', 2], + queryFn: () => fetchPost(2), +}) +console.log(result.data) +``` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`fetchOptimistic`](QueryObserver.md#fetchoptimistic) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage(options?): Promise>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:190](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L190) + +Fetches the previous page of the infinite query and returns a promise +that resolves with the resulting `InfiniteQueryObserverResult`. The page +param used for the fetch is determined by `getPreviousPageParam`, which +receives the current pages/page params and whose result also determines +`hasPreviousPage`. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](../interfaces/FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const { hasPreviousPage } = observer.getCurrentResult() + +if (hasPreviousPage) { + await observer.fetchPreviousPage() +} +``` + +#### See + +[InfiniteQueryObserver#fetchNextPage](#fetchnextpage) + +*** + +### getCurrentQuery() + +```ts +getCurrentQuery(): Query, TQueryKey>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:357](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L357) + +Returns the `Query` instance this observer is currently observing. + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`getCurrentQuery`](QueryObserver.md#getcurrentquery) + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(options): InfiniteQueryObserverResult; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L127) + +The infinite-query counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult), marking the +options as an infinite query before delegating to it. Called by framework adapters (e.g. +`useInfiniteQuery`) ahead of subscribing, to compute the current `InfiniteQueryObserverResult` +synchronously. + +#### Parameters + +##### options + +[`DefaultedInfiniteQueryObserverOptions`](../type-aliases/DefaultedInfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`getOptimisticResult`](QueryObserver.md#getoptimisticresult) + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`hasListeners`](QueryObserver.md#haslisteners) + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L110) + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`onSubscribe`](QueryObserver.md#onsubscribe) + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L124) + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`onUnsubscribe`](QueryObserver.md#onunsubscribe) + +*** + +### refetch() + +```ts +refetch(__namedParameters): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L371) + +Refetches the observed query and returns a promise that resolves with +the resulting `QueryObserverResult`. + +#### Parameters + +##### \_\_namedParameters + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.refetch({ cancelRefetch: false }) +console.log(result.data) +``` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`refetch`](QueryObserver.md#refetch) + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:108](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L108) + +Updates the observer's options. Behaves the same as +`QueryObserver.setOptions`, additionally marking the options as +belonging to an infinite query before delegating to the base +implementation. + +#### Parameters + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`void` + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`setOptions`](QueryObserver.md#setoptions) + +*** + +### shouldFetchOnReconnect() + +```ts +shouldFetchOnReconnect(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L135) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnReconnect` option) to refetch when the network +reconnects. + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`shouldFetchOnReconnect`](QueryObserver.md#shouldfetchonreconnect) + +*** + +### shouldFetchOnWindowFocus() + +```ts +shouldFetchOnWindowFocus(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L148) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnWindowFocus` option) to refetch when the window +regains focus. + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`shouldFetchOnWindowFocus`](QueryObserver.md#shouldfetchonwindowfocus) + +*** + +### trackProp() + +```ts +trackProp(key): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:350](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L350) + +Records that the given `QueryObserverResult` property was read, so a subsequent update only +notifies this observer if a tracked property actually changed. Normally called indirectly via +[QueryObserver#trackResult](QueryObserver.md#trackresult)'s proxy; exposed directly for adapters that track property +access themselves (e.g. through their own reactivity system) instead of via the proxy. + +#### Parameters + +##### key + +`"error"` | `"data"` | `"isError"` | `"isPending"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isSuccess"` | `"isPlaceholderData"` | `"status"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`trackProp`](QueryObserver.md#trackprop) + +*** + +### trackResult() + +```ts +trackResult(result, onPropTracked?): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:331](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L331) + +Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via +[QueryObserver#trackProp](QueryObserver.md#trackprop) (and an optional `onPropTracked` callback). Used by framework +adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on +properties you actually read" behavior. + +#### Parameters + +##### result + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +##### onPropTracked? + +(`key`) => `void` + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`trackResult`](QueryObserver.md#trackresult) + +*** + +### updateResult() + +```ts +updateResult(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L735) + +Recomputes and stores the current result from the current query/options, notifying listeners +if it changed. Framework adapters call this right after subscribing to make sure no query +update was missed in the gap between creating the observer and subscribing to it. + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`updateResult`](QueryObserver.md#updateresult) diff --git a/docs/framework/lit/reference/classes/Mutation.md b/docs/framework/lit/reference/classes/Mutation.md new file mode 100644 index 00000000000..4e85a5b2d4c --- /dev/null +++ b/docs/framework/lit/reference/classes/Mutation.md @@ -0,0 +1,329 @@ +--- +id: Mutation +title: Mutation +--- + +Defined in: [packages/query-core/src/mutation.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L135) + +Represents a single mutation attempt. A `Mutation` holds the mutation's +options, state (data/error/status), and the `MutationObserver`s currently +subscribed to it. + +Instances are created and managed internally by `MutationCache`; application +code typically interacts with mutations indirectly through `QueryClient` or +a framework hook like `useMutation`. Direct access to a `Mutation` instance +is possible via `mutationCache.find()`/`getAll()` for inspecting cache state. + +## Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +``` + +## Extends + +- `Removable` + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Constructors + +### Constructor + +```ts +new Mutation(config): Mutation; +``` + +Defined in: [packages/query-core/src/mutation.ts:152](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L152) + +#### Parameters + +##### config + +`MutationConfig`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`Mutation`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Overrides + +```ts +Removable.constructor +``` + +## Properties + +### gcTime + +```ts +gcTime: number; +``` + +Defined in: [packages/query-core/src/removable.ts:7](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L7) + +#### Inherited from + +```ts +Removable.gcTime +``` + +*** + +### mutationId + +```ts +readonly mutationId: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:143](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L143) + +*** + +### options + +```ts +options: MutationOptions; +``` + +Defined in: [packages/query-core/src/mutation.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L142) + +*** + +### state + +```ts +state: MutationState; +``` + +Defined in: [packages/query-core/src/mutation.ts:141](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L141) + +## Accessors + +### meta + +#### Get Signature + +```ts +get meta(): Record | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:179](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L179) + +The `meta` object passed in the mutation's options, if any. + +##### Returns + +`Record`\<`string`, `unknown`\> \| `undefined` + +## Methods + +### clearGcTimeout() + +```ts +protected clearGcTimeout(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L32) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.clearGcTimeout +``` + +*** + +### continue() + +```ts +continue(): Promise; +``` + +Defined in: [packages/query-core/src/mutation.ts:243](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L243) + +Resumes a mutation that is currently paused or was restored from a +dehydrated, still-`pending` state. + +- If this mutation has an active retryer (it paused mid-attempt, e.g. due + to the network mode or scope-based queuing), its retryer is resumed. +- Otherwise, if the mutation's status is still `pending` (e.g. it was + dehydrated while an attempt was in flight and never got a retryer in + this instance), `execute` is called again with the last known variables. +- Otherwise the mutation has already settled and this resolves immediately + without running anything again. + +#### Returns + +`Promise`\<`unknown`\> + +#### Example + +```ts +// typically driven by reconnect handling, e.g. queryClient.resumePausedMutations() +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +await mutation?.continue() +``` + +#### See + +[Mutation#execute](#execute) + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:10](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L10) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.destroy +``` + +*** + +### execute() + +```ts +execute(variables): Promise; +``` + +Defined in: [packages/query-core/src/mutation.ts:283](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L283) + +Runs the mutation function for the given variables through a retryer, and +drives the mutation's state and lifecycle callbacks through to settlement. + +If this mutation's state is already `pending` when `execute` is called +(i.e. it was restored, still in-flight, from a dehydrated state), the +`onMutate` step is skipped and a `continue` action is dispatched to +unpause it; otherwise a `pending` action is dispatched first, then the +mutation cache's `onMutate` and the mutation's own `onMutate` option are +awaited in that order, and the resulting context is stored. + +The mutation function is then run (subject to `retry`/`retryDelay`/ +`networkMode`, and to the mutation cache's scope-based serialization). +On success, the cache's `onSuccess`/`onSettled` callbacks run before the +mutation's own `onSuccess`/`onSettled` options, a `success` action is +dispatched, and the resolved data is returned. On failure, the same +cache-then-option ordering is used for `onError`/`onSettled`, but each of +those four callbacks is individually caught so that a throwing callback +cannot mask the original error; an `error` action is then dispatched and +the original error is re-thrown. + +#### Parameters + +##### variables + +`TVariables` + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +// typically invoked by MutationObserver.mutate, not called directly +const data = await mutation.execute(variables) +``` + +#### See + +[Mutation#continue](#continue) + +*** + +### optionalRemove() + +```ts +protected optionalRemove(): void; +``` + +Defined in: [packages/query-core/src/mutation.ts:212](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L212) + +#### Returns + +`void` + +#### Overrides + +```ts +Removable.optionalRemove +``` + +*** + +### scheduleGc() + +```ts +protected scheduleGc(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L14) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.scheduleGc +``` + +*** + +### updateGcTime() + +```ts +protected updateGcTime(newGcTime): void; +``` + +Defined in: [packages/query-core/src/removable.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L24) + +#### Parameters + +##### newGcTime + +`number` | `undefined` + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.updateGcTime +``` diff --git a/docs/framework/lit/reference/classes/MutationCache.md b/docs/framework/lit/reference/classes/MutationCache.md new file mode 100644 index 00000000000..cad2b065eda --- /dev/null +++ b/docs/framework/lit/reference/classes/MutationCache.md @@ -0,0 +1,308 @@ +--- +id: MutationCache +title: MutationCache +--- + +Defined in: [packages/query-core/src/mutationCache.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L117) + +The `MutationCache` is the storage for mutations. + +Normally, you will not interact with the `MutationCache` directly and instead use a +`QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of +safe/known updates to the cache, such as mutations being added, removed, or updated. + +## Extends + +- `Subscribable`\<`MutationCacheListener`\> + +## Constructors + +### Constructor + +```ts +new MutationCache(config): MutationCache; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) + +#### Parameters + +##### config + +[`MutationCacheConfig`](../interfaces/MutationCacheConfig.md) = `{}` + +#### Returns + +`MutationCache` + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### config + +```ts +config: MutationCacheConfig = {}; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) + +*** + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:229](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L229) + +Removes all mutations from the cache. + +#### Returns + +`void` + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +mutationCache.clear() +``` + +*** + +### find() + +```ts +find(filters): + | Mutation + | undefined; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L271) + +A slightly more advanced method that can be used to get an existing mutation instance from +the cache. If the mutation does not exist, `undefined` is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about a mutation in rare scenarios. + +#### Type Parameters + +##### TData + +`TData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TVariables + +`TVariables` = `any` + +##### TOnMutateResult + +`TOnMutateResult` = `unknown` + +#### Parameters + +##### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) + +#### Returns + + \| [`Mutation`](Mutation.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + \| `undefined` + +#### See + +[MutationCache#findAll](#findall) + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +``` + +*** + +### findAll() + +```ts +findAll(filters): Mutation[]; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:301](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L301) + +An even more advanced method that can be used to get existing mutation instances from the +cache that match the given filters. If no mutations match, an empty array is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about mutations in rare scenarios. + +#### Parameters + +##### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) = `{}` + +#### Returns + +[`Mutation`](Mutation.md)\<`unknown`, `Error`, `unknown`, `unknown`\>[] + +#### See + +[MutationCache#find](#find) + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutations = mutationCache.findAll({ mutationKey: ['addPost'] }) +``` + +*** + +### getAll() + +```ts +getAll(): Mutation[]; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:252](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L252) + +Returns all mutations within the cache. + +This is not typically needed for most applications, but can come in handy when needing more +information about a mutation in rare scenarios. + +#### Returns + +[`Mutation`](Mutation.md)\<`unknown`, `Error`, `unknown`, `unknown`\>[] + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutations = mutationCache.getAll() +``` + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L23) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L27) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`MutationCacheListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/lit/reference/classes/MutationObserver.md b/docs/framework/lit/reference/classes/MutationObserver.md new file mode 100644 index 00000000000..a121c67b0e8 --- /dev/null +++ b/docs/framework/lit/reference/classes/MutationObserver.md @@ -0,0 +1,335 @@ +--- +id: MutationObserver +title: MutationObserver +--- + +Defined in: [packages/query-core/src/mutationObserver.ts:38](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L38) + +Observes a single mutation and derives a `MutationObserverResult` from it. +A framework hook like `useMutation` creates one `MutationObserver` per hook +call, keeps it stable across re-renders, calls `setOptions` when the options +passed to the hook change, subscribes to it to re-render on updates, and +reads `getCurrentResult()` for the value to return. Calling `mutate()` +builds a new underlying `Mutation` in the `MutationCache` and executes it. + +## Example + +```ts +const observer = new MutationObserver(queryClient, { + mutationFn: (variables: { title: string }) => addPost(variables), +}) +``` + +## Extends + +- `Subscribable`\<`MutationObserverListener`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Constructors + +### Constructor + +```ts +new MutationObserver(client, options): MutationObserver; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:58](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L58) + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`MutationObserver`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Overrides + +```ts +Subscribable< + MutationObserverListener +>.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +*** + +### options + +```ts +options: MutationObserverOptions; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:46](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L46) + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L75) + +#### Returns + +`void` + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): MutationObserverResult; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:155](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L155) + +Returns the observer's current result, derived from the observed +mutation's state (or the default, `idle` state if no mutation has been +built yet, e.g. before the first `mutate()` call or after `reset()`). + +#### Returns + +[`MutationObserverResult`](../type-aliases/MutationObserverResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### mutate() + +```ts +mutate(variables, options?): Promise; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:207](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L207) + +Builds a new `Mutation` in the `MutationCache` using the observer's +current options, detaches this observer from any previously observed +mutation, attaches it to the new one, and executes it with the given +variables. + +The optional per-call `options` (`onSuccess`/`onError`/`onSettled`) are +invoked once the mutation settles, in addition to any callbacks defined +on the observer's own options. + +#### Parameters + +##### variables + +`TVariables` + +##### options? + +[`MutateOptions`](../interfaces/MutateOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +await observer.mutate( + { title: 'New post' }, + { onSuccess: (data) => console.log(data) }, +) +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L127) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L135) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### reset() + +```ts +reset(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L180) + +Detaches the observer from the mutation it is currently observing (if +any) and resets the observed result back to its default, `idle` state. + +This does not cancel an in-flight mutation; the mutation itself keeps +running to completion and its own callbacks still fire, but this +observer stops reflecting its state and a subsequent `mutate()` call +will build a brand new mutation. + +#### Returns + +`void` + +#### Example + +```ts +observer.reset() +``` + +#### See + +[MutationObserver#mutate](#mutate) + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L96) + +Updates the observer's options. + +If the new `mutationKey` differs from the previous one (and both were +defined), the observer is reset, detaching it from the mutation it was +observing. Otherwise, if the currently observed mutation is still +`pending`, its options are updated in place as well. + +#### Parameters + +##### options + +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setOptions({ + mutationFn: (variables: { title: string }) => addPost(variables), + onSuccess: (data) => console.log(data), +}) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`MutationObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/lit/reference/classes/QueriesObserver.md b/docs/framework/lit/reference/classes/QueriesObserver.md new file mode 100644 index 00000000000..2b593b06e6a --- /dev/null +++ b/docs/framework/lit/reference/classes/QueriesObserver.md @@ -0,0 +1,325 @@ +--- +id: QueriesObserver +title: QueriesObserver +--- + +Defined in: [packages/query-core/src/queriesObserver.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L54) + +A `QueriesObserver` watches an array of queries at once, exposing them as +a single array of `QueryObserverResult`s (or, when a `combine` option is +given, as a combined value derived from that array). It manages one +internal `QueryObserver` per query, and is the primitive that framework +adapters (e.g. `useQueries`) build their hooks on top of. + +## Example + +```ts +const observer = new QueriesObserver(queryClient, [ + { queryKey: ['post', 1], queryFn: fetchPost }, + { queryKey: ['post', 2], queryFn: fetchPost }, +]) + +const unsubscribe = observer.subscribe((result) => { + console.log(result) +}) +``` + +## Extends + +- `Subscribable`\<`QueriesObserverListener`\> + +## Type Parameters + +### TCombinedResult + +`TCombinedResult` = [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +## Constructors + +### Constructor + +```ts +new QueriesObserver( + client, + queries, +options?): QueriesObserver; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L68) + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`any`, `any`, `any`, `any`, `any`, `never`\>[] + +##### options? + +[`QueriesObserverOptions`](../interfaces/QueriesObserverOptions.md)\<`TCombinedResult`\> + +#### Returns + +`QueriesObserver`\<`TCombinedResult`\> + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L104) + +Stops observing all queries: clears all listeners and destroys every +underlying `QueryObserver` this observer manages. + +#### Returns + +`void` + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): QueryObserverResult[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L208) + +Returns the most recently computed array of `QueryObserverResult`s, one +per observed query, in the same order as the queries passed to the +constructor or `setQueries`. + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +#### Example + +```ts +const results = observer.getCurrentResult() +const data = results.map((result) => result.data) +``` + +*** + +### getObservers() + +```ts +getObservers(): QueryObserver[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L225) + +Returns the underlying `QueryObserver` instances this observer manages, +in the same order as the queries passed to the constructor or +`setQueries`. + +#### Returns + +[`QueryObserver`](QueryObserver.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[]\>[] + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(queries, combine): [QueryObserverResult[], (r?) => TCombinedResult, () => QueryObserverResult[]]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L236) + +The `QueriesObserver` counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult) — computes +the result for the given (already-defaulted) queries right now, synchronously. Called by +framework adapters (e.g. `useQueries`) ahead of subscribing, returning a tuple of the raw +per-query results, a function to compute the combined result from them, and a function to +wrap the results for property-access tracking. + +#### Parameters + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[], `never`\>[] + +##### combine + +`CombineFn`\<`TCombinedResult`\> | `undefined` + +#### Returns + +\[[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[], (`r?`) => `TCombinedResult`, () => [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[]\] + +*** + +### getQueries() + +```ts +getQueries(): Query[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:216](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L216) + +Returns the underlying `Query` instances currently being observed, in +the same order as the queries passed to the constructor or `setQueries`. + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L84) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L94) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setQueries() + +```ts +setQueries(queries, options?): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:125](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L125) + +Replaces the set of queries being observed. Existing `QueryObserver`s +are reused for queries that match an already-observed query hash; +observers for queries that are no longer present are destroyed, and new +observers are created and subscribed to for newly added queries. + +#### Parameters + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[], `never`\>[] + +##### options? + +[`QueriesObserverOptions`](../interfaces/QueriesObserverOptions.md)\<`TCombinedResult`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setQueries([ + { queryKey: ['post', 1], queryFn: fetchPost }, + { queryKey: ['post', 3], queryFn: fetchPost }, +]) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueriesObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/lit/reference/classes/Query.md b/docs/framework/lit/reference/classes/Query.md new file mode 100644 index 00000000000..bc15461e541 --- /dev/null +++ b/docs/framework/lit/reference/classes/Query.md @@ -0,0 +1,585 @@ +--- +id: Query +title: Query +--- + +Defined in: [packages/query-core/src/query.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L225) + +Represents a single cached query. A `Query` holds the query's key, options, +state (data/error/status), and the observers currently subscribed to it. + +Instances are created and managed internally by `QueryCache`; application +code typically interacts with queries indirectly through `QueryClient` or +a framework hook like `useQuery`. Direct access to a `Query` instance is +possible via `queryCache.find()`/`findAll()` for inspecting cache state. + +## Example + +```ts +const queryCache = queryClient.getQueryCache() +const query = queryCache.find({ queryKey: ['posts'] }) + +if (query) { + console.log(query.state.dataUpdatedAt) +} +``` + +## Extends + +- `Removable` + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Constructors + +### Constructor + +```ts +new Query(config): Query; +``` + +Defined in: [packages/query-core/src/query.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L246) + +#### Parameters + +##### config + +`QueryConfig`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Query`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Overrides + +```ts +Removable.constructor +``` + +## Properties + +### gcTime + +```ts +gcTime: number; +``` + +Defined in: [packages/query-core/src/removable.ts:7](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L7) + +#### Inherited from + +```ts +Removable.gcTime +``` + +*** + +### observers + +```ts +observers: QueryObserver[]; +``` + +Defined in: [packages/query-core/src/query.ts:242](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L242) + +*** + +### options + +```ts +options: QueryOptions; +``` + +Defined in: [packages/query-core/src/query.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L233) + +*** + +### queryHash + +```ts +queryHash: string; +``` + +Defined in: [packages/query-core/src/query.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L232) + +*** + +### queryKey + +```ts +queryKey: TQueryKey; +``` + +Defined in: [packages/query-core/src/query.ts:231](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L231) + +*** + +### state + +```ts +state: QueryState; +``` + +Defined in: [packages/query-core/src/query.ts:234](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L234) + +## Accessors + +### meta + +#### Get Signature + +```ts +get meta(): Record | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L264) + +The `meta` object passed in the query's options, if any. + +##### Returns + +`Record`\<`string`, `unknown`\> \| `undefined` + +*** + +### promise + +#### Get Signature + +```ts +get promise(): Promise | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L277) + +The promise for the currently in-flight fetch, if the query is fetching. +`undefined` when the query is not fetching. + +##### Returns + +`Promise`\<`TData`\> \| `undefined` + +## Methods + +### cancel() + +```ts +cancel(options?): Promise; +``` + +Defined in: [packages/query-core/src/query.ts:348](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L348) + +Cancels the query's currently in-flight fetch, if any. +- Returns a promise that resolves once the cancellation has settled. +- If no fetch is in progress, resolves immediately. + +#### Parameters + +##### options? + +[`CancelOptions`](../interfaces/CancelOptions.md) + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await query.cancel() +``` + +*** + +### clearGcTimeout() + +```ts +protected clearGcTimeout(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L32) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.clearGcTimeout +``` + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/query.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L361) + +Clears the query's garbage collection timeout and silently cancels any +in-flight fetch. Called by `QueryCache` when the query is removed from +the cache. + +#### Returns + +`void` + +#### See + +[Query#cancel](#cancel) + +#### Overrides + +```ts +Removable.destroy +``` + +*** + +### fetch() + +```ts +fetch(options?, fetchOptions?): Promise; +``` + +Defined in: [packages/query-core/src/query.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L590) + +Fetches the query, i.e. runs its `queryFn` (through any configured +retryer/behavior) and updates the query's state with the result. +- If a fetch is already in flight, returns its promise instead of + starting a new one, unless `fetchOptions.cancelRefetch` is set and the + query already has data, in which case the current fetch is silently + cancelled first. +- If `options` is passed, it replaces the query's current options + before fetching. + +#### Parameters + +##### options? + +[`QueryOptions`](../interfaces/QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\> + +##### fetchOptions? + +`FetchOptions`\<`TQueryFnData`\> + +#### Returns + +`Promise`\<`TData`\> + +*** + +### getObserversCount() + +```ts +getObserversCount(): number; +``` + +Defined in: [packages/query-core/src/query.ts:560](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L560) + +Returns the number of observers currently subscribed to this query. + +#### Returns + +`number` + +#### Example + +```ts +if (query.getObserversCount() === 0) { + // no component is currently watching this query +} +``` + +*** + +### invalidate() + +```ts +invalidate(): void; +``` + +Defined in: [packages/query-core/src/query.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L574) + +Marks the query as invalidated, unless it is already invalidated. This +updates `state.isInvalidated` and notifies observers, but does not by +itself trigger a refetch. + +#### Returns + +`void` + +#### Example + +```ts +query.invalidate() +``` + +*** + +### isActive() + +```ts +isActive(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:386](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L386) + +Returns `true` if the query has at least one observer for which `enabled` +does not resolve to `false`. + +#### Returns + +`boolean` + +*** + +### isDisabled() + +```ts +isDisabled(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:400](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L400) + +Returns `true` if the query is disabled, meaning it will not fetch +automatically. +- If the query has observers, it is disabled when none of them are active + (see `isActive`). +- If the query has no observers, it is disabled when its `queryFn` is + `skipToken` or it has never been fetched. + +#### Returns + +`boolean` + +*** + +### isFetched() + +```ts +isFetched(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:412](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L412) + +Returns `true` if the query has been fetched, i.e. it has resolved with +either data or an error at least once. + +#### Returns + +`boolean` + +*** + +### isStale() + +```ts +isStale(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:447](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L447) + +Returns `true` if the query is stale. +- If the query has observers, defers to whether any observer's current + result reports `isStale` (which accounts for each observer's own + `staleTime` and `enabled` state). +- If the query has no observers, it is considered stale when it has no + data or has been invalidated. + +#### Returns + +`boolean` + +#### See + +[Query#isStaleByTime](#isstalebytime) + +#### Example + +```ts +if (query.isStale()) { + // refetch or otherwise treat the cached data as outdated +} +``` + +*** + +### isStaleByTime() + +```ts +isStaleByTime(staleTime): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:473](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L473) + +Returns `true` if the query's data is stale relative to the given +`staleTime` (defaults to `0`). +- A query with no data is always stale. +- `staleTime: 'static'` is never stale. +- An invalidated query is always stale. +- Otherwise, staleness is based on elapsed time since `dataUpdatedAt`. + +#### Parameters + +##### staleTime + +[`StaleTime`](../type-aliases/StaleTime.md) = `0` + +#### Returns + +`boolean` + +#### See + +[Query#isStale](#isstale) + +#### Example + +```ts +const isStale = query.isStaleByTime(1000 * 60) +``` + +*** + +### isStatic() + +```ts +isStatic(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:420](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L420) + +Returns `true` if the query has at least one observer configured with +`staleTime: 'static'`, meaning it is treated as never stale. + +#### Returns + +`boolean` + +*** + +### optionalRemove() + +```ts +protected optionalRemove(): void; +``` + +Defined in: [packages/query-core/src/query.ts:305](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L305) + +#### Returns + +`void` + +#### Overrides + +```ts +Removable.optionalRemove +``` + +*** + +### reset() + +```ts +reset(): void; +``` + +Defined in: [packages/query-core/src/query.ts:377](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L377) + +Resets the query back to its initial state (the state it had when it was +first created, e.g. any `initialData`), destroying it first to cancel any +in-flight fetch. + +#### Returns + +`void` + +*** + +### scheduleGc() + +```ts +protected scheduleGc(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L14) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.scheduleGc +``` + +*** + +### setState() + +```ts +setState(state): void; +``` + +Defined in: [packages/query-core/src/query.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L334) + +Merges the given partial state directly into this query's state, notifying observers. Used +by persistence and broadcast plugins to restore a state snapshot, and by devtools to let a +user manually trigger a loading/error state or edit the cached data. + +#### Parameters + +##### state + +`Partial`\<[`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\>\> + +#### Returns + +`void` + +*** + +### updateGcTime() + +```ts +protected updateGcTime(newGcTime): void; +``` + +Defined in: [packages/query-core/src/removable.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L24) + +#### Parameters + +##### newGcTime + +`number` | `undefined` + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.updateGcTime +``` diff --git a/docs/framework/lit/reference/classes/QueryCache.md b/docs/framework/lit/reference/classes/QueryCache.md new file mode 100644 index 00000000000..2b9aeb6e26a --- /dev/null +++ b/docs/framework/lit/reference/classes/QueryCache.md @@ -0,0 +1,461 @@ +--- +id: QueryCache +title: QueryCache +--- + +Defined in: [packages/query-core/src/queryCache.ts:113](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L113) + +The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta +information, and state of the queries it contains. + +Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient` +for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of +safe/known updates to the cache, such as queries being added, removed, or updated. + +## Extends + +- `Subscribable`\<`QueryCacheListener`\> + +## Constructors + +### Constructor + +```ts +new QueryCache(config): QueryCache; +``` + +Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) + +#### Parameters + +##### config + +[`QueryCacheConfig`](../interfaces/QueryCacheConfig.md) = `{}` + +#### Returns + +`QueryCache` + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### config + +```ts +config: QueryCacheConfig = {}; +``` + +Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) + +*** + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### build() + +```ts +build( + client, + options, +state?): Query; +``` + +Defined in: [packages/query-core/src/queryCache.ts:137](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L137) + +Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or +builds and adds a new one to the cache if none exists yet. Used by framework adapters and +plugins (e.g. broadcast/persistence) that need to get-or-create a `Query` directly, bypassing +the reactive `QueryObserver` machinery. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](../interfaces/QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\>, `"queryKey"`\> + +##### state? + +[`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\> + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const query = queryCache.build(queryClient, { + queryKey: ['posts'], + queryFn: fetchPosts, +}) +``` + +*** + +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:222](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L222) + +Removes all queries from the cache. + +#### Returns + +`void` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +queryCache.clear() +``` + +*** + +### find() + +```ts +find(filters): + | Query + | undefined; +``` + +Defined in: [packages/query-core/src/queryCache.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L289) + +A slightly more advanced method that can be used to get an existing query instance from the +cache. This instance not only contains all the state for the query, but all of the instances, +and underlying guts of the query as well. If the query does not exist, `undefined` is +returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about a query in rare scenarios (e.g. looking at `query.state.dataUpdatedAt` to +decide whether a query is fresh enough to be used as an initial value). + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +#### Parameters + +##### filters + +[`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryFilters`](../interfaces/QueryFilters.md)\, `"queryKey"`\> + +#### Returns + + \| [`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, readonly `unknown`[]\> + \| `undefined` + +#### See + +[QueryCache#findAll](#findall) + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const query = queryCache.find({ queryKey: ['posts'] }) +``` + +*** + +### findAll() + +```ts +findAll(filters): Query[]; +``` + +Defined in: [packages/query-core/src/queryCache.ts:314](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L314) + +An even more advanced method that can be used to get existing query instances from the cache +that partially match a query key. If no queries match, an empty array is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about queries in rare scenarios. + +#### Parameters + +##### filters + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = `{}` + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +#### See + +[QueryCache#find](#find) + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const queries = queryCache.findAll({ queryKey: ['posts'] }) +``` + +*** + +### get() + +```ts +get(queryHash): + | Query + | undefined; +``` + +Defined in: [packages/query-core/src/queryCache.ts:244](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L244) + +Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none +exists. Unlike [QueryCache#find](#find), this looks up by the already-computed hash rather +than by `QueryFilters`. Used by plugins (e.g. broadcast/hydration) that already have a hash +to look up directly. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### queryHash + +`string` + +#### Returns + + \| [`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + \| `undefined` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() +const queryHash = hashKey(['posts']) + +const query = queryCache.get(queryHash) +``` + +*** + +### getAll() + +```ts +getAll(): Query[]; +``` + +Defined in: [packages/query-core/src/queryCache.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L267) + +Returns all queries within the cache. + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const queries = queryCache.getAll() +``` + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L23) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L27) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### remove() + +```ts +remove(query): void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:198](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L198) + +Destroys the given `Query` and removes it from the cache, notifying subscribers with a +`'removed'` event. A no-op if the query is no longer the one currently stored under its hash +(e.g. it was already replaced). Used by plugins (e.g. the broadcast client) that mirror +removals across `QueryCache` instances. + +#### Parameters + +##### query + +[`Query`](Query.md)\<`any`, `any`, `any`, `any`\> + +#### Returns + +`void` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() +const query = queryCache.find({ queryKey: ['posts'] }) + +if (query) { + queryCache.remove(query) +} +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueryCacheListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/lit/reference/classes/QueryClient.md b/docs/framework/lit/reference/classes/QueryClient.md new file mode 100644 index 00000000000..7c44606f696 --- /dev/null +++ b/docs/framework/lit/reference/classes/QueryClient.md @@ -0,0 +1,1455 @@ +--- +id: QueryClient +title: QueryClient +--- + +Defined in: [packages/query-core/src/queryClient.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L78) + +`QueryClient` is used to interact with a cache of queries and mutations. It owns a +`QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds +the default options that are applied to queries and mutations created through it. + +```ts +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + staleTime: Infinity, + }, + }, +}) + +await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts }) +``` + +## Constructors + +### Constructor + +```ts +new QueryClient(config): QueryClient; +``` + +Defined in: [packages/query-core/src/queryClient.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L88) + +#### Parameters + +##### config + +[`QueryClientConfig`](../interfaces/QueryClientConfig.md) = `{}` + +#### Returns + +`QueryClient` + +## Methods + +### cancelQueries() + +```ts +cancelQueries(filters?, cancelOptions?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L425) + +Cancels outgoing fetches for queries matching the given filters. Most useful when performing +optimistic updates, since any outgoing refetch that resolves afterwards would otherwise +overwrite the optimistic update. By default (`revert: true`), a cancelled query's data is +reverted to its state before the outgoing fetch started. + +The returned promise never rejects, even if individual cancellations fail. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +##### cancelOptions? + +[`CancelOptions`](../interfaces/CancelOptions.md) = `{}` + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.cancelQueries({ queryKey: ['posts'], exact: true }) +``` + +*** + +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1073) + +Clears both the query cache and the mutation cache this client is connected to. + +#### Returns + +`void` + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +queryClient.clear() +``` + +*** + +### defaultMutationOptions() + +```ts +defaultMutationOptions(options?): T; +``` + +Defined in: [packages/query-core/src/queryClient.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1047) + +The mutation counterpart of [QueryClient#defaultQueryOptions](#defaultqueryoptions). Called by framework +adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the +given `mutationKey`, then the client's `defaultOptions.mutations`, then the caller's options +on top. A no-op if the options are already defaulted (`_defaulted: true`). + +#### Type Parameters + +##### T + +`T` *extends* [`MutationOptions`](../interfaces/MutationOptions.md)\<`any`, `any`, `any`, `any`\> + +#### Parameters + +##### options? + +`T` + +#### Returns + +`T` + +*** + +### defaultQueryOptions() + +```ts +defaultQueryOptions(options): DefaultedQueryObserverOptions; +``` + +Defined in: [packages/query-core/src/queryClient.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L960) + +Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the +caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the +given `queryKey`, then the client's own `defaultOptions.queries`, then the caller's options +on top. A no-op if the options are already defaulted (`_defaulted: true`). + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\> | [`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +*** + +### ~~ensureInfiniteQueryData()~~ + +```ts +ensureInfiniteQueryData(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryClient.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L725) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`EnsureInfiniteQueryDataOptions`](../type-aliases/EnsureInfiniteQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\> + +#### Deprecated + +Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version. + +*** + +### ~~ensureQueryData()~~ + +```ts +ensureQueryData(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L196) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### options + +[`EnsureQueryDataOptions`](../interfaces/EnsureQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Deprecated + +Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version. + +*** + +### ~~fetchInfiniteQuery()~~ + +```ts +fetchInfiniteQuery(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryClient.ts:682](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L682) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\> + +#### Deprecated + +Use queryClient.infiniteQuery(options) instead. This method will be removed in the next major version. + +*** + +### ~~fetchQuery()~~ + +```ts +fetchQuery(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L590) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Deprecated + +Use queryClient.query(options) instead. This method will be removed in the next major version. + +*** + +### getDefaultOptions() + +```ts +getDefaultOptions(): DefaultOptions; +``` + +Defined in: [packages/query-core/src/queryClient.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L808) + +Returns the default options that were set when creating the client, or via +[QueryClient#setDefaultOptions](#setdefaultoptions). + +#### Returns + +[`DefaultOptions`](../interfaces/DefaultOptions.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const defaultOptions = queryClient.getDefaultOptions() +``` + +*** + +### getMutationCache() + +```ts +getMutationCache(): MutationCache; +``` + +Defined in: [packages/query-core/src/queryClient.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L792) + +Returns the mutation cache this client is connected to. + +#### Returns + +[`MutationCache`](MutationCache.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const mutationCache = queryClient.getMutationCache() +const mutations = mutationCache.findAll({ status: 'pending' }) +``` + +*** + +### getMutationDefaults() + +```ts +getMutationDefaults(mutationKey): OmitKeyof, "mutationKey">; +``` + +Defined in: [packages/query-core/src/queryClient.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L935) + +Returns the default options registered for mutations whose mutation key partially matches +the given `mutationKey`, via [QueryClient#setMutationDefaults](#setmutationdefaults). If multiple registered +defaults match, they are merged together in registration order. + +#### Parameters + +##### mutationKey + +readonly `unknown`[] + +#### Returns + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`any`, `any`, `any`, `any`\>, `"mutationKey"`\> + +#### Example + +```ts +const defaultOptions = queryClient.getMutationDefaults(['addPost']) +``` + +*** + +### getQueriesData() + +```ts +getQueriesData(filters): [readonly unknown[], TQueryFnData | undefined][]; +``` + +Defined in: [packages/query-core/src/queryClient.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L233) + +Imperative (non-reactive) way to retrieve the cached data of multiple queries at once. +Only queries matching the given filters are returned; if none match, an empty array is +returned. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters + +`TQueryFilters` + +#### Returns + +\[readonly `unknown`[], `TQueryFnData` \| `undefined`\][] + +#### See + +[QueryClient#getQueryData](#getquerydata) + +#### Example + +```ts +const data = queryClient.getQueriesData({ queryKey: ['posts'] }) +``` + +*** + +### getQueryCache() + +```ts +getQueryCache(): QueryCache; +``` + +Defined in: [packages/query-core/src/queryClient.ts:776](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L776) + +Returns the query cache this client is connected to. + +#### Returns + +[`QueryCache`](QueryCache.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const queryCache = queryClient.getQueryCache() +const queries = queryCache.findAll({ queryKey: ['posts'] }) +``` + +*** + +### getQueryData() + +```ts +getQueryData(queryKey): TInferredQueryFnData | undefined; +``` + +Defined in: [packages/query-core/src/queryClient.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L182) + +Imperative (non-reactive) way to retrieve data for a QueryKey. +Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. + +Hint: Do not use this function inside a component, because it won't receive updates. +Use `useQuery` to create a `QueryObserver` that subscribes to changes. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +#### Returns + +`TInferredQueryFnData` \| `undefined` + +#### See + +[QueryClient#getQueriesData](#getqueriesdata) + +*** + +### getQueryDefaults() + +```ts +getQueryDefaults(queryKey): OmitKeyof, "queryKey">; +``` + +Defined in: [packages/query-core/src/queryClient.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L878) + +Returns the default options registered for queries whose query key partially matches the +given `queryKey`, via [QueryClient#setQueryDefaults](#setquerydefaults). If multiple registered defaults +match, they are merged together in registration order. + +#### Parameters + +##### queryKey + +readonly `unknown`[] + +#### Returns + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`any`, `any`, `any`, `any`, `any`\>, `"queryKey"`\> + +#### Example + +```ts +const defaultOptions = queryClient.getQueryDefaults(['posts']) +``` + +*** + +### getQueryState() + +```ts +getQueryState(queryKey): + | QueryState + | undefined; +``` + +Defined in: [packages/query-core/src/queryClient.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L343) + +Imperative (non-reactive) way to retrieve an existing query's state. If the query does not +exist, `undefined` is returned. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +##### TInferredError + +`TInferredError` = [`InferErrorFromTag`](../type-aliases/InferErrorFromTag.md)\<`TError`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +#### Returns + + \| [`QueryState`](../interfaces/QueryState.md)\<`TInferredQueryFnData`, `TInferredError`\> + \| `undefined` + +#### Example + +```ts +const state = queryClient.getQueryState(['posts']) +console.log(state?.dataUpdatedAt) +``` + +*** + +### infiniteQuery() + +```ts +infiniteQuery(options): Promise[] ? InfiniteData : TData>; +``` + +Defined in: [packages/query-core/src/queryClient.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L656) + +Asynchronous method to fetch and cache an infinite query, resolving with an +[InfiniteData](../interfaces/InfiniteData.md) object or throwing with the error. + +Behaves like [QueryClient#query](#query), accepting the same options (minus +`initialPageParam`), plus the required `initialPageParam`, and an optional `pages` / +`getNextPageParam` pair used to refetch a fixed number of pages from the start. + +This method replaces the deprecated `fetchInfiniteQuery`, and — combined with +`{ staleTime: 'static' }` — the deprecated `ensureInfiniteQueryData`. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`InfiniteQueryExecuteOptions`](../type-aliases/InfiniteQueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`[] *extends* [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>[] ? [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\> : `TData`\> + +#### Example + +```ts +try { + const data = await queryClient.infiniteQuery({ queryKey, queryFn, initialPageParam: 0 }) + console.log(data.pages) +} catch (error) { + console.log(error) +} +``` + +*** + +### invalidateQueries() + +```ts +invalidateQueries(filters?, options?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:453](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L453) + +Marks queries matching the given filters as invalidated. Unlike +[QueryClient#removeQueries](#removequeries), invalidated queries stay in the cache. + +Unless `filters.refetchType` is `'none'`, matching queries are then refetched via +[QueryClient#refetchQueries](#refetchqueries), using `filters.refetchType` if set, otherwise +`filters.type`, otherwise `'active'`. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`InvalidateQueryFilters`](../interfaces/InvalidateQueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`InvalidateOptions`](../interfaces/InvalidateOptions.md) = `{}` + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' }) +``` + +*** + +### isFetching() + +```ts +isFetching(filters?): number; +``` + +Defined in: [packages/query-core/src/queryClient.ts:149](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L149) + +Returns the number of queries in the cache that are currently fetching, optionally +matching a set of filters. This includes background-fetching, loading new pages, and +loading more infinite query results. + +#### Type Parameters + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters? + +`TQueryFilters` + +#### Returns + +`number` + +#### Example + +```ts +if (queryClient.isFetching()) { + console.log('At least one query is fetching!') +} +``` + +*** + +### isMutating() + +```ts +isMutating(filters?): number; +``` + +Defined in: [packages/query-core/src/queryClient.ts:167](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L167) + +Returns the number of mutations in the cache that are currently pending, optionally +matching a set of filters. + +#### Type Parameters + +##### TMutationFilters + +`TMutationFilters` *extends* [`MutationFilters`](../interfaces/MutationFilters.md)\<`any`, `any`, `unknown`, `unknown`\> = [`MutationFilters`](../interfaces/MutationFilters.md)\<`unknown`, `Error`, `unknown`, `unknown`\> + +#### Parameters + +##### filters? + +`TMutationFilters` + +#### Returns + +`number` + +#### Example + +```ts +if (queryClient.isMutating()) { + console.log('At least one mutation is pending!') +} +``` + +*** + +### mount() + +```ts +mount(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L103) + +Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start +listening for focus/online events and resume paused mutations. Ref-counted via an internal +mount count, so nested or multiple providers sharing the same `QueryClient` don't tear down +the shared listeners until the last one unmounts. + +#### Returns + +`void` + +*** + +### ~~prefetchInfiniteQuery()~~ + +```ts +prefetchInfiniteQuery(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L704) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`void`\> + +#### Deprecated + +Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version. + +*** + +### ~~prefetchQuery()~~ + +```ts +prefetchQuery(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:624](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L624) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### options + +[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Promise`\<`void`\> + +#### Deprecated + +Use queryClient.query(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version. + +*** + +### query() + +```ts +query(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:544](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L544) + +Asynchronous method to fetch and cache a query, resolving with the data or throwing with +the error. + +If the query already exists in the cache and its data is not stale (per the given +`staleTime`), the cached data is returned without fetching. Otherwise, the query is fetched +and the promise resolves once the fetch settles. If a `select` function is provided, it is +applied to the data in both cases (cached or freshly fetched) before it is returned. + +Unlike `useQuery`, retries are disabled by default here (`retry: false`) unless explicitly +configured, since there is no component to catch a thrown error and retry through re-render. + +The accepted options are a subset of `useQuery`'s options: fields that only make sense for a +reactive observer (e.g. `enabled`, `refetchInterval`, `refetchOnWindowFocus`, `notifyOnChangeProps`, +`throwOnError`, `suspense`, `placeholderData`) are not part of this method's options. + +This method replaces the deprecated `fetchQuery`, and — combined with +`{ staleTime: 'static' }` — the deprecated `ensureQueryData`. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`QueryExecuteOptions`](../interfaces/QueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +try { + const data = await queryClient.query({ queryKey, queryFn, staleTime: 10000 }) +} catch (error) { + console.log(error) +} +``` + +*** + +### refetchQueries() + +```ts +refetchQueries(filters?, options?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:490](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L490) + +Refetches queries matching the given filters, regardless of whether they are stale. Without +filters, every query in the cache is refetched. Queries that are disabled, or static (only +have observers with a static `staleTime`), are never refetched. + +By default (`cancelRefetch: true`), a currently running fetch is cancelled before the new +one starts. The returned promise resolves once all matching queries have settled; it does +not reject on individual query failures unless `throwOnError` is set. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`RefetchQueryFilters`](../interfaces/RefetchQueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +// refetch all active queries partially matching a query key: +await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' }) +``` + +*** + +### removeQueries() + +```ts +removeQueries(filters?): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:369](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L369) + +Removes queries from the cache that match the given filters. Unlike +[QueryClient#invalidateQueries](#invalidatequeries) or [QueryClient#refetchQueries](#refetchqueries), this removes +matching queries from the cache instead of refetching them. Without filters, every query in +the cache is removed. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +#### Returns + +`void` + +#### Example + +```ts +queryClient.removeQueries({ queryKey: ['posts'], exact: true }) +``` + +*** + +### resetQueries() + +```ts +resetQueries(filters?, options?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L390) + +Resets queries matching the given filters back to their initial state (e.g. any +`initialData`), notifying subscribers rather than removing them. Active queries among the +matched set are then refetched, and the returned promise resolves once that refetch settles. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`ResetOptions`](../interfaces/ResetOptions.md) + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.resetQueries({ queryKey: ['posts'], exact: true }) +``` + +*** + +### resumePausedMutations() + +```ts +resumePausedMutations(): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:757](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L757) + +Resumes mutations that were paused because there was no network connection. Does nothing +(resolving immediately) if the client is currently offline. + +#### Returns + +`Promise`\<`unknown`\> + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +await queryClient.resumePausedMutations() +``` + +*** + +### setDefaultOptions() + +```ts +setDefaultOptions(options): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L829) + +Dynamically sets the default options for this client, overwriting any previously defined +default options. + +#### Parameters + +##### options + +[`DefaultOptions`](../interfaces/DefaultOptions.md) + +#### Returns + +`void` + +#### See + +[QueryClient#getDefaultOptions](#getdefaultoptions) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +queryClient.setDefaultOptions({ + queries: { + staleTime: Infinity, + }, +}) +``` + +*** + +### setMutationDefaults() + +```ts +setMutationDefaults(mutationKey, options): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L907) + +Sets default options for mutations whose mutation key partially matches the given +`mutationKey`. As with [QueryClient#setQueryDefaults](#setquerydefaults), the order of registration +matters when several registered defaults match the same mutation key. + +#### Type Parameters + +##### TData + +`TData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TVariables + +`TVariables` = `void` + +##### TOnMutateResult + +`TOnMutateResult` = `unknown` + +#### Parameters + +##### mutationKey + +readonly `unknown`[] + +##### options + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> + +#### Returns + +`void` + +#### See + +[QueryClient#getMutationDefaults](#getmutationdefaults) + +#### Example + +```ts +queryClient.setMutationDefaults(['addPost'], { mutationFn: addPost }) +``` + +*** + +### setQueriesData() + +```ts +setQueriesData( + filters, + updater, + options?): [readonly unknown[], TQueryFnData | undefined][]; +``` + +Defined in: [packages/query-core/src/queryClient.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L312) + +Synchronous way to immediately update the cached data of multiple queries at once, using +filters or partial query key matching. Only queries that already exist and match the given +filters are updated; no new cache entries are created. Internally this calls +[QueryClient#setQueryData](#setquerydata) for each matching query. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters + +`TQueryFilters` + +##### updater + +[`Updater`](../type-aliases/Updater.md)\<`NoInfer`\<`TQueryFnData`\> \| `undefined`, `NoInfer`\<`TQueryFnData`\> \| `undefined`\> + +##### options? + +[`SetDataOptions`](../interfaces/SetDataOptions.md) + +#### Returns + +\[readonly `unknown`[], `TQueryFnData` \| `undefined`\][] + +#### Example + +```ts +queryClient.setQueriesData({ queryKey: ['posts'] }, (oldPosts) => + oldPosts ? oldPosts.filter((post) => post.id !== deletedId) : oldPosts, +) +``` + +*** + +### setQueryData() + +```ts +setQueryData( + queryKey, + updater, + options?): NoInfer | undefined; +``` + +Defined in: [packages/query-core/src/queryClient.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L264) + +Synchronous way to immediately update a query's cached data. If the updater (or the value +passed) resolves to `undefined`, the cache is left untouched and no query is created; +otherwise, if the query does not exist yet, it will be created. To update multiple queries +at once by partially matching query keys, use [QueryClient#setQueriesData](#setqueriesdata) instead. + +Updates must be performed immutably: do not mutate `oldData`, or data previously retrieved +via [QueryClient#getQueryData](#getquerydata), in place. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +The query key to set data for. + +##### updater + +[`Updater`](../type-aliases/Updater.md)\<`NoInfer`\<`TInferredQueryFnData`\> \| `undefined`, `NoInfer`\<`TInferredQueryFnData`\> \| `undefined`\> + +Either the new data, or a function that receives the current data (which +may be `undefined`) and returns the new data. + +##### options? + +[`SetDataOptions`](../interfaces/SetDataOptions.md) + +#### Returns + +`NoInfer`\<`TInferredQueryFnData`\> \| `undefined` + +#### Example + +```ts +queryClient.setQueryData(['posts'], newPosts) + +// Or, using an updater function that receives the current data: +queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost]) +``` + +*** + +### setQueryDefaults() + +```ts +setQueryDefaults(queryKey, options): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L848) + +Sets default options for queries whose query key partially matches the given `queryKey`. + +If several registered query defaults match a given query key, they are merged together in +registration order by [QueryClient#getQueryDefaults](#getquerydefaults), so register defaults from the +most generic key to the least generic one — more specific defaults should be registered +after more generic ones so they take precedence. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +#### Parameters + +##### queryKey + +readonly `unknown`[] + +##### options + +`Partial`\<[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`\>, `"queryKey"`\>\> + +#### Returns + +`void` + +#### Example + +```ts +queryClient.setQueryDefaults(['posts'], { queryFn: fetchPosts }) + +await queryClient.query({ queryKey: ['posts'] }) +``` + +*** + +### unmount() + +```ts +unmount(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L126) + +The inverse of [QueryClient#mount](#mount) — called by a framework adapter's +`QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online +listeners once the mount count returns to `0`. + +#### Returns + +`void` diff --git a/docs/framework/lit/reference/classes/QueryObserver.md b/docs/framework/lit/reference/classes/QueryObserver.md new file mode 100644 index 00000000000..51ff16910df --- /dev/null +++ b/docs/framework/lit/reference/classes/QueryObserver.md @@ -0,0 +1,555 @@ +--- +id: QueryObserver +title: QueryObserver +--- + +Defined in: [packages/query-core/src/queryObserver.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L57) + +A `QueryObserver` watches a single query in the `QueryCache` and computes a +`QueryObserverResult` from its state, recomputing and notifying subscribers +whenever the underlying query (or the observer's options) changes. It is +the primitive that framework adapters (e.g. `useQuery`) build their hooks +on top of, but it can also be used directly to observe and switch between +queries outside of any framework. + +## Example + +```ts +const observer = new QueryObserver(queryClient, { + queryKey: ['posts'], + queryFn: fetchPosts, +}) + +const unsubscribe = observer.subscribe((result) => { + console.log(result.data) +}) +``` + +## Extends + +- `Subscribable`\<`QueryObserverListener`\<`TData`, `TError`\>\> + +## Extended by + +- [`InfiniteQueryObserver`](InfiniteQueryObserver.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Constructors + +### Constructor + +```ts +new QueryObserver(client, options): QueryObserver; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L87) + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`QueryObserver`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Overrides + +```ts +Subscribable>.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +*** + +### options + +```ts +options: QueryObserverOptions; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L89) + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L106) + +#### Returns + +`void` + +*** + +### createResult() + +```ts +protected createResult(query, options): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:559](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L559) + +#### Parameters + +##### query + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L161) + +Stops observing the current query: clears all listeners, cancels the +stale and refetch-interval timers, and removes this observer from the +query it was observing. + +#### Returns + +`void` + +*** + +### fetch() + +```ts +protected fetch(fetchOptions): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L448) + +#### Parameters + +##### fetchOptions + +`ObserverFetchOptions` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchOptimistic() + +```ts +fetchOptimistic(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:395](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L395) + +Fetches a query defined by the given options without affecting this +observer's own tracked query or result, and returns a promise that +resolves with the `QueryObserverResult` for that fetch. This is useful +for prefetching data that another observer (e.g. a query about to be +navigated to) will need, ahead of time. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.fetchOptimistic({ + queryKey: ['posts', 2], + queryFn: () => fetchPost(2), +}) +console.log(result.data) +``` + +*** + +### getCurrentQuery() + +```ts +getCurrentQuery(): Query; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:357](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L357) + +Returns the `Query` instance this observer is currently observing. + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L321) + +Returns the most recently computed `QueryObserverResult` for the +observed query. This is a point-in-time read; to be notified of updates +as they happen, subscribe to the observer instead (its inherited +`subscribe` method). + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +#### Example + +```ts +const result = observer.getCurrentResult() +console.log(result.status, result.data) +``` + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(options): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L272) + +Computes the result the observer would produce for the given (already-defaulted) options +right now, building the underlying `Query` if it doesn't exist yet, without waiting for a +subscription callback. Called by framework adapters on every render (e.g. `useQuery`) so the +returned value is available synchronously, ahead of `setOptions` triggering an actual fetch. + +#### Parameters + +##### options + +[`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L110) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L124) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### refetch() + +```ts +refetch(__namedParameters): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L371) + +Refetches the observed query and returns a promise that resolves with +the resulting `QueryObserverResult`. + +#### Parameters + +##### \_\_namedParameters + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.refetch({ cancelRefetch: false }) +console.log(result.data) +``` + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L182) + +Updates the observer's options. This will re-resolve the query being +observed (switching to a different query if the `queryKey` changed), +trigger a fetch if the new options require one and the observer has +subscribers, recompute the current result, and reschedule the stale and +refetch-interval timers as needed. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setOptions({ queryKey: ['posts', 1], queryFn: () => fetchPost(1) }) +// later: switch to a different query, reusing the same observer +observer.setOptions({ queryKey: ['posts', 2], queryFn: () => fetchPost(2) }) +``` + +*** + +### shouldFetchOnReconnect() + +```ts +shouldFetchOnReconnect(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L135) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnReconnect` option) to refetch when the network +reconnects. + +#### Returns + +`boolean` + +*** + +### shouldFetchOnWindowFocus() + +```ts +shouldFetchOnWindowFocus(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L148) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnWindowFocus` option) to refetch when the window +regains focus. + +#### Returns + +`boolean` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueryObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` + +*** + +### trackProp() + +```ts +trackProp(key): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:350](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L350) + +Records that the given `QueryObserverResult` property was read, so a subsequent update only +notifies this observer if a tracked property actually changed. Normally called indirectly via +[QueryObserver#trackResult](#trackresult)'s proxy; exposed directly for adapters that track property +access themselves (e.g. through their own reactivity system) instead of via the proxy. + +#### Parameters + +##### key + +`"error"` | `"data"` | `"isError"` | `"isPending"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isSuccess"` | `"isPlaceholderData"` | `"status"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` + +#### Returns + +`void` + +*** + +### trackResult() + +```ts +trackResult(result, onPropTracked?): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:331](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L331) + +Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via +[QueryObserver#trackProp](#trackprop) (and an optional `onPropTracked` callback). Used by framework +adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on +properties you actually read" behavior. + +#### Parameters + +##### result + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +##### onPropTracked? + +(`key`) => `void` + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### updateResult() + +```ts +updateResult(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L735) + +Recomputes and stores the current result from the current query/options, notifying listeners +if it changed. Framework adapters call this right after subscribing to make sure no query +update was missed in the gap between creating the observer and subscribing to it. + +#### Returns + +`void` diff --git a/docs/framework/lit/reference/functions/createInfiniteQueryController.md b/docs/framework/lit/reference/functions/createInfiniteQueryController.md index 3974efa3af6..a9b6930a17c 100644 --- a/docs/framework/lit/reference/functions/createInfiniteQueryController.md +++ b/docs/framework/lit/reference/functions/createInfiniteQueryController.md @@ -35,7 +35,7 @@ nearest connected `QueryClientProvider`. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> ### TQueryKey @@ -63,7 +63,7 @@ options. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Optional explicit query client. Provide this for controllers that should not resolve a client from Lit context. diff --git a/docs/framework/lit/reference/functions/createMutationController.md b/docs/framework/lit/reference/functions/createMutationController.md index 4ea9b122bda..dfed592d8c2 100644 --- a/docs/framework/lit/reference/functions/createMutationController.md +++ b/docs/framework/lit/reference/functions/createMutationController.md @@ -57,7 +57,7 @@ Mutation observer options, or a getter that returns options. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Optional explicit query client. Provide this for controllers that should not resolve a client from Lit context. diff --git a/docs/framework/lit/reference/functions/createQueriesController.md b/docs/framework/lit/reference/functions/createQueriesController.md index 0c632c3ec8a..c82411887dc 100644 --- a/docs/framework/lit/reference/functions/createQueriesController.md +++ b/docs/framework/lit/reference/functions/createQueriesController.md @@ -49,7 +49,7 @@ Queries controller options, or a getter that returns options. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Optional explicit query client. Provide this for controllers that should not resolve a client from Lit context. diff --git a/docs/framework/lit/reference/functions/createQueryController.md b/docs/framework/lit/reference/functions/createQueryController.md index caa4641736a..ae9523703d1 100644 --- a/docs/framework/lit/reference/functions/createQueryController.md +++ b/docs/framework/lit/reference/functions/createQueryController.md @@ -60,7 +60,7 @@ Query observer options, or a getter that returns options. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Optional explicit query client. Provide this for controllers that should not resolve a client from Lit context. diff --git a/docs/framework/lit/reference/functions/defaultShouldDehydrateMutation.md b/docs/framework/lit/reference/functions/defaultShouldDehydrateMutation.md new file mode 100644 index 00000000000..095ccf36e7c --- /dev/null +++ b/docs/framework/lit/reference/functions/defaultShouldDehydrateMutation.md @@ -0,0 +1,23 @@ +--- +id: defaultShouldDehydrateMutation +title: defaultShouldDehydrateMutation +--- + +```ts +function defaultShouldDehydrateMutation(mutation): boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L180) + +The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are +currently paused (e.g. paused by `networkMode` while offline). + +## Parameters + +### mutation + +[`Mutation`](../classes/Mutation.md) + +## Returns + +`boolean` diff --git a/docs/framework/lit/reference/functions/defaultShouldDehydrateQuery.md b/docs/framework/lit/reference/functions/defaultShouldDehydrateQuery.md new file mode 100644 index 00000000000..06afc29d670 --- /dev/null +++ b/docs/framework/lit/reference/functions/defaultShouldDehydrateQuery.md @@ -0,0 +1,23 @@ +--- +id: defaultShouldDehydrateQuery +title: defaultShouldDehydrateQuery +--- + +```ts +function defaultShouldDehydrateQuery(query): boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:188](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L188) + +The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is +`'success'`. + +## Parameters + +### query + +[`Query`](../classes/Query.md) + +## Returns + +`boolean` diff --git a/docs/framework/lit/reference/functions/dehydrate.md b/docs/framework/lit/reference/functions/dehydrate.md new file mode 100644 index 00000000000..b7334de7729 --- /dev/null +++ b/docs/framework/lit/reference/functions/dehydrate.md @@ -0,0 +1,43 @@ +--- +id: dehydrate +title: dehydrate +--- + +```ts +function dehydrate(client, options): DehydratedState; +``` + +Defined in: [packages/query-core/src/hydration.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L210) + +Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`, +typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`. +Which queries/mutations are included, and how their data/errors are transformed, is controlled by `options`, +falling back to the client's `dehydrate` default options, and finally to `defaultShouldDehydrateQuery` / +`defaultShouldDehydrateMutation`. + +## Parameters + +### client + +[`QueryClient`](../classes/QueryClient.md) + +### options + +[`DehydrateOptions`](../interfaces/DehydrateOptions.md) = `{}` + +## Returns + +[`DehydratedState`](../interfaces/DehydratedState.md) + +## Example + +```ts +const queryClient = new QueryClient() + +await queryClient.prefetchQuery({ + queryKey: ['posts'], + queryFn: getPosts, +}) + +const dehydratedState = dehydrate(queryClient) +``` diff --git a/docs/framework/lit/reference/functions/dehydrateQuery.md b/docs/framework/lit/reference/functions/dehydrateQuery.md new file mode 100644 index 00000000000..33c5bfe477e --- /dev/null +++ b/docs/framework/lit/reference/functions/dehydrateQuery.md @@ -0,0 +1,43 @@ +--- +id: dehydrateQuery +title: dehydrateQuery +--- + +```ts +function dehydrateQuery( + query, + serializeData?, + shouldRedactErrors?): DehydratedQuery; +``` + +Defined in: [packages/query-core/src/hydration.ts:151](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L151) + +Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g. +`queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the +de/rehydrated data, typically with `useQuery` on the client. If the query is still `pending`, its in-flight +promise is dehydrated too so it can be resumed on the other side instead of re-fetched. + +## Parameters + +### query + +[`Query`](../classes/Query.md) + +The query to dehydrate. + +### serializeData? + +`TransformerFn` + +Optional transform applied to `query.state.data` before it is included in the snapshot. + +### shouldRedactErrors? + +(`error`) => `boolean` + +Optional predicate; if it returns `false` for the promise's rejection error, that +error is kept as-is instead of being redacted. + +## Returns + +`DehydratedQuery` diff --git a/docs/framework/lit/reference/functions/experimental_streamedQuery.md b/docs/framework/lit/reference/functions/experimental_streamedQuery.md new file mode 100644 index 00000000000..afd44df7c5f --- /dev/null +++ b/docs/framework/lit/reference/functions/experimental_streamedQuery.md @@ -0,0 +1,52 @@ +--- +id: experimental_streamedQuery +title: experimental_streamedQuery +--- + +```ts +function experimental_streamedQuery(queryFn): QueryFunction; +``` + +Defined in: [packages/query-core/src/streamedQuery.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L60) + +This is a helper function to create a query function that streams data from an AsyncIterable. +Data will be an Array of all the chunks received. +The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. +The query will stay in fetchStatus 'fetching' until the stream ends. + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TData + +`TData` = `TQueryFnData`[] + +### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +## Parameters + +### queryFn + +`StreamedQueryParams`\<`TQueryFnData`, `TData`, `TQueryKey`\> + +The function that returns an AsyncIterable to stream data from. + +## Returns + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TData`, `TQueryKey`\> + +## Example + +```ts +await queryClient.query({ + queryKey: ['data'], + queryFn: streamedQuery({ + streamFn: fetchDataInChunks, + }), +}) +``` diff --git a/docs/framework/lit/reference/functions/getDefaultQueryClient.md b/docs/framework/lit/reference/functions/getDefaultQueryClient.md index 0f1959c3fcc..07371741212 100644 --- a/docs/framework/lit/reference/functions/getDefaultQueryClient.md +++ b/docs/framework/lit/reference/functions/getDefaultQueryClient.md @@ -14,7 +14,7 @@ available. ## Returns -`QueryClient` \| `undefined` +[`QueryClient`](../classes/QueryClient.md) \| `undefined` The default query client, or `undefined` when there is no registered client or more than one registered client. diff --git a/docs/framework/lit/reference/functions/hashKey.md b/docs/framework/lit/reference/functions/hashKey.md new file mode 100644 index 00000000000..9e7844aa09d --- /dev/null +++ b/docs/framework/lit/reference/functions/hashKey.md @@ -0,0 +1,30 @@ +--- +id: hashKey +title: hashKey +--- + +```ts +function hashKey(queryKey): string; +``` + +Defined in: [packages/query-core/src/utils.ts:282](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L282) + +Default query & mutation keys hash function. +Hashes the value into a stable hash. + +## Parameters + +### queryKey + +readonly `unknown`[] + +## Returns + +`string` + +## Example + +```ts +// Object keys are sorted, so key order doesn't affect the hash: +hashKey(['todos', { page: 1, filter: 'done' }]) // === '["todos",{"filter":"done","page":1}]' +``` diff --git a/docs/framework/lit/reference/functions/hydrate.md b/docs/framework/lit/reference/functions/hydrate.md new file mode 100644 index 00000000000..8a281b19214 --- /dev/null +++ b/docs/framework/lit/reference/functions/hydrate.md @@ -0,0 +1,49 @@ +--- +id: hydrate +title: hydrate +--- + +```ts +function hydrate( + client, + dehydratedState, + options?): void; +``` + +Defined in: [packages/query-core/src/hydration.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L267) + +Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the +client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`. +Queries not yet in the cache are built from the dehydrated snapshot; queries that already exist are only updated +when the dehydrated data is newer than what's already cached. Newly built queries have their `fetchStatus` reset +to `'idle'` so they don't hydrate stuck in a fetching state. If a dehydrated query still had an in-flight +promise, it is resumed via `query.fetch()` (reusing that promise as `initialPromise`) rather than re-invoking +`queryFn`. + +## Parameters + +### client + +[`QueryClient`](../classes/QueryClient.md) + +### dehydratedState + +`Partial`\<[`DehydratedState`](../interfaces/DehydratedState.md)\> + +### options? + +[`HydrateOptions`](../interfaces/HydrateOptions.md) + +## Returns + +`void` + +## Example + +```ts +// dehydratedState was produced by `dehydrate` on the server +// and sent to the client, e.g. embedded in server-rendered markup. +const queryClient = new QueryClient() + +hydrate(queryClient, dehydratedState) +``` diff --git a/docs/framework/lit/reference/functions/infiniteQueryOptions.md b/docs/framework/lit/reference/functions/infiniteQueryOptions.md index 184528cc0ee..0e6d602e875 100644 --- a/docs/framework/lit/reference/functions/infiniteQueryOptions.md +++ b/docs/framework/lit/reference/functions/infiniteQueryOptions.md @@ -24,7 +24,7 @@ data and error types across TanStack Query APIs. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> ### TQueryKey @@ -38,13 +38,13 @@ data and error types across TanStack Query APIs. ### options -`InfiniteQueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> Infinite query options to preserve and brand. ## Returns -`InfiniteQueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `object` +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `object` The same options object with a typed `queryKey`. diff --git a/docs/framework/lit/reference/functions/isCancelledError.md b/docs/framework/lit/reference/functions/isCancelledError.md new file mode 100644 index 00000000000..c8f57c4b94d --- /dev/null +++ b/docs/framework/lit/reference/functions/isCancelledError.md @@ -0,0 +1,24 @@ +--- +id: isCancelledError +title: isCancelledError +--- + +```ts +function isCancelledError(value): value is CancelledError; +``` + +Defined in: [packages/query-core/src/retryer.ts:90](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L90) + +## Parameters + +### value + +`any` + +## Returns + +`value is CancelledError` + +## Deprecated + +Use instanceof `CancelledError` instead. diff --git a/docs/framework/lit/reference/functions/keepPreviousData.md b/docs/framework/lit/reference/functions/keepPreviousData.md new file mode 100644 index 00000000000..d41c7d7c726 --- /dev/null +++ b/docs/framework/lit/reference/functions/keepPreviousData.md @@ -0,0 +1,40 @@ +--- +id: keepPreviousData +title: keepPreviousData +--- + +```ts +function keepPreviousData(previousData): T | undefined; +``` + +Defined in: [packages/query-core/src/utils.ts:491](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L491) + +Intended to be passed as a query's `placeholderData` option, for example +`placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new +query key is fetching, it keeps displaying the previously fetched data until the new data arrives. + +## Type Parameters + +### T + +`T` + +## Parameters + +### previousData + +`T` | `undefined` + +## Returns + +`T` \| `undefined` + +## Example + +```ts +new QueryObserver(queryClient, { + queryKey: ['posts', page], + queryFn: () => fetchPosts(page), + placeholderData: keepPreviousData, +}) +``` diff --git a/docs/framework/lit/reference/functions/matchMutation.md b/docs/framework/lit/reference/functions/matchMutation.md new file mode 100644 index 00000000000..79468dcfad9 --- /dev/null +++ b/docs/framework/lit/reference/functions/matchMutation.md @@ -0,0 +1,38 @@ +--- +id: matchMutation +title: matchMutation +--- + +```ts +function matchMutation(filters, mutation): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:235](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L235) + +Checks whether a mutation matches the given [MutationFilters](../interfaces/MutationFilters.md). +Every filter that is specified must match; filters that are left unspecified are ignored. +If a `mutationKey` filter is provided but the mutation has no `mutationKey` of its own, it does not match. + +## Parameters + +### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) + +### mutation + +[`Mutation`](../classes/Mutation.md)\<`any`, `any`\> + +## Returns + +`boolean` + +## Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const matchingMutations = mutationCache + .getAll() + .filter((mutation) => matchMutation({ mutationKey: ['addPost'] }, mutation)) +``` diff --git a/docs/framework/lit/reference/functions/matchQuery.md b/docs/framework/lit/reference/functions/matchQuery.md new file mode 100644 index 00000000000..f98fe5f3537 --- /dev/null +++ b/docs/framework/lit/reference/functions/matchQuery.md @@ -0,0 +1,37 @@ +--- +id: matchQuery +title: matchQuery +--- + +```ts +function matchQuery(filters, query): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L173) + +Checks whether a query matches the given [QueryFilters](../interfaces/QueryFilters.md). +Every filter that is specified must match; filters that are left unspecified are ignored. + +## Parameters + +### filters + +[`QueryFilters`](../interfaces/QueryFilters.md) + +### query + +[`Query`](../classes/Query.md)\<`any`, `any`, `any`, `any`\> + +## Returns + +`boolean` + +## Example + +```ts +const queryCache = queryClient.getQueryCache() + +const matchingQueries = queryCache + .getAll() + .filter((query) => matchQuery({ queryKey: ['posts'] }, query)) +``` diff --git a/docs/framework/lit/reference/functions/mutationOptions.md b/docs/framework/lit/reference/functions/mutationOptions.md index 151ac414cf2..0413a4f78df 100644 --- a/docs/framework/lit/reference/functions/mutationOptions.md +++ b/docs/framework/lit/reference/functions/mutationOptions.md @@ -33,13 +33,13 @@ Preserves and types mutation options for reuse across Lit Query APIs. ### options -`MutationObserverOptions`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> Mutation options to preserve. ## Returns -`MutationObserverOptions`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> The same options object. diff --git a/docs/framework/lit/reference/functions/noop.md b/docs/framework/lit/reference/functions/noop.md new file mode 100644 index 00000000000..fd1b8dc2ad0 --- /dev/null +++ b/docs/framework/lit/reference/functions/noop.md @@ -0,0 +1,32 @@ +--- +id: noop +title: noop +--- + +## Call Signature + +```ts +function noop(): void; +``` + +Defined in: [packages/query-core/src/utils.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L117) + +A function that does nothing. + +### Returns + +`void` + +## Call Signature + +```ts +function noop(): undefined; +``` + +Defined in: [packages/query-core/src/utils.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L118) + +A function that does nothing. + +### Returns + +`undefined` diff --git a/docs/framework/lit/reference/functions/partialMatchKey.md b/docs/framework/lit/reference/functions/partialMatchKey.md new file mode 100644 index 00000000000..3795de85b95 --- /dev/null +++ b/docs/framework/lit/reference/functions/partialMatchKey.md @@ -0,0 +1,26 @@ +--- +id: partialMatchKey +title: partialMatchKey +--- + +```ts +function partialMatchKey(a, b): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L298) + +Checks if key `b` partially matches with key `a`. + +## Parameters + +### a + +readonly `unknown`[] + +### b + +readonly `unknown`[] + +## Returns + +`boolean` diff --git a/docs/framework/lit/reference/functions/queryOptions.md b/docs/framework/lit/reference/functions/queryOptions.md index f6e4524f8db..ef522eb17c7 100644 --- a/docs/framework/lit/reference/functions/queryOptions.md +++ b/docs/framework/lit/reference/functions/queryOptions.md @@ -42,7 +42,7 @@ Query options to preserve and brand. ### Returns -`Omit`\<`QueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryFnData`, `TQueryKey`, `never`\>, `"queryFn"`\> & `object` & `object` +`Omit`\<[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryFnData`, `TQueryKey`, `never`\>, `"queryFn"`\> & `object` & `object` The same options object with a typed `queryKey`. @@ -97,7 +97,7 @@ Query options to preserve and brand. ### Returns -`OmitKeyof`\<`QueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryFnData`, `TQueryKey`, `never`\>, `"queryFn"`\> & `object` & `object` +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryFnData`, `TQueryKey`, `never`\>, `"queryFn"`\> & `object` & `object` The same options object with a typed `queryKey`. @@ -140,6 +140,6 @@ Query options to preserve and brand. ### Returns -`QueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryFnData`, `TQueryKey`, `never`\> & `object` & `object` +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryFnData`, `TQueryKey`, `never`\> & `object` & `object` The same options object with a typed `queryKey`. diff --git a/docs/framework/lit/reference/functions/registerDefaultQueryClient.md b/docs/framework/lit/reference/functions/registerDefaultQueryClient.md index 8d1b0711cda..42e9954cead 100644 --- a/docs/framework/lit/reference/functions/registerDefaultQueryClient.md +++ b/docs/framework/lit/reference/functions/registerDefaultQueryClient.md @@ -19,7 +19,7 @@ passing an explicit client or rendering under a provider when possible. ### client -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) The query client to register as the current default. diff --git a/docs/framework/lit/reference/functions/replaceEqualDeep.md b/docs/framework/lit/reference/functions/replaceEqualDeep.md new file mode 100644 index 00000000000..9d6a01a7030 --- /dev/null +++ b/docs/framework/lit/reference/functions/replaceEqualDeep.md @@ -0,0 +1,41 @@ +--- +id: replaceEqualDeep +title: replaceEqualDeep +--- + +```ts +function replaceEqualDeep( + a, + b, + depth?): T; +``` + +Defined in: [packages/query-core/src/utils.ts:337](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L337) + +This function returns `a` if `b` is deeply equal. +If not, it will replace any deeply equal children of `b` with those of `a`. +This can be used for structural sharing between JSON values for example. + +## Type Parameters + +### T + +`T` + +## Parameters + +### a + +`unknown` + +### b + +`T` + +### depth? + +`number` + +## Returns + +`T` diff --git a/docs/framework/lit/reference/functions/resolveQueryClient.md b/docs/framework/lit/reference/functions/resolveQueryClient.md index f06bc53018d..fee291e978d 100644 --- a/docs/framework/lit/reference/functions/resolveQueryClient.md +++ b/docs/framework/lit/reference/functions/resolveQueryClient.md @@ -15,13 +15,13 @@ Resolves an explicit `QueryClient` or falls back to `useQueryClient`. ### explicit? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Optional client supplied by the caller. ## Returns -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) The explicit client when provided, otherwise the current default client. diff --git a/docs/framework/lit/reference/functions/shouldThrowError.md b/docs/framework/lit/reference/functions/shouldThrowError.md new file mode 100644 index 00000000000..3146617391e --- /dev/null +++ b/docs/framework/lit/reference/functions/shouldThrowError.md @@ -0,0 +1,45 @@ +--- +id: shouldThrowError +title: shouldThrowError +--- + +```ts +function shouldThrowError(throwOnError, params): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L574) + +Resolves a `throwOnError` option to a boolean. +If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller, +additional context such as the query or mutation) and its result is returned, allowing the throwing +behavior to be decided per error. Otherwise, `throwOnError` itself is coerced to a boolean (`undefined` +resolves to `false`). + +## Type Parameters + +### T + +`T` *extends* (...`args`) => `boolean` + +## Parameters + +### throwOnError + +`boolean` | `T` | `undefined` + +### params + +`Parameters`\<`T`\> + +## Returns + +`boolean` + +## Example + +```ts +const throwOnError = + query.state.error && typeof options.throwOnError === 'function' + ? shouldThrowError(options.throwOnError, [query.state.error, query]) + : options.throwOnError +``` diff --git a/docs/framework/lit/reference/functions/unregisterDefaultQueryClient.md b/docs/framework/lit/reference/functions/unregisterDefaultQueryClient.md index 6f0a5bd8056..e164e2013cb 100644 --- a/docs/framework/lit/reference/functions/unregisterDefaultQueryClient.md +++ b/docs/framework/lit/reference/functions/unregisterDefaultQueryClient.md @@ -18,7 +18,7 @@ Unregisters a client previously registered with ### client -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) The query client registration to release. diff --git a/docs/framework/lit/reference/functions/useIsFetching.md b/docs/framework/lit/reference/functions/useIsFetching.md index a4887fbea3d..b7017bee5b0 100644 --- a/docs/framework/lit/reference/functions/useIsFetching.md +++ b/docs/framework/lit/reference/functions/useIsFetching.md @@ -30,13 +30,13 @@ subscription. ### filters -[`Accessor`](../type-aliases/Accessor.md)\<`QueryFilters`\\> = `{}` +[`Accessor`](../type-aliases/Accessor.md)\<[`QueryFilters`](../interfaces/QueryFilters.md)\\> = `{}` Query filters, or a getter that returns query filters. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Optional explicit query client. Provide this for controllers that should not resolve a client from Lit context. diff --git a/docs/framework/lit/reference/functions/useIsMutating.md b/docs/framework/lit/reference/functions/useIsMutating.md index f89df7ff3a1..44cdd98978a 100644 --- a/docs/framework/lit/reference/functions/useIsMutating.md +++ b/docs/framework/lit/reference/functions/useIsMutating.md @@ -30,13 +30,13 @@ subscription. ### filters -[`Accessor`](../type-aliases/Accessor.md)\<`MutationFilters`\<`unknown`, `Error`, `unknown`, `unknown`\>\> = `{}` +[`Accessor`](../type-aliases/Accessor.md)\<[`MutationFilters`](../interfaces/MutationFilters.md)\<`unknown`, `Error`, `unknown`, `unknown`\>\> = `{}` Mutation filters, or a getter that returns mutation filters. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Optional explicit query client. Provide this for controllers that should not resolve a client from Lit context. diff --git a/docs/framework/lit/reference/functions/useMutationState.md b/docs/framework/lit/reference/functions/useMutationState.md index 688f1af61e2..c207ae27a55 100644 --- a/docs/framework/lit/reference/functions/useMutationState.md +++ b/docs/framework/lit/reference/functions/useMutationState.md @@ -24,7 +24,7 @@ the controller resolves the client from the nearest connected ### TResult -`TResult` = `MutationState`\<`unknown`, `unknown`, `unknown`, `unknown`\> +`TResult` = [`MutationState`](../interfaces/MutationState.md)\<`unknown`, `unknown`, `unknown`, `unknown`\> ## Parameters @@ -43,7 +43,7 @@ Mutation state filters and optional selector. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Optional explicit query client. Provide this for controllers that should not resolve a client from Lit context. diff --git a/docs/framework/lit/reference/functions/useQueryClient.md b/docs/framework/lit/reference/functions/useQueryClient.md index 8128dc9ede3..3cce315ce13 100644 --- a/docs/framework/lit/reference/functions/useQueryClient.md +++ b/docs/framework/lit/reference/functions/useQueryClient.md @@ -18,6 +18,6 @@ clients are mounted and the default would be ambiguous. ## Returns -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) The single registered query client. diff --git a/docs/framework/lit/reference/index.md b/docs/framework/lit/reference/index.md index c47f6a79a88..8cab137b1cb 100644 --- a/docs/framework/lit/reference/index.md +++ b/docs/framework/lit/reference/index.md @@ -5,38 +5,176 @@ title: "@tanstack/lit-query" ## Classes +- [CancelledError](classes/CancelledError.md) +- [InfiniteQueryObserver](classes/InfiniteQueryObserver.md) +- [Mutation](classes/Mutation.md) +- [MutationCache](classes/MutationCache.md) +- [MutationObserver](classes/MutationObserver.md) +- [QueriesObserver](classes/QueriesObserver.md) +- [Query](classes/Query.md) +- [QueryCache](classes/QueryCache.md) +- [QueryClient](classes/QueryClient.md) - [QueryClientProvider](classes/QueryClientProvider.md) +- [QueryObserver](classes/QueryObserver.md) + +## Interfaces + +- [CancelOptions](interfaces/CancelOptions.md) +- [DefaultOptions](interfaces/DefaultOptions.md) +- [DehydratedState](interfaces/DehydratedState.md) +- [DehydrateOptions](interfaces/DehydrateOptions.md) +- [~~EnsureQueryDataOptions~~](interfaces/EnsureQueryDataOptions.md) +- [FetchNextPageOptions](interfaces/FetchNextPageOptions.md) +- [FetchPreviousPageOptions](interfaces/FetchPreviousPageOptions.md) +- [~~FetchQueryOptions~~](interfaces/FetchQueryOptions.md) +- [HydrateOptions](interfaces/HydrateOptions.md) +- [InfiniteData](interfaces/InfiniteData.md) +- [InfiniteQueryObserverBaseResult](interfaces/InfiniteQueryObserverBaseResult.md) +- [InfiniteQueryObserverLoadingErrorResult](interfaces/InfiniteQueryObserverLoadingErrorResult.md) +- [InfiniteQueryObserverLoadingResult](interfaces/InfiniteQueryObserverLoadingResult.md) +- [InfiniteQueryObserverOptions](interfaces/InfiniteQueryObserverOptions.md) +- [InfiniteQueryObserverPendingResult](interfaces/InfiniteQueryObserverPendingResult.md) +- [InfiniteQueryObserverPlaceholderResult](interfaces/InfiniteQueryObserverPlaceholderResult.md) +- [InfiniteQueryObserverRefetchErrorResult](interfaces/InfiniteQueryObserverRefetchErrorResult.md) +- [InfiniteQueryObserverSuccessResult](interfaces/InfiniteQueryObserverSuccessResult.md) +- [InfiniteQueryPageParamsOptions](interfaces/InfiniteQueryPageParamsOptions.md) +- [InitialPageParam](interfaces/InitialPageParam.md) +- [InvalidateOptions](interfaces/InvalidateOptions.md) +- [InvalidateQueryFilters](interfaces/InvalidateQueryFilters.md) +- [MutateOptions](interfaces/MutateOptions.md) +- [MutationCacheConfig](interfaces/MutationCacheConfig.md) +- [MutationFilters](interfaces/MutationFilters.md) +- [MutationObserverBaseResult](interfaces/MutationObserverBaseResult.md) +- [MutationObserverErrorResult](interfaces/MutationObserverErrorResult.md) +- [MutationObserverIdleResult](interfaces/MutationObserverIdleResult.md) +- [MutationObserverLoadingResult](interfaces/MutationObserverLoadingResult.md) +- [MutationObserverOptions](interfaces/MutationObserverOptions.md) +- [MutationObserverSuccessResult](interfaces/MutationObserverSuccessResult.md) +- [MutationOptions](interfaces/MutationOptions.md) +- [MutationState](interfaces/MutationState.md) +- [NotifyEvent](interfaces/NotifyEvent.md) +- [QueriesObserverOptions](interfaces/QueriesObserverOptions.md) +- [QueryCacheConfig](interfaces/QueryCacheConfig.md) +- [QueryClientConfig](interfaces/QueryClientConfig.md) +- [QueryExecuteOptions](interfaces/QueryExecuteOptions.md) +- [QueryFilters](interfaces/QueryFilters.md) +- [QueryObserverBaseResult](interfaces/QueryObserverBaseResult.md) +- [QueryObserverLoadingErrorResult](interfaces/QueryObserverLoadingErrorResult.md) +- [QueryObserverLoadingResult](interfaces/QueryObserverLoadingResult.md) +- [QueryObserverOptions](interfaces/QueryObserverOptions.md) +- [QueryObserverPendingResult](interfaces/QueryObserverPendingResult.md) +- [QueryObserverPlaceholderResult](interfaces/QueryObserverPlaceholderResult.md) +- [QueryObserverRefetchErrorResult](interfaces/QueryObserverRefetchErrorResult.md) +- [QueryObserverSuccessResult](interfaces/QueryObserverSuccessResult.md) +- [QueryOptions](interfaces/QueryOptions.md) +- [QueryState](interfaces/QueryState.md) +- [RefetchOptions](interfaces/RefetchOptions.md) +- [RefetchQueryFilters](interfaces/RefetchQueryFilters.md) +- [Register](interfaces/Register.md) +- [ResetOptions](interfaces/ResetOptions.md) +- [ResultOptions](interfaces/ResultOptions.md) +- [SetDataOptions](interfaces/SetDataOptions.md) ## Type Aliases - [Accessor](type-aliases/Accessor.md) +- [AnyDataTag](type-aliases/AnyDataTag.md) - [CreateInfiniteQueryOptions](type-aliases/CreateInfiniteQueryOptions.md) - [CreateMutationOptions](type-aliases/CreateMutationOptions.md) - [CreateQueriesControllerOptions](type-aliases/CreateQueriesControllerOptions.md) - [CreateQueriesInput](type-aliases/CreateQueriesInput.md) - [CreateQueryOptions](type-aliases/CreateQueryOptions.md) +- [DataTag](type-aliases/DataTag.md) +- [dataTagErrorSymbol](type-aliases/dataTagErrorSymbol.md) +- [dataTagSymbol](type-aliases/dataTagSymbol.md) +- [DefaultedInfiniteQueryObserverOptions](type-aliases/DefaultedInfiniteQueryObserverOptions.md) +- [DefaultedQueryObserverOptions](type-aliases/DefaultedQueryObserverOptions.md) +- [DefaultError](type-aliases/DefaultError.md) +- [DefinedInfiniteQueryObserverResult](type-aliases/DefinedInfiniteQueryObserverResult.md) - [DefinedInitialDataOptions](type-aliases/DefinedInitialDataOptions.md) +- [DefinedQueryObserverResult](type-aliases/DefinedQueryObserverResult.md) +- [DistributiveOmit](type-aliases/DistributiveOmit.md) +- [~~EnsureInfiniteQueryDataOptions~~](type-aliases/EnsureInfiniteQueryDataOptions.md) +- [~~FetchInfiniteQueryOptions~~](type-aliases/FetchInfiniteQueryOptions.md) +- [FetchStatus](type-aliases/FetchStatus.md) +- [GetNextPageParamFunction](type-aliases/GetNextPageParamFunction.md) +- [GetPreviousPageParamFunction](type-aliases/GetPreviousPageParamFunction.md) +- [InferDataFromTag](type-aliases/InferDataFromTag.md) +- [InferErrorFromTag](type-aliases/InferErrorFromTag.md) - [InfiniteQueryControllerOptions](type-aliases/InfiniteQueryControllerOptions.md) +- [InfiniteQueryExecuteOptions](type-aliases/InfiniteQueryExecuteOptions.md) +- [InfiniteQueryObserverResult](type-aliases/InfiniteQueryObserverResult.md) - [InfiniteQueryResultAccessor](type-aliases/InfiniteQueryResultAccessor.md) +- [InitialDataFunction](type-aliases/InitialDataFunction.md) - [IsFetchingAccessor](type-aliases/IsFetchingAccessor.md) - [IsMutatingAccessor](type-aliases/IsMutatingAccessor.md) +- [ManagedTimerId](type-aliases/ManagedTimerId.md) +- [MutateFunction](type-aliases/MutateFunction.md) +- [MutateFunctionRest](type-aliases/MutateFunctionRest.md) +- [MutationCacheNotifyEvent](type-aliases/MutationCacheNotifyEvent.md) - [MutationControllerOptions](type-aliases/MutationControllerOptions.md) - [MutationControllerResult](type-aliases/MutationControllerResult.md) +- [MutationFunction](type-aliases/MutationFunction.md) +- [MutationFunctionContext](type-aliases/MutationFunctionContext.md) +- [MutationKey](type-aliases/MutationKey.md) +- [MutationMeta](type-aliases/MutationMeta.md) +- [MutationObserverResult](type-aliases/MutationObserverResult.md) - [MutationResultAccessor](type-aliases/MutationResultAccessor.md) +- [MutationScope](type-aliases/MutationScope.md) - [MutationStateAccessor](type-aliases/MutationStateAccessor.md) - [MutationStateOptions](type-aliases/MutationStateOptions.md) +- [MutationStatus](type-aliases/MutationStatus.md) +- [NetworkMode](type-aliases/NetworkMode.md) +- [NonUndefinedGuard](type-aliases/NonUndefinedGuard.md) +- [NotifyEventType](type-aliases/NotifyEventType.md) +- [NotifyOnChangeProps](type-aliases/NotifyOnChangeProps.md) +- [OmitKeyof](type-aliases/OmitKeyof.md) +- [Override](type-aliases/Override.md) +- [PlaceholderDataFunction](type-aliases/PlaceholderDataFunction.md) - [QueriesControllerOptions](type-aliases/QueriesControllerOptions.md) +- [QueriesPlaceholderDataFunction](type-aliases/QueriesPlaceholderDataFunction.md) - [QueriesResultAccessor](type-aliases/QueriesResultAccessor.md) +- [QueryBooleanOption](type-aliases/QueryBooleanOption.md) +- [QueryCacheNotifyEvent](type-aliases/QueryCacheNotifyEvent.md) - [QueryControllerOptions](type-aliases/QueryControllerOptions.md) - [QueryControllerResult](type-aliases/QueryControllerResult.md) +- [QueryFunction](type-aliases/QueryFunction.md) +- [QueryFunctionContext](type-aliases/QueryFunctionContext.md) +- [QueryKey](type-aliases/QueryKey.md) +- [QueryKeyHashFunction](type-aliases/QueryKeyHashFunction.md) +- [QueryKeyWithDataTag](type-aliases/QueryKeyWithDataTag.md) +- [QueryMeta](type-aliases/QueryMeta.md) +- [QueryObserverResult](type-aliases/QueryObserverResult.md) +- [QueryPersister](type-aliases/QueryPersister.md) - [QueryResultAccessor](type-aliases/QueryResultAccessor.md) +- [QueryStatus](type-aliases/QueryStatus.md) +- [SkipToken](type-aliases/SkipToken.md) +- [StaleTime](type-aliases/StaleTime.md) +- [StaleTimeFunction](type-aliases/StaleTimeFunction.md) +- [ThrowOnError](type-aliases/ThrowOnError.md) +- [TimeoutCallback](type-aliases/TimeoutCallback.md) +- [TimeoutProvider](type-aliases/TimeoutProvider.md) - [UndefinedInitialDataOptions](type-aliases/UndefinedInitialDataOptions.md) +- [UnsetMarker](type-aliases/UnsetMarker.md) - [UnusedSkipTokenOptions](type-aliases/UnusedSkipTokenOptions.md) +- [Updater](type-aliases/Updater.md) - [ValueAccessor](type-aliases/ValueAccessor.md) +- [WithRequired](type-aliases/WithRequired.md) ## Variables +- [dataTagErrorSymbol](variables/dataTagErrorSymbol.md) +- [dataTagSymbol](variables/dataTagSymbol.md) +- [defaultScheduler](variables/defaultScheduler.md) +- [environmentManager](variables/environmentManager.md) +- [focusManager](variables/focusManager.md) +- [~~isServer~~](variables/isServer.md) +- [notifyManager](variables/notifyManager.md) +- [onlineManager](variables/onlineManager.md) - [queryClientContext](variables/queryClientContext.md) +- [skipToken](variables/skipToken.md) +- [timeoutManager](variables/timeoutManager.md) +- [unsetMarker](variables/unsetMarker.md) ## Functions @@ -44,12 +182,27 @@ title: "@tanstack/lit-query" - [createMutationController](functions/createMutationController.md) - [createQueriesController](functions/createQueriesController.md) - [createQueryController](functions/createQueryController.md) +- [defaultShouldDehydrateMutation](functions/defaultShouldDehydrateMutation.md) +- [defaultShouldDehydrateQuery](functions/defaultShouldDehydrateQuery.md) +- [dehydrate](functions/dehydrate.md) +- [dehydrateQuery](functions/dehydrateQuery.md) +- [experimental\_streamedQuery](functions/experimental_streamedQuery.md) - [getDefaultQueryClient](functions/getDefaultQueryClient.md) +- [hashKey](functions/hashKey.md) +- [hydrate](functions/hydrate.md) - [infiniteQueryOptions](functions/infiniteQueryOptions.md) +- [~~isCancelledError~~](functions/isCancelledError.md) +- [keepPreviousData](functions/keepPreviousData.md) +- [matchMutation](functions/matchMutation.md) +- [matchQuery](functions/matchQuery.md) - [mutationOptions](functions/mutationOptions.md) +- [noop](functions/noop.md) +- [partialMatchKey](functions/partialMatchKey.md) - [queryOptions](functions/queryOptions.md) - [registerDefaultQueryClient](functions/registerDefaultQueryClient.md) +- [replaceEqualDeep](functions/replaceEqualDeep.md) - [resolveQueryClient](functions/resolveQueryClient.md) +- [shouldThrowError](functions/shouldThrowError.md) - [unregisterDefaultQueryClient](functions/unregisterDefaultQueryClient.md) - [useIsFetching](functions/useIsFetching.md) - [useIsMutating](functions/useIsMutating.md) diff --git a/docs/framework/lit/reference/interfaces/CancelOptions.md b/docs/framework/lit/reference/interfaces/CancelOptions.md new file mode 100644 index 00000000000..2b9293712d2 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/CancelOptions.md @@ -0,0 +1,26 @@ +--- +id: CancelOptions +title: CancelOptions +--- + +Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) + +## Properties + +### revert? + +```ts +optional revert: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1444) + +*** + +### silent? + +```ts +optional silent: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1445](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1445) diff --git a/docs/framework/lit/reference/interfaces/DefaultOptions.md b/docs/framework/lit/reference/interfaces/DefaultOptions.md new file mode 100644 index 00000000000..149ef5b3444 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/DefaultOptions.md @@ -0,0 +1,76 @@ +--- +id: DefaultOptions +title: DefaultOptions +--- + +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) + +## Type Parameters + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### dehydrate? + +```ts +optional dehydrate: DehydrateOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) + +*** + +### hydrate? + +```ts +optional hydrate: object; +``` + +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) + +#### deserializeData? + +```ts +optional deserializeData: TransformerFn; +``` + +Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. + +#### mutations? + +```ts +optional mutations: MutationOptions; +``` + +Default options merged into every mutation restored from the dehydrated state. + +#### queries? + +```ts +optional queries: QueryOptions; +``` + +Default options merged into every query restored from the dehydrated state. + +*** + +### mutations? + +```ts +optional mutations: MutationObserverOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) + +*** + +### queries? + +```ts +optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; +``` + +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) diff --git a/docs/framework/lit/reference/interfaces/DehydrateOptions.md b/docs/framework/lit/reference/interfaces/DehydrateOptions.md new file mode 100644 index 00000000000..e862ae88b43 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/DehydrateOptions.md @@ -0,0 +1,89 @@ +--- +id: DehydrateOptions +title: DehydrateOptions +--- + +Defined in: [packages/query-core/src/hydration.ts:42](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L42) + +Options for `dehydrate`, controlling which queries/mutations are included in the resulting `DehydratedState` and +how their data/errors are transformed before being serialized (e.g. for embedding in server-rendered markup). + +## Properties + +### serializeData? + +```ts +optional serializeData: TransformerFn; +``` + +Defined in: [packages/query-core/src/hydration.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L44) + +Transforms a query's `data` before it is dehydrated. Useful for non-JSON-serializable data. + +*** + +### shouldDehydrateMutation()? + +```ts +optional shouldDehydrateMutation: (mutation) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:46](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L46) + +Predicate to decide whether a given `Mutation` should be dehydrated. Defaults to `defaultShouldDehydrateMutation`. + +#### Parameters + +##### mutation + +[`Mutation`](../classes/Mutation.md) + +#### Returns + +`boolean` + +*** + +### shouldDehydrateQuery()? + +```ts +optional shouldDehydrateQuery: (query) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:48](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L48) + +Predicate to decide whether a given `Query` should be dehydrated. Defaults to `defaultShouldDehydrateQuery`. + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +*** + +### shouldRedactErrors()? + +```ts +optional shouldRedactErrors: (error) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L54) + +Predicate to decide whether a query's error should be redacted before dehydration. Errors are redacted +(replaced with a generic `Error('redacted')`) unless this function is provided and returns `false` for the +given error, in which case the original error is kept. + +#### Parameters + +##### error + +`unknown` + +#### Returns + +`boolean` diff --git a/docs/framework/lit/reference/interfaces/DehydratedState.md b/docs/framework/lit/reference/interfaces/DehydratedState.md new file mode 100644 index 00000000000..7edce60a00d --- /dev/null +++ b/docs/framework/lit/reference/interfaces/DehydratedState.md @@ -0,0 +1,30 @@ +--- +id: DehydratedState +title: DehydratedState +--- + +Defined in: [packages/query-core/src/hydration.ts:97](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L97) + +A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically +transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data +that has already been fetched, avoiding a redundant fetch on the client. + +## Properties + +### mutations + +```ts +mutations: DehydratedMutation[]; +``` + +Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L98) + +*** + +### queries + +```ts +queries: DehydratedQuery[]; +``` + +Defined in: [packages/query-core/src/hydration.ts:99](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L99) diff --git a/docs/framework/lit/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/lit/reference/interfaces/EnsureQueryDataOptions.md new file mode 100644 index 00000000000..7f1fb493a09 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/EnsureQueryDataOptions.md @@ -0,0 +1,343 @@ +--- +id: EnsureQueryDataOptions +title: EnsureQueryDataOptions +--- + +Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) + +## Deprecated + +## Extends + +- [`FetchQueryOptions`](FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### ~~gcTime?~~ + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`gcTime`](FetchQueryOptions.md#gctime) + +*** + +### ~~initialData?~~ + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialData`](FetchQueryOptions.md#initialdata) + +*** + +### ~~initialDataUpdatedAt?~~ + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialDataUpdatedAt`](FetchQueryOptions.md#initialdataupdatedat) + +*** + +### ~~initialPageParam?~~ + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialPageParam`](FetchQueryOptions.md#initialpageparam) + +*** + +### ~~maxPages?~~ + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`maxPages`](FetchQueryOptions.md#maxpages) + +*** + +### ~~meta?~~ + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`meta`](FetchQueryOptions.md#meta) + +*** + +### ~~networkMode?~~ + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`networkMode`](FetchQueryOptions.md#networkmode) + +*** + +### ~~persister?~~ + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`persister`](FetchQueryOptions.md#persister) + +*** + +### ~~queryFn?~~ + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryFn`](FetchQueryOptions.md#queryfn) + +*** + +### ~~queryHash?~~ + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryHash`](FetchQueryOptions.md#queryhash) + +*** + +### ~~queryKey~~ + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryKey`](FetchQueryOptions.md#querykey) + +*** + +### ~~queryKeyHashFn?~~ + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryKeyHashFn`](FetchQueryOptions.md#querykeyhashfn) + +*** + +### ~~retry?~~ + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`retry`](FetchQueryOptions.md#retry) + +*** + +### ~~retryDelay?~~ + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`retryDelay`](FetchQueryOptions.md#retrydelay) + +*** + +### ~~revalidateIfStale?~~ + +```ts +optional revalidateIfStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L608) + +*** + +### ~~staleTime?~~ + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`staleTime`](FetchQueryOptions.md#staletime) + +*** + +### ~~structuralSharing?~~ + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`structuralSharing`](FetchQueryOptions.md#structuralsharing) diff --git a/docs/framework/lit/reference/interfaces/FetchNextPageOptions.md b/docs/framework/lit/reference/interfaces/FetchNextPageOptions.md new file mode 100644 index 00000000000..fefe7f30c13 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/FetchNextPageOptions.md @@ -0,0 +1,41 @@ +--- +id: FetchNextPageOptions +title: FetchNextPageOptions +--- + +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) + +If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, +whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + +If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/lit/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/lit/reference/interfaces/FetchPreviousPageOptions.md new file mode 100644 index 00000000000..ad3c3c736c9 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/FetchPreviousPageOptions.md @@ -0,0 +1,41 @@ +--- +id: FetchPreviousPageOptions +title: FetchPreviousPageOptions +--- + +Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) + +If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, +whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + +If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/lit/reference/interfaces/FetchQueryOptions.md b/docs/framework/lit/reference/interfaces/FetchQueryOptions.md new file mode 100644 index 00000000000..d7f5f8946fe --- /dev/null +++ b/docs/framework/lit/reference/interfaces/FetchQueryOptions.md @@ -0,0 +1,357 @@ +--- +id: FetchQueryOptions +title: FetchQueryOptions +--- + +Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L576) + +## Deprecated + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Extended by + +- [`EnsureQueryDataOptions`](EnsureQueryDataOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### ~~gcTime?~~ + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### ~~initialData?~~ + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### ~~initialDataUpdatedAt?~~ + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### ~~initialPageParam?~~ + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) + +*** + +### ~~maxPages?~~ + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### ~~meta?~~ + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### ~~networkMode?~~ + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### ~~persister?~~ + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### ~~queryFn?~~ + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### ~~queryHash?~~ + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### ~~queryKey~~ + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### ~~queryKeyHashFn?~~ + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### ~~retry?~~ + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### ~~retryDelay?~~ + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### ~~staleTime?~~ + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +*** + +### ~~structuralSharing?~~ + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` diff --git a/docs/framework/lit/reference/interfaces/HydrateOptions.md b/docs/framework/lit/reference/interfaces/HydrateOptions.md new file mode 100644 index 00000000000..fe8b92317e3 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/HydrateOptions.md @@ -0,0 +1,43 @@ +--- +id: HydrateOptions +title: HydrateOptions +--- + +Defined in: [packages/query-core/src/hydration.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L61) + +Options for `hydrate`, controlling the default options applied to queries/mutations restored from a +`DehydratedState`, and how to reverse any transformation applied by `DehydrateOptions.serializeData`. + +## Properties + +### defaultOptions? + +```ts +optional defaultOptions: object; +``` + +Defined in: [packages/query-core/src/hydration.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L62) + +#### deserializeData? + +```ts +optional deserializeData: TransformerFn; +``` + +Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. + +#### mutations? + +```ts +optional mutations: MutationOptions; +``` + +Default options merged into every mutation restored from the dehydrated state. + +#### queries? + +```ts +optional queries: QueryOptions; +``` + +Default options merged into every query restored from the dehydrated state. diff --git a/docs/framework/lit/reference/interfaces/InfiniteData.md b/docs/framework/lit/reference/interfaces/InfiniteData.md new file mode 100644 index 00000000000..4d7ad595c2d --- /dev/null +++ b/docs/framework/lit/reference/interfaces/InfiniteData.md @@ -0,0 +1,36 @@ +--- +id: InfiniteData +title: InfiniteData +--- + +Defined in: [packages/query-core/src/types.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L210) + +## Type Parameters + +### TData + +`TData` + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### pageParams + +```ts +pageParams: TPageParam[]; +``` + +Defined in: [packages/query-core/src/types.ts:212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L212) + +*** + +### pages + +```ts +pages: TData[]; +``` + +Defined in: [packages/query-core/src/types.ts:211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L211) diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult.md new file mode 100644 index 00000000000..94347ea2e40 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -0,0 +1,577 @@ +--- +id: InfiniteQueryObserverBaseResult +title: InfiniteQueryObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Extended by + +- [`InfiniteQueryObserverPendingResult`](InfiniteQueryObserverPendingResult.md) +- [`InfiniteQueryObserverLoadingResult`](InfiniteQueryObserverLoadingResult.md) +- [`InfiniteQueryObserverLoadingErrorResult`](InfiniteQueryObserverLoadingErrorResult.md) +- [`InfiniteQueryObserverRefetchErrorResult`](InfiniteQueryObserverRefetchErrorResult.md) +- [`InfiniteQueryObserverSuccessResult`](InfiniteQueryObserverSuccessResult.md) +- [`InfiniteQueryObserverPlaceholderResult`](InfiniteQueryObserverPlaceholderResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) + +The last successfully resolved data for the query. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) + +Will be `true` if the query failed while fetching the next page. + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) + +Will be `true` if the query failed while fetching the previous page. + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) + +Will be `true` if the query failed while fetching for the first time. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) + +Will be `true` if the data shown is the placeholder data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) + +Will be `true` if the query failed while refetching. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md new file mode 100644 index 00000000000..3e0d3a79fa1 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverLoadingErrorResult +title: InfiniteQueryObserverLoadingErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult.md new file mode 100644 index 00000000000..f6400f44b52 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverLoadingResult +title: InfiniteQueryObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: true; +``` + +Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverOptions.md new file mode 100644 index 00000000000..b118d756b10 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverOptions.md @@ -0,0 +1,605 @@ +--- +id: InfiniteQueryObserverOptions +title: InfiniteQueryObserverOptions +--- + +Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) + +## Extends + +- [`QueryObserverOptions`](QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`, `TPageParam`\>.[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md)\<`TQueryFnData`, `TPageParam`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### enabled? + +```ts +optional enabled: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`enabled`](QueryObserverOptions.md#enabled) + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`gcTime`](QueryObserverOptions.md#gctime) + +*** + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`getNextPageParam`](InfiniteQueryPageParamsOptions.md#getnextpageparam) + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`getPreviousPageParam`](InfiniteQueryPageParamsOptions.md#getpreviouspageparam) + +*** + +### initialData? + +```ts +optional initialData: + | InfiniteData +| InitialDataFunction>; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialData`](QueryObserverOptions.md#initialdata) + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialDataUpdatedAt`](QueryObserverOptions.md#initialdataupdatedat) + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`initialPageParam`](InfiniteQueryPageParamsOptions.md#initialpageparam) + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`maxPages`](QueryObserverOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`meta`](QueryObserverOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`networkMode`](QueryObserverOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`persister`](QueryObserverOptions.md#persister) + +*** + +### placeholderData? + +```ts +optional placeholderData: + | InfiniteData +| PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`placeholderData`](QueryObserverOptions.md#placeholderdata) + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryFn`](QueryObserverOptions.md#queryfn) + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryHash`](QueryObserverOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKey`](QueryObserverOptions.md#querykey) + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKeyHashFn`](QueryObserverOptions.md#querykeyhashfn) + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchInterval`](QueryObserverOptions.md#refetchinterval) + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnMount`](QueryObserverOptions.md#refetchonmount) + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnReconnect`](QueryObserverOptions.md#refetchonreconnect) + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnWindowFocus`](QueryObserverOptions.md#refetchonwindowfocus) + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retry`](QueryObserverOptions.md#retry) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryOnMount`](QueryObserverOptions.md#retryonmount) + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +[`InfiniteData`](InfiniteData.md) + +#### Returns + +`TData` + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`select`](QueryObserverOptions.md#select) + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`staleTime`](QueryObserverOptions.md#staletime) + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`structuralSharing`](QueryObserverOptions.md#structuralsharing) + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`suspense`](QueryObserverOptions.md#suspense) + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`throwOnError`](QueryObserverOptions.md#throwonerror) diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult.md new file mode 100644 index 00000000000..53d910f545d --- /dev/null +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverPendingResult +title: InfiniteQueryObserverPendingResult +--- + +Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1009) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1013](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1013) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1017](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1017) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1016](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1016) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1021](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1021) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1023](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1023) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md new file mode 100644 index 00000000000..5949179bc6f --- /dev/null +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverPlaceholderResult +title: InfiniteQueryObserverPlaceholderResult +--- + +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: true; +``` + +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md new file mode 100644 index 00000000000..e299e60ddc3 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverRefetchErrorResult +title: InfiniteQueryObserverRefetchErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) + +Will be `true` if the query failed while fetching the next page. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) + +Will be `true` if the query failed while fetching the previous page. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult.md new file mode 100644 index 00000000000..7b550e0a90b --- /dev/null +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverSuccessResult +title: InfiniteQueryObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/lit/reference/interfaces/InfiniteQueryPageParamsOptions.md new file mode 100644 index 00000000000..bfab8bfc319 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -0,0 +1,64 @@ +--- +id: InfiniteQueryPageParamsOptions +title: InfiniteQueryPageParamsOptions +--- + +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) + +## Extends + +- [`InitialPageParam`](InitialPageParam.md)\<`TPageParam`\> + +## Extended by + +- [`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +[`InitialPageParam`](InitialPageParam.md).[`initialPageParam`](InitialPageParam.md#initialpageparam) diff --git a/docs/framework/lit/reference/interfaces/InitialPageParam.md b/docs/framework/lit/reference/interfaces/InitialPageParam.md new file mode 100644 index 00000000000..ffbf32ae0d6 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/InitialPageParam.md @@ -0,0 +1,26 @@ +--- +id: InitialPageParam +title: InitialPageParam +--- + +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) + +## Extended by + +- [`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md) + +## Type Parameters + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) diff --git a/docs/framework/lit/reference/interfaces/InvalidateOptions.md b/docs/framework/lit/reference/interfaces/InvalidateOptions.md new file mode 100644 index 00000000000..494afe1c465 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/InvalidateOptions.md @@ -0,0 +1,44 @@ +--- +id: InvalidateOptions +title: InvalidateOptions +--- + +Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L700) + +## Extends + +- [`RefetchOptions`](RefetchOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`cancelRefetch`](RefetchOptions.md#cancelrefetch) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`throwOnError`](RefetchOptions.md#throwonerror) diff --git a/docs/framework/lit/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/lit/reference/interfaces/InvalidateQueryFilters.md new file mode 100644 index 00000000000..4824d80d910 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/InvalidateQueryFilters.md @@ -0,0 +1,135 @@ +--- +id: InvalidateQueryFilters +title: InvalidateQueryFilters +--- + +Defined in: [packages/query-core/src/types.ts:690](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L690) + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extends + +- [`QueryFilters`](QueryFilters.md)\<`TQueryKey`\> + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`exact`](QueryFilters.md#exact) + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`fetchStatus`](QueryFilters.md#fetchstatus) + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`predicate`](QueryFilters.md#predicate) + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`queryKey`](QueryFilters.md#querykey) + +*** + +### refetchType? + +```ts +optional refetchType: QueryTypeFilter | "none"; +``` + +Defined in: [packages/query-core/src/types.ts:693](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L693) + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`stale`](QueryFilters.md#stale) + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/lit/reference/interfaces/MutateOptions.md b/docs/framework/lit/reference/interfaces/MutateOptions.md new file mode 100644 index 00000000000..a0af091a997 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/MutateOptions.md @@ -0,0 +1,124 @@ +--- +id: MutateOptions +title: MutateOptions +--- + +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1228) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1234) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1222](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1222) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` diff --git a/docs/framework/lit/reference/interfaces/MutationCacheConfig.md b/docs/framework/lit/reference/interfaces/MutationCacheConfig.md new file mode 100644 index 00000000000..c38d2dc26f4 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/MutationCacheConfig.md @@ -0,0 +1,161 @@ +--- +id: MutationCacheConfig +title: MutationCacheConfig +--- + +Defined in: [packages/query-core/src/mutationCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L26) + +Global callbacks that fire for every mutation handled by a `MutationCache`, regardless of which +component or observer triggered it. They differ from the `defaultOptions` provided to a +`QueryClient` in two ways: `defaultOptions` can be overridden by each mutation, while these +callbacks are always called, and `onMutate` here does not allow returning a result. + +If a callback returns a promise, it will be awaited before the mutation continues. + +## Properties + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L28) + +Called when any mutation in the cache encounters an error. + +#### Parameters + +##### error + +`Error` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L44) + +Called before any mutation in the cache executes. + +#### Parameters + +##### variables + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:50](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L50) + +Called when any mutation in the cache is settled, either successfully or with an error. + +#### Parameters + +##### data + +`unknown` + +##### error + +`Error` | `null` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:36](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L36) + +Called when any mutation in the cache is successful. + +#### Parameters + +##### data + +`unknown` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` diff --git a/docs/framework/lit/reference/interfaces/MutationFilters.md b/docs/framework/lit/reference/interfaces/MutationFilters.md new file mode 100644 index 00000000000..378a411bfe5 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/MutationFilters.md @@ -0,0 +1,85 @@ +--- +id: MutationFilters +title: MutationFilters +--- + +Defined in: [packages/query-core/src/utils.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L62) + +Filters used to select mutations, for example in `mutationCache.findAll` or `queryClient.isMutating`. +All provided filters must match; filters that are left unspecified are ignored. + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L71) + +Match mutation key exactly + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/utils.ts:81](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L81) + +Include mutations matching this mutation key + +*** + +### predicate()? + +```ts +optional predicate: (mutation) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L75) + +Include mutations matching this predicate function + +#### Parameters + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`boolean` + +*** + +### status? + +```ts +optional status: MutationStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L85) + +Filter by mutation status diff --git a/docs/framework/lit/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/lit/reference/interfaces/MutationObserverBaseResult.md new file mode 100644 index 00000000000..98810323966 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/MutationObserverBaseResult.md @@ -0,0 +1,291 @@ +--- +id: MutationObserverBaseResult +title: MutationObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationState`](MutationState.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Extended by + +- [`MutationObserverIdleResult`](MutationObserverIdleResult.md) +- [`MutationObserverLoadingResult`](MutationObserverLoadingResult.md) +- [`MutationObserverErrorResult`](MutationObserverErrorResult.md) +- [`MutationObserverSuccessResult`](MutationObserverSuccessResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationState`](MutationState.md).[`context`](MutationState.md#context) + +*** + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationState`](MutationState.md).[`data`](MutationState.md#data) + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:1285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1285) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationState`](MutationState.md).[`error`](MutationState.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationState`](MutationState.md).[`failureCount`](MutationState.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationState`](MutationState.md).[`failureReason`](MutationState.md#failurereason) + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +*** + +### isIdle + +```ts +isIdle: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1295) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationState`](MutationState.md).[`isPaused`](MutationState.md#ispaused) + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1300](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1300) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1305](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1305) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +*** + +### status + +```ts +status: MutationStatus; +``` + +Defined in: [packages/query-core/src/types.ts:1314](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1314) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationState`](MutationState.md).[`status`](MutationState.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationState`](MutationState.md).[`submittedAt`](MutationState.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationState`](MutationState.md).[`variables`](MutationState.md#variables) diff --git a/docs/framework/lit/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/lit/reference/interfaces/MutationObserverErrorResult.md new file mode 100644 index 00000000000..d61f244ced4 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/MutationObserverErrorResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverErrorResult +title: MutationObserverErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1374](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1374) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1385](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1385) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1386](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1386) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1388](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1388) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1389](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1389) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1390) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/lit/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/lit/reference/interfaces/MutationObserverIdleResult.md new file mode 100644 index 00000000000..93655da0aa5 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/MutationObserverIdleResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverIdleResult +title: MutationObserverIdleResult +--- + +Defined in: [packages/query-core/src/types.ts:1332](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1332) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1346](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1346) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: true; +``` + +Defined in: [packages/query-core/src/types.ts:1347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1347) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1349) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "idle"; +``` + +Defined in: [packages/query-core/src/types.ts:1350](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1350) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/lit/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/lit/reference/interfaces/MutationObserverLoadingResult.md new file mode 100644 index 00000000000..de146c45f5c --- /dev/null +++ b/docs/framework/lit/reference/interfaces/MutationObserverLoadingResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverLoadingResult +title: MutationObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1364](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1364) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1367](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1367) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1369](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1369) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1370](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1370) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1371](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1371) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1365) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/lit/reference/interfaces/MutationObserverOptions.md b/docs/framework/lit/reference/interfaces/MutationObserverOptions.md new file mode 100644 index 00000000000..fe59cc7444d --- /dev/null +++ b/docs/framework/lit/reference/interfaces/MutationObserverOptions.md @@ -0,0 +1,290 @@ +--- +id: MutationObserverOptions +title: MutationObserverOptions +--- + +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) + +## Extends + +- [`MutationOptions`](MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`gcTime`](MutationOptions.md#gctime) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`meta`](MutationOptions.md#meta) + +*** + +### mutationFn? + +```ts +optional mutationFn: MutationFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`mutationFn`](MutationOptions.md#mutationfn) + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`mutationKey`](MutationOptions.md#mutationkey) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`networkMode`](MutationOptions.md#networkmode) + +*** + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onError`](MutationOptions.md#onerror) + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, context) => TOnMutateResult | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) + +#### Parameters + +##### variables + +`TVariables` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`TOnMutateResult` \| `Promise`\<`TOnMutateResult`\> + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onMutate`](MutationOptions.md#onmutate) + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onSettled`](MutationOptions.md#onsettled) + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onSuccess`](MutationOptions.md#onsuccess) + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`retry`](MutationOptions.md#retry) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`retryDelay`](MutationOptions.md#retrydelay) + +*** + +### scope? + +```ts +optional scope: MutationScope; +``` + +Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`scope`](MutationOptions.md#scope) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean | (error) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) diff --git a/docs/framework/lit/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/lit/reference/interfaces/MutationObserverSuccessResult.md new file mode 100644 index 00000000000..b50ec4ab6f1 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/MutationObserverSuccessResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverSuccessResult +title: MutationObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1406](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1406) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1407) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1409) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1410](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1410) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/lit/reference/interfaces/MutationOptions.md b/docs/framework/lit/reference/interfaces/MutationOptions.md new file mode 100644 index 00000000000..f641d241142 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/MutationOptions.md @@ -0,0 +1,232 @@ +--- +id: MutationOptions +title: MutationOptions +--- + +Defined in: [packages/query-core/src/types.ts:1166](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1166) + +## Extended by + +- [`MutationObserverOptions`](MutationObserverOptions.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) + +*** + +### mutationFn? + +```ts +optional mutationFn: MutationFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) + +*** + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, context) => TOnMutateResult | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) + +#### Parameters + +##### variables + +`TVariables` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`TOnMutateResult` \| `Promise`\<`TOnMutateResult`\> + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) + +*** + +### scope? + +```ts +optional scope: MutationScope; +``` + +Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) diff --git a/docs/framework/lit/reference/interfaces/MutationState.md b/docs/framework/lit/reference/interfaces/MutationState.md new file mode 100644 index 00000000000..bec050ec1d3 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/MutationState.md @@ -0,0 +1,142 @@ +--- +id: MutationState +title: MutationState +--- + +Defined in: [packages/query-core/src/mutation.ts:30](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L30) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extended by + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +*** + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L44) + +The last successfully resolved data for the mutation. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L49) + +The error object for the mutation, if the last attempt resulted in an error. +- Defaults to `null`. + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +*** + +### status + +```ts +status: MutationStatus; +``` + +Defined in: [packages/query-core/src/mutation.ts:66](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L66) + +The status of the mutation. + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +*** + +### variables + +```ts +variables: TVariables | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L70) + +The variables the mutation was last called with. diff --git a/docs/framework/lit/reference/interfaces/NotifyEvent.md b/docs/framework/lit/reference/interfaces/NotifyEvent.md new file mode 100644 index 00000000000..1dc93464df1 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/NotifyEvent.md @@ -0,0 +1,16 @@ +--- +id: NotifyEvent +title: NotifyEvent +--- + +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) + +## Properties + +### type + +```ts +type: NotifyEventType; +``` + +Defined in: [packages/query-core/src/types.ts:1462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1462) diff --git a/docs/framework/lit/reference/interfaces/QueriesObserverOptions.md b/docs/framework/lit/reference/interfaces/QueriesObserverOptions.md new file mode 100644 index 00000000000..16035c45714 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/QueriesObserverOptions.md @@ -0,0 +1,27 @@ +--- +id: QueriesObserverOptions +title: QueriesObserverOptions +--- + +Defined in: [packages/query-core/src/queriesObserver.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L23) + +## Type Parameters + +### TCombinedResult + +`TCombinedResult` = [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +## Properties + +### combine? + +```ts +optional combine: CombineFn; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L32) + +A function that combines the array of `QueryObserverResult`s (one per +observed query) into a single value. The combined value is memoized and +only recomputed when one of the underlying results, the query hashes, or +the `combine` function itself changes. diff --git a/docs/framework/lit/reference/interfaces/QueryCacheConfig.md b/docs/framework/lit/reference/interfaces/QueryCacheConfig.md new file mode 100644 index 00000000000..69ea600366c --- /dev/null +++ b/docs/framework/lit/reference/interfaces/QueryCacheConfig.md @@ -0,0 +1,92 @@ +--- +id: QueryCacheConfig +title: QueryCacheConfig +--- + +Defined in: [packages/query-core/src/queryCache.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L24) + +Global callbacks that fire for every query handled by a `QueryCache`, regardless of which +component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can +override, these callbacks are always called. + +## Properties + +### onError()? + +```ts +optional onError: (error, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L26) + +Called when any query in the cache encounters an error. + +#### Parameters + +##### error + +`Error` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L33) + +Called when any query in the cache is settled, either successfully or with an error. + +#### Parameters + +##### data + +`unknown` + +##### error + +`Error` | `null` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L31) + +Called when any query in the cache is successful. + +#### Parameters + +##### data + +`unknown` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` diff --git a/docs/framework/lit/reference/interfaces/QueryClientConfig.md b/docs/framework/lit/reference/interfaces/QueryClientConfig.md new file mode 100644 index 00000000000..7c9bc255b35 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/QueryClientConfig.md @@ -0,0 +1,36 @@ +--- +id: QueryClientConfig +title: QueryClientConfig +--- + +Defined in: [packages/query-core/src/types.ts:1427](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1427) + +## Properties + +### defaultOptions? + +```ts +optional defaultOptions: DefaultOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1430](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1430) + +*** + +### mutationCache? + +```ts +optional mutationCache: MutationCache; +``` + +Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) + +*** + +### queryCache? + +```ts +optional queryCache: QueryCache; +``` + +Defined in: [packages/query-core/src/types.ts:1428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1428) diff --git a/docs/framework/lit/reference/interfaces/QueryExecuteOptions.md b/docs/framework/lit/reference/interfaces/QueryExecuteOptions.md new file mode 100644 index 00000000000..87335ca1648 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/QueryExecuteOptions.md @@ -0,0 +1,375 @@ +--- +id: QueryExecuteOptions +title: QueryExecuteOptions +--- + +Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L555) + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](QueryOptions.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### initialPageParam? + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L567) + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:572](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L572) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` diff --git a/docs/framework/lit/reference/interfaces/QueryFilters.md b/docs/framework/lit/reference/interfaces/QueryFilters.md new file mode 100644 index 00000000000..6b177d93aa5 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/QueryFilters.md @@ -0,0 +1,102 @@ +--- +id: QueryFilters +title: QueryFilters +--- + +Defined in: [packages/query-core/src/utils.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L31) + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extended by + +- [`InvalidateQueryFilters`](InvalidateQueryFilters.md) +- [`RefetchQueryFilters`](RefetchQueryFilters.md) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries diff --git a/docs/framework/lit/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/lit/reference/interfaces/QueryObserverBaseResult.md new file mode 100644 index 00000000000..2840be27e27 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/QueryObserverBaseResult.md @@ -0,0 +1,358 @@ +--- +id: QueryObserverBaseResult +title: QueryObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) + +## Extended by + +- [`QueryObserverPendingResult`](QueryObserverPendingResult.md) +- [`QueryObserverLoadingResult`](QueryObserverLoadingResult.md) +- [`QueryObserverLoadingErrorResult`](QueryObserverLoadingErrorResult.md) +- [`QueryObserverRefetchErrorResult`](QueryObserverRefetchErrorResult.md) +- [`QueryObserverSuccessResult`](QueryObserverSuccessResult.md) +- [`QueryObserverPlaceholderResult`](QueryObserverPlaceholderResult.md) +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) + +The last successfully resolved data for the query. + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +*** + +### isLoadingError + +```ts +isLoadingError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) + +Will be `true` if the query failed while fetching for the first time. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) + +Will be `true` if the data shown is the placeholder data. + +*** + +### isRefetchError + +```ts +isRefetchError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) + +Will be `true` if the query failed while refetching. + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. diff --git a/docs/framework/lit/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/lit/reference/interfaces/QueryObserverLoadingErrorResult.md new file mode 100644 index 00000000000..97d5d5125a7 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverLoadingErrorResult +title: QueryObserverLoadingErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: true; +``` + +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/lit/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/lit/reference/interfaces/QueryObserverLoadingResult.md new file mode 100644 index 00000000000..1f442f18130 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/QueryObserverLoadingResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverLoadingResult +title: QueryObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L873) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: true; +``` + +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:885](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L885) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:884](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L884) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/lit/reference/interfaces/QueryObserverOptions.md b/docs/framework/lit/reference/interfaces/QueryObserverOptions.md new file mode 100644 index 00000000000..ca8d2126d97 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/QueryObserverOptions.md @@ -0,0 +1,541 @@ +--- +id: QueryObserverOptions +title: QueryObserverOptions +--- + +Defined in: [packages/query-core/src/types.ts:373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L373) + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](QueryOptions.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Extended by + +- [`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### enabled? + +```ts +optional enabled: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### placeholderData? + +```ts +optional placeholderData: + | NonFunctionGuard +| PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. diff --git a/docs/framework/lit/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/lit/reference/interfaces/QueryObserverPendingResult.md new file mode 100644 index 00000000000..ad040ff9cc5 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/QueryObserverPendingResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverPendingResult +title: QueryObserverPendingResult +--- + +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:862](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L862) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:864](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L864) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:866](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L866) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:865](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L865) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:869](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L869) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:870](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L870) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/lit/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/lit/reference/interfaces/QueryObserverPlaceholderResult.md new file mode 100644 index 00000000000..8a1ae61dee9 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/QueryObserverPlaceholderResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverPlaceholderResult +title: QueryObserverPlaceholderResult +--- + +Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: true; +``` + +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/lit/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/lit/reference/interfaces/QueryObserverRefetchErrorResult.md new file mode 100644 index 00000000000..c8d5274697a --- /dev/null +++ b/docs/framework/lit/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverRefetchErrorResult +title: QueryObserverRefetchErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: true; +``` + +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/lit/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/lit/reference/interfaces/QueryObserverSuccessResult.md new file mode 100644 index 00000000000..e3c834e6c3a --- /dev/null +++ b/docs/framework/lit/reference/interfaces/QueryObserverSuccessResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverSuccessResult +title: QueryObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/lit/reference/interfaces/QueryOptions.md b/docs/framework/lit/reference/interfaces/QueryOptions.md new file mode 100644 index 00000000000..790971f72b6 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/QueryOptions.md @@ -0,0 +1,240 @@ +--- +id: QueryOptions +title: QueryOptions +--- + +Defined in: [packages/query-core/src/types.ts:231](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L231) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +*** + +### initialData? + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +*** + +### queryFn? + +```ts +optional queryFn: + | QueryFunction + | typeof skipToken; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. diff --git a/docs/framework/lit/reference/interfaces/QueryState.md b/docs/framework/lit/reference/interfaces/QueryState.md new file mode 100644 index 00000000000..7dce476d743 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/QueryState.md @@ -0,0 +1,175 @@ +--- +id: QueryState +title: QueryState +--- + +Defined in: [packages/query-core/src/query.ts:52](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L52) + +The raw state stored on a `Query` instance. This is the underlying state +that observer results (e.g. `QueryObserverResult`) are derived from. + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:56](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L56) + +The last successfully resolved data for the query. + +*** + +### dataUpdateCount + +```ts +dataUpdateCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L60) + +The number of times the query has successfully resolved. + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/query.ts:64](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L64) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/query.ts:69](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L69) + +The error object for the query, if the last attempt resulted in an error. +- Defaults to `null`. + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:73](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L73) + +The sum of all errors, incremented every time the query resolves with an error. + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/query.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L77) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +*** + +### fetchFailureCount + +```ts +fetchFailureCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L83) + +The failure count for the current fetch. +- Incremented every time the fetch fails. +- Reset to `0` when the fetch succeeds. + +*** + +### fetchFailureReason + +```ts +fetchFailureReason: TError | null; +``` + +Defined in: [packages/query-core/src/query.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L88) + +The reason the current fetch failed, as reported by the retryer. +- Reset to `null` when the fetch succeeds. + +*** + +### fetchMeta + +```ts +fetchMeta: FetchMeta | null; +``` + +Defined in: [packages/query-core/src/query.ts:93](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L93) + +Metadata passed to the currently in-flight (or most recent) fetch, e.g. the +`fetchMore` direction for infinite queries. + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/query.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L112) + +The fetch status of the query. +- `fetching`: the `queryFn` is currently executing. +- `paused`: a fetch wanted to run but has been paused (see network mode). +- `idle`: the query is not fetching. + +*** + +### isInvalidated + +```ts +isInvalidated: boolean; +``` + +Defined in: [packages/query-core/src/query.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L98) + +Whether the query has been marked as invalidated via `invalidate()`. +- Reset to `false` whenever the query resolves successfully. + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/query.ts:105](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L105) + +The status of the query. +- `pending` if there's no cached data and no attempt was finished yet. +- `error` if the last attempt resulted in an error. +- `success` if the query has data. diff --git a/docs/framework/lit/reference/interfaces/RefetchOptions.md b/docs/framework/lit/reference/interfaces/RefetchOptions.md new file mode 100644 index 00000000000..a3db94b1674 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/RefetchOptions.md @@ -0,0 +1,45 @@ +--- +id: RefetchOptions +title: RefetchOptions +--- + +Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L679) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Extended by + +- [`InvalidateOptions`](InvalidateOptions.md) +- [`ResetOptions`](ResetOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/lit/reference/interfaces/RefetchQueryFilters.md b/docs/framework/lit/reference/interfaces/RefetchQueryFilters.md new file mode 100644 index 00000000000..f2b6b287875 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/RefetchQueryFilters.md @@ -0,0 +1,125 @@ +--- +id: RefetchQueryFilters +title: RefetchQueryFilters +--- + +Defined in: [packages/query-core/src/types.ts:696](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L696) + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extends + +- [`QueryFilters`](QueryFilters.md)\<`TQueryKey`\> + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`exact`](QueryFilters.md#exact) + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`fetchStatus`](QueryFilters.md#fetchstatus) + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`predicate`](QueryFilters.md#predicate) + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`queryKey`](QueryFilters.md#querykey) + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`stale`](QueryFilters.md#stale) + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/lit/reference/interfaces/Register.md b/docs/framework/lit/reference/interfaces/Register.md new file mode 100644 index 00000000000..4f442442b48 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/Register.md @@ -0,0 +1,6 @@ +--- +id: Register +title: Register +--- + +Defined in: [packages/query-core/src/types.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L37) diff --git a/docs/framework/lit/reference/interfaces/ResetOptions.md b/docs/framework/lit/reference/interfaces/ResetOptions.md new file mode 100644 index 00000000000..bfa931717f8 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/ResetOptions.md @@ -0,0 +1,44 @@ +--- +id: ResetOptions +title: ResetOptions +--- + +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) + +## Extends + +- [`RefetchOptions`](RefetchOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`cancelRefetch`](RefetchOptions.md#cancelrefetch) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`throwOnError`](RefetchOptions.md#throwonerror) diff --git a/docs/framework/lit/reference/interfaces/ResultOptions.md b/docs/framework/lit/reference/interfaces/ResultOptions.md new file mode 100644 index 00000000000..dbf00d6c67e --- /dev/null +++ b/docs/framework/lit/reference/interfaces/ResultOptions.md @@ -0,0 +1,22 @@ +--- +id: ResultOptions +title: ResultOptions +--- + +Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) + +## Extended by + +- [`RefetchOptions`](RefetchOptions.md) +- [`FetchNextPageOptions`](FetchNextPageOptions.md) +- [`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +## Properties + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) diff --git a/docs/framework/lit/reference/interfaces/SetDataOptions.md b/docs/framework/lit/reference/interfaces/SetDataOptions.md new file mode 100644 index 00000000000..5fcbcfdf7cd --- /dev/null +++ b/docs/framework/lit/reference/interfaces/SetDataOptions.md @@ -0,0 +1,16 @@ +--- +id: SetDataOptions +title: SetDataOptions +--- + +Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1448) + +## Properties + +### updatedAt? + +```ts +optional updatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) diff --git a/docs/framework/lit/reference/type-aliases/AnyDataTag.md b/docs/framework/lit/reference/type-aliases/AnyDataTag.md new file mode 100644 index 00000000000..d3d5e33bb3e --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/AnyDataTag.md @@ -0,0 +1,30 @@ +--- +id: AnyDataTag +title: AnyDataTag +--- + +```ts +type AnyDataTag = object; +``` + +Defined in: [packages/query-core/src/types.ts:67](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L67) + +## Properties + +### \[dataTagErrorSymbol\] + +```ts +[dataTagErrorSymbol]: any; +``` + +Defined in: [packages/query-core/src/types.ts:69](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L69) + +*** + +### \[dataTagSymbol\] + +```ts +[dataTagSymbol]: any; +``` + +Defined in: [packages/query-core/src/types.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L68) diff --git a/docs/framework/lit/reference/type-aliases/CreateInfiniteQueryOptions.md b/docs/framework/lit/reference/type-aliases/CreateInfiniteQueryOptions.md index 0c0ea871be5..559a092fd7e 100644 --- a/docs/framework/lit/reference/type-aliases/CreateInfiniteQueryOptions.md +++ b/docs/framework/lit/reference/type-aliases/CreateInfiniteQueryOptions.md @@ -22,15 +22,15 @@ directly or through an `Accessor` when the options depend on Lit host state. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) ### TPageParam diff --git a/docs/framework/lit/reference/type-aliases/CreateMutationOptions.md b/docs/framework/lit/reference/type-aliases/CreateMutationOptions.md index cc70eefe405..e240c803930 100644 --- a/docs/framework/lit/reference/type-aliases/CreateMutationOptions.md +++ b/docs/framework/lit/reference/type-aliases/CreateMutationOptions.md @@ -22,7 +22,7 @@ or through an `Accessor` when the options depend on Lit host state. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TVariables diff --git a/docs/framework/lit/reference/type-aliases/CreateQueriesInput.md b/docs/framework/lit/reference/type-aliases/CreateQueriesInput.md index 75c47d1435f..4083ef175ff 100644 --- a/docs/framework/lit/reference/type-aliases/CreateQueriesInput.md +++ b/docs/framework/lit/reference/type-aliases/CreateQueriesInput.md @@ -22,7 +22,7 @@ maps each input query to its corresponding result. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData @@ -30,4 +30,4 @@ maps each input query to its corresponding result. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/lit/reference/type-aliases/CreateQueryOptions.md b/docs/framework/lit/reference/type-aliases/CreateQueryOptions.md index 9f911a32744..95f19e25e8f 100644 --- a/docs/framework/lit/reference/type-aliases/CreateQueryOptions.md +++ b/docs/framework/lit/reference/type-aliases/CreateQueryOptions.md @@ -23,7 +23,7 @@ options depend on Lit host state. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData @@ -35,4 +35,4 @@ options depend on Lit host state. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/lit/reference/type-aliases/DataTag.md b/docs/framework/lit/reference/type-aliases/DataTag.md new file mode 100644 index 00000000000..904ca124464 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/DataTag.md @@ -0,0 +1,24 @@ +--- +id: DataTag +title: DataTag +--- + +```ts +type DataTag = TType extends AnyDataTag ? TType : TType & object; +``` + +Defined in: [packages/query-core/src/types.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L71) + +## Type Parameters + +### TType + +`TType` + +### TValue + +`TValue` + +### TError + +`TError` = [`UnsetMarker`](UnsetMarker.md) diff --git a/docs/framework/lit/reference/type-aliases/DefaultError.md b/docs/framework/lit/reference/type-aliases/DefaultError.md new file mode 100644 index 00000000000..da9f615482f --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/DefaultError.md @@ -0,0 +1,10 @@ +--- +id: DefaultError +title: DefaultError +--- + +```ts +type DefaultError = Register extends object ? TError : Error; +``` + +Defined in: [packages/query-core/src/types.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L45) diff --git a/docs/framework/lit/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/lit/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md new file mode 100644 index 00000000000..733a1a5ad75 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -0,0 +1,32 @@ +--- +id: DefaultedInfiniteQueryObserverOptions +title: DefaultedInfiniteQueryObserverOptions +--- + +```ts +type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; +``` + +Defined in: [packages/query-core/src/types.ts:538](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L538) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` diff --git a/docs/framework/lit/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/lit/reference/type-aliases/DefaultedQueryObserverOptions.md new file mode 100644 index 00000000000..1b4309f150c --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -0,0 +1,32 @@ +--- +id: DefaultedQueryObserverOptions +title: DefaultedQueryObserverOptions +--- + +```ts +type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; +``` + +Defined in: [packages/query-core/src/types.ts:509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L509) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult.md new file mode 100644 index 00000000000..b0761bffacc --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -0,0 +1,22 @@ +--- +id: DefinedInfiniteQueryObserverResult +title: DefinedInfiniteQueryObserverResult +--- + +```ts +type DefinedInfiniteQueryObserverResult = + | InfiniteQueryObserverRefetchErrorResult +| InfiniteQueryObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/lit/reference/type-aliases/DefinedInitialDataOptions.md b/docs/framework/lit/reference/type-aliases/DefinedInitialDataOptions.md index a263fa6afe8..f2be44efd8a 100644 --- a/docs/framework/lit/reference/type-aliases/DefinedInitialDataOptions.md +++ b/docs/framework/lit/reference/type-aliases/DefinedInitialDataOptions.md @@ -35,7 +35,7 @@ optional queryFn: QueryFunction; ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData @@ -43,4 +43,4 @@ optional queryFn: QueryFunction; ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/lit/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/lit/reference/type-aliases/DefinedQueryObserverResult.md new file mode 100644 index 00000000000..144e0567b6d --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/DefinedQueryObserverResult.md @@ -0,0 +1,22 @@ +--- +id: DefinedQueryObserverResult +title: DefinedQueryObserverResult +--- + +```ts +type DefinedQueryObserverResult = + | QueryObserverRefetchErrorResult +| QueryObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/lit/reference/type-aliases/DistributiveOmit.md b/docs/framework/lit/reference/type-aliases/DistributiveOmit.md new file mode 100644 index 00000000000..33b87a5cd6e --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/DistributiveOmit.md @@ -0,0 +1,20 @@ +--- +id: DistributiveOmit +title: DistributiveOmit +--- + +```ts +type DistributiveOmit = TObject extends any ? Omit : never; +``` + +Defined in: [packages/query-core/src/types.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L14) + +## Type Parameters + +### TObject + +`TObject` + +### TKey + +`TKey` *extends* keyof `TObject` diff --git a/docs/framework/lit/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/lit/reference/type-aliases/EnsureInfiniteQueryDataOptions.md new file mode 100644 index 00000000000..305eef94893 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -0,0 +1,42 @@ +--- +id: EnsureInfiniteQueryDataOptions +title: EnsureInfiniteQueryDataOptions +--- + +```ts +type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; +``` + +Defined in: [packages/query-core/src/types.ts:612](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L612) + +## Type Declaration + +### ~~revalidateIfStale?~~ + +```ts +optional revalidateIfStale: boolean; +``` + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Deprecated diff --git a/docs/framework/lit/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/lit/reference/type-aliases/FetchInfiniteQueryOptions.md new file mode 100644 index 00000000000..1ee1470b14a --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -0,0 +1,34 @@ +--- +id: FetchInfiniteQueryOptions +title: FetchInfiniteQueryOptions +--- + +```ts +type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; +``` + +Defined in: [packages/query-core/src/types.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L656) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Deprecated diff --git a/docs/framework/lit/reference/type-aliases/FetchStatus.md b/docs/framework/lit/reference/type-aliases/FetchStatus.md new file mode 100644 index 00000000000..4dae9444af6 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/FetchStatus.md @@ -0,0 +1,10 @@ +--- +id: FetchStatus +title: FetchStatus +--- + +```ts +type FetchStatus = "fetching" | "paused" | "idle"; +``` + +Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) diff --git a/docs/framework/lit/reference/type-aliases/GetNextPageParamFunction.md b/docs/framework/lit/reference/type-aliases/GetNextPageParamFunction.md new file mode 100644 index 00000000000..81d1a1544ab --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/GetNextPageParamFunction.md @@ -0,0 +1,42 @@ +--- +id: GetNextPageParamFunction +title: GetNextPageParamFunction +--- + +```ts +type GetNextPageParamFunction = (lastPage, allPages, lastPageParam, allPageParams) => TPageParam | undefined | null; +``` + +Defined in: [packages/query-core/src/types.ts:203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L203) + +## Type Parameters + +### TPageParam + +`TPageParam` + +### TQueryFnData + +`TQueryFnData` = `unknown` + +## Parameters + +### lastPage + +`TQueryFnData` + +### allPages + +`TQueryFnData`[] + +### lastPageParam + +`TPageParam` + +### allPageParams + +`TPageParam`[] + +## Returns + +`TPageParam` \| `undefined` \| `null` diff --git a/docs/framework/lit/reference/type-aliases/GetPreviousPageParamFunction.md b/docs/framework/lit/reference/type-aliases/GetPreviousPageParamFunction.md new file mode 100644 index 00000000000..5a6d9b93d7e --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/GetPreviousPageParamFunction.md @@ -0,0 +1,42 @@ +--- +id: GetPreviousPageParamFunction +title: GetPreviousPageParamFunction +--- + +```ts +type GetPreviousPageParamFunction = (firstPage, allPages, firstPageParam, allPageParams) => TPageParam | undefined | null; +``` + +Defined in: [packages/query-core/src/types.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L196) + +## Type Parameters + +### TPageParam + +`TPageParam` + +### TQueryFnData + +`TQueryFnData` = `unknown` + +## Parameters + +### firstPage + +`TQueryFnData` + +### allPages + +`TQueryFnData`[] + +### firstPageParam + +`TPageParam` + +### allPageParams + +`TPageParam`[] + +## Returns + +`TPageParam` \| `undefined` \| `null` diff --git a/docs/framework/lit/reference/type-aliases/InferDataFromTag.md b/docs/framework/lit/reference/type-aliases/InferDataFromTag.md new file mode 100644 index 00000000000..09a15ca4b1c --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/InferDataFromTag.md @@ -0,0 +1,20 @@ +--- +id: InferDataFromTag +title: InferDataFromTag +--- + +```ts +type InferDataFromTag = TTaggedQueryKey extends DataTag ? TaggedValue : TQueryFnData; +``` + +Defined in: [packages/query-core/src/types.ts:90](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L90) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` + +### TTaggedQueryKey + +`TTaggedQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/lit/reference/type-aliases/InferErrorFromTag.md b/docs/framework/lit/reference/type-aliases/InferErrorFromTag.md new file mode 100644 index 00000000000..cd94e4b5c3f --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/InferErrorFromTag.md @@ -0,0 +1,20 @@ +--- +id: InferErrorFromTag +title: InferErrorFromTag +--- + +```ts +type InferErrorFromTag = TTaggedQueryKey extends DataTag ? TaggedError extends UnsetMarker ? TError : TaggedError : TError; +``` + +Defined in: [packages/query-core/src/types.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L95) + +## Type Parameters + +### TError + +`TError` + +### TTaggedQueryKey + +`TTaggedQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/lit/reference/type-aliases/InfiniteQueryControllerOptions.md b/docs/framework/lit/reference/type-aliases/InfiniteQueryControllerOptions.md index 0bd1447d181..a952ddd5bde 100644 --- a/docs/framework/lit/reference/type-aliases/InfiniteQueryControllerOptions.md +++ b/docs/framework/lit/reference/type-aliases/InfiniteQueryControllerOptions.md @@ -19,15 +19,15 @@ Accessor-wrapped options accepted by `createInfiniteQueryController`. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) ### TPageParam diff --git a/docs/framework/lit/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/lit/reference/type-aliases/InfiniteQueryExecuteOptions.md new file mode 100644 index 00000000000..29c974cfddf --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -0,0 +1,32 @@ +--- +id: InfiniteQueryExecuteOptions +title: InfiniteQueryExecuteOptions +--- + +```ts +type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; +``` + +Defined in: [packages/query-core/src/types.ts:635](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L635) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` diff --git a/docs/framework/lit/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/lit/reference/type-aliases/InfiniteQueryObserverResult.md new file mode 100644 index 00000000000..08d178e4fb0 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/InfiniteQueryObserverResult.md @@ -0,0 +1,25 @@ +--- +id: InfiniteQueryObserverResult +title: InfiniteQueryObserverResult +--- + +```ts +type InfiniteQueryObserverResult = + | DefinedInfiniteQueryObserverResult + | InfiniteQueryObserverLoadingErrorResult + | InfiniteQueryObserverLoadingResult + | InfiniteQueryObserverPendingResult +| InfiniteQueryObserverPlaceholderResult; +``` + +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/lit/reference/type-aliases/InitialDataFunction.md b/docs/framework/lit/reference/type-aliases/InitialDataFunction.md new file mode 100644 index 00000000000..6ba4aaabe61 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/InitialDataFunction.md @@ -0,0 +1,20 @@ +--- +id: InitialDataFunction +title: InitialDataFunction +--- + +```ts +type InitialDataFunction = () => T | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L173) + +## Type Parameters + +### T + +`T` + +## Returns + +`T` \| `undefined` diff --git a/docs/framework/lit/reference/type-aliases/ManagedTimerId.md b/docs/framework/lit/reference/type-aliases/ManagedTimerId.md new file mode 100644 index 00000000000..2492d8b1ec7 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/ManagedTimerId.md @@ -0,0 +1,19 @@ +--- +id: ManagedTimerId +title: ManagedTimerId +--- + +```ts +type ManagedTimerId = + | number + | { + [toPrimitive]: () => number; +}; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:17](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L17) + +Wrapping `setTimeout` is awkward from a typing perspective because platform +typings may extend the return type of `setTimeout`. For example, NodeJS +typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be +able to return such a type. diff --git a/docs/framework/lit/reference/type-aliases/MutateFunction.md b/docs/framework/lit/reference/type-aliases/MutateFunction.md new file mode 100644 index 00000000000..f574ca7f8ca --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/MutateFunction.md @@ -0,0 +1,38 @@ +--- +id: MutateFunction +title: MutateFunction +--- + +```ts +type MutateFunction = (...rest) => Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1258) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Parameters + +### rest + +...[`MutateFunctionRest`](MutateFunctionRest.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Returns + +`Promise`\<`TData`\> diff --git a/docs/framework/lit/reference/type-aliases/MutateFunctionRest.md b/docs/framework/lit/reference/type-aliases/MutateFunctionRest.md new file mode 100644 index 00000000000..aef21572aeb --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/MutateFunctionRest.md @@ -0,0 +1,28 @@ +--- +id: MutateFunctionRest +title: MutateFunctionRest +--- + +```ts +type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; +``` + +Defined in: [packages/query-core/src/types.ts:1243](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1243) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` diff --git a/docs/framework/lit/reference/type-aliases/MutationCacheNotifyEvent.md b/docs/framework/lit/reference/type-aliases/MutationCacheNotifyEvent.md new file mode 100644 index 00000000000..14d5f61a409 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/MutationCacheNotifyEvent.md @@ -0,0 +1,20 @@ +--- +id: MutationCacheNotifyEvent +title: MutationCacheNotifyEvent +--- + +```ts +type MutationCacheNotifyEvent = + | NotifyEventMutationAdded + | NotifyEventMutationRemoved + | NotifyEventMutationObserverAdded + | NotifyEventMutationObserverRemoved + | NotifyEventMutationObserverOptionsUpdated + | NotifyEventMutationUpdated; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L98) + +The event passed to a `MutationCache` subscriber. Fired whenever a mutation is added or removed +from the cache, its state is updated, or one of its observers is added, removed, or has its +options updated. diff --git a/docs/framework/lit/reference/type-aliases/MutationControllerOptions.md b/docs/framework/lit/reference/type-aliases/MutationControllerOptions.md index 8c0a497f768..04c287b11dc 100644 --- a/docs/framework/lit/reference/type-aliases/MutationControllerOptions.md +++ b/docs/framework/lit/reference/type-aliases/MutationControllerOptions.md @@ -19,7 +19,7 @@ Accessor-wrapped options accepted by `createMutationController`. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TVariables diff --git a/docs/framework/lit/reference/type-aliases/MutationControllerResult.md b/docs/framework/lit/reference/type-aliases/MutationControllerResult.md index 0e7ab8f01df..9bff6b9c838 100644 --- a/docs/framework/lit/reference/type-aliases/MutationControllerResult.md +++ b/docs/framework/lit/reference/type-aliases/MutationControllerResult.md @@ -19,7 +19,7 @@ Result object produced by a Lit mutation controller. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TVariables diff --git a/docs/framework/lit/reference/type-aliases/MutationFunction.md b/docs/framework/lit/reference/type-aliases/MutationFunction.md new file mode 100644 index 00000000000..e306a5f1a48 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/MutationFunction.md @@ -0,0 +1,34 @@ +--- +id: MutationFunction +title: MutationFunction +--- + +```ts +type MutationFunction = (variables, context) => Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1161](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1161) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TVariables + +`TVariables` = `unknown` + +## Parameters + +### variables + +`TVariables` + +### context + +[`MutationFunctionContext`](MutationFunctionContext.md) + +## Returns + +`Promise`\<`TData`\> diff --git a/docs/framework/lit/reference/type-aliases/MutationFunctionContext.md b/docs/framework/lit/reference/type-aliases/MutationFunctionContext.md new file mode 100644 index 00000000000..b29a54df298 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/MutationFunctionContext.md @@ -0,0 +1,40 @@ +--- +id: MutationFunctionContext +title: MutationFunctionContext +--- + +```ts +type MutationFunctionContext = object; +``` + +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) + +## Properties + +### client + +```ts +client: QueryClient; +``` + +Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) + +*** + +### meta + +```ts +meta: MutationMeta | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) + +*** + +### mutationKey? + +```ts +optional mutationKey: MutationKey; +``` + +Defined in: [packages/query-core/src/types.ts:1158](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1158) diff --git a/docs/framework/lit/reference/type-aliases/MutationKey.md b/docs/framework/lit/reference/type-aliases/MutationKey.md new file mode 100644 index 00000000000..f89c6959883 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/MutationKey.md @@ -0,0 +1,10 @@ +--- +id: MutationKey +title: MutationKey +--- + +```ts +type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; +``` + +Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) diff --git a/docs/framework/lit/reference/type-aliases/MutationMeta.md b/docs/framework/lit/reference/type-aliases/MutationMeta.md new file mode 100644 index 00000000000..e1d481cdcf1 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/MutationMeta.md @@ -0,0 +1,10 @@ +--- +id: MutationMeta +title: MutationMeta +--- + +```ts +type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; +``` + +Defined in: [packages/query-core/src/types.ts:1147](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1147) diff --git a/docs/framework/lit/reference/type-aliases/MutationObserverResult.md b/docs/framework/lit/reference/type-aliases/MutationObserverResult.md new file mode 100644 index 00000000000..efbc2881319 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/MutationObserverResult.md @@ -0,0 +1,32 @@ +--- +id: MutationObserverResult +title: MutationObserverResult +--- + +```ts +type MutationObserverResult = + | MutationObserverIdleResult + | MutationObserverLoadingResult + | MutationObserverErrorResult +| MutationObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` diff --git a/docs/framework/lit/reference/type-aliases/MutationResultAccessor.md b/docs/framework/lit/reference/type-aliases/MutationResultAccessor.md index 513605f4dd5..4e142d4b299 100644 --- a/docs/framework/lit/reference/type-aliases/MutationResultAccessor.md +++ b/docs/framework/lit/reference/type-aliases/MutationResultAccessor.md @@ -42,7 +42,7 @@ Throws synchronously if no `QueryClient` can be resolved. ##### args -...`Parameters`\<`MutateFunction`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> +...`Parameters`\<[`MutateFunction`](MutateFunction.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> #### Returns diff --git a/docs/framework/lit/reference/type-aliases/MutationScope.md b/docs/framework/lit/reference/type-aliases/MutationScope.md new file mode 100644 index 00000000000..6ec14643477 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/MutationScope.md @@ -0,0 +1,20 @@ +--- +id: MutationScope +title: MutationScope +--- + +```ts +type MutationScope = object; +``` + +Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) + +## Properties + +### id + +```ts +id: string; +``` + +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) diff --git a/docs/framework/lit/reference/type-aliases/MutationStateOptions.md b/docs/framework/lit/reference/type-aliases/MutationStateOptions.md index 4048f7470ac..937b1c0ba8d 100644 --- a/docs/framework/lit/reference/type-aliases/MutationStateOptions.md +++ b/docs/framework/lit/reference/type-aliases/MutationStateOptions.md @@ -45,7 +45,7 @@ Maps each matching mutation to the value returned by the accessor. ##### mutation -`Mutation` +[`Mutation`](../classes/Mutation.md) #### Returns diff --git a/docs/framework/lit/reference/type-aliases/MutationStatus.md b/docs/framework/lit/reference/type-aliases/MutationStatus.md new file mode 100644 index 00000000000..eedf0fb979a --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/MutationStatus.md @@ -0,0 +1,10 @@ +--- +id: MutationStatus +title: MutationStatus +--- + +```ts +type MutationStatus = "idle" | "pending" | "success" | "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) diff --git a/docs/framework/lit/reference/type-aliases/NetworkMode.md b/docs/framework/lit/reference/type-aliases/NetworkMode.md new file mode 100644 index 00000000000..94ae0ba76ed --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/NetworkMode.md @@ -0,0 +1,10 @@ +--- +id: NetworkMode +title: NetworkMode +--- + +```ts +type NetworkMode = "online" | "always" | "offlineFirst"; +``` + +Defined in: [packages/query-core/src/types.ts:223](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L223) diff --git a/docs/framework/lit/reference/type-aliases/NonUndefinedGuard.md b/docs/framework/lit/reference/type-aliases/NonUndefinedGuard.md new file mode 100644 index 00000000000..4aaf208013b --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/NonUndefinedGuard.md @@ -0,0 +1,16 @@ +--- +id: NonUndefinedGuard +title: NonUndefinedGuard +--- + +```ts +type NonUndefinedGuard = T extends undefined ? never : T; +``` + +Defined in: [packages/query-core/src/types.ts:12](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L12) + +## Type Parameters + +### T + +`T` diff --git a/docs/framework/lit/reference/type-aliases/NotifyEventType.md b/docs/framework/lit/reference/type-aliases/NotifyEventType.md new file mode 100644 index 00000000000..4c4f5e46007 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/NotifyEventType.md @@ -0,0 +1,17 @@ +--- +id: NotifyEventType +title: NotifyEventType +--- + +```ts +type NotifyEventType = + | "added" + | "removed" + | "updated" + | "observerAdded" + | "observerRemoved" + | "observerResultsUpdated" + | "observerOptionsUpdated"; +``` + +Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) diff --git a/docs/framework/lit/reference/type-aliases/NotifyOnChangeProps.md b/docs/framework/lit/reference/type-aliases/NotifyOnChangeProps.md new file mode 100644 index 00000000000..34f413c37f5 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/NotifyOnChangeProps.md @@ -0,0 +1,17 @@ +--- +id: NotifyOnChangeProps +title: NotifyOnChangeProps +--- + +```ts +type NotifyOnChangeProps = + | keyof InfiniteQueryObserverResult[] + | "all" + | undefined + | () => + | keyof InfiniteQueryObserverResult[] + | "all" + | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L225) diff --git a/docs/framework/lit/reference/type-aliases/OmitKeyof.md b/docs/framework/lit/reference/type-aliases/OmitKeyof.md new file mode 100644 index 00000000000..39de92462b8 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/OmitKeyof.md @@ -0,0 +1,28 @@ +--- +id: OmitKeyof +title: OmitKeyof +--- + +```ts +type OmitKeyof = Omit; +``` + +Defined in: [packages/query-core/src/types.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L19) + +## Type Parameters + +### TObject + +`TObject` + +### TKey + +`TKey` *extends* `TStrictly` *extends* `"safely"` ? + \| keyof `TObject` + \| `string` & `Record`\<`never`, `never`\> + \| `number` & `Record`\<`never`, `never`\> + \| `symbol` & `Record`\<`never`, `never`\> : keyof `TObject` + +### TStrictly + +`TStrictly` *extends* `"strictly"` \| `"safely"` = `"strictly"` diff --git a/docs/framework/lit/reference/type-aliases/Override.md b/docs/framework/lit/reference/type-aliases/Override.md new file mode 100644 index 00000000000..8abcecd1e1b --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/Override.md @@ -0,0 +1,20 @@ +--- +id: Override +title: Override +--- + +```ts +type Override = { [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey] }; +``` + +Defined in: [packages/query-core/src/types.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L31) + +## Type Parameters + +### TTargetA + +`TTargetA` + +### TTargetB + +`TTargetB` diff --git a/docs/framework/lit/reference/type-aliases/PlaceholderDataFunction.md b/docs/framework/lit/reference/type-aliases/PlaceholderDataFunction.md new file mode 100644 index 00000000000..cd40f28b41e --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/PlaceholderDataFunction.md @@ -0,0 +1,42 @@ +--- +id: PlaceholderDataFunction +title: PlaceholderDataFunction +--- + +```ts +type PlaceholderDataFunction = (previousData, previousQuery) => TQueryData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:177](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L177) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +## Parameters + +### previousData + +`TQueryData` | `undefined` + +### previousQuery + +[`Query`](../classes/Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> | `undefined` + +## Returns + +`TQueryData` \| `undefined` diff --git a/docs/framework/lit/reference/type-aliases/QueriesPlaceholderDataFunction.md b/docs/framework/lit/reference/type-aliases/QueriesPlaceholderDataFunction.md new file mode 100644 index 00000000000..5d3fca8c9e0 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/QueriesPlaceholderDataFunction.md @@ -0,0 +1,30 @@ +--- +id: QueriesPlaceholderDataFunction +title: QueriesPlaceholderDataFunction +--- + +```ts +type QueriesPlaceholderDataFunction = (previousData, previousQuery) => TQueryData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L187) + +## Type Parameters + +### TQueryData + +`TQueryData` + +## Parameters + +### previousData + +`undefined` + +### previousQuery + +`undefined` + +## Returns + +`TQueryData` \| `undefined` diff --git a/docs/framework/lit/reference/type-aliases/QueryBooleanOption.md b/docs/framework/lit/reference/type-aliases/QueryBooleanOption.md new file mode 100644 index 00000000000..9759e3ddb42 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/QueryBooleanOption.md @@ -0,0 +1,28 @@ +--- +id: QueryBooleanOption +title: QueryBooleanOption +--- + +```ts +type QueryBooleanOption = boolean | (query) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L119) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/lit/reference/type-aliases/QueryCacheNotifyEvent.md b/docs/framework/lit/reference/type-aliases/QueryCacheNotifyEvent.md new file mode 100644 index 00000000000..1a3039093c4 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/QueryCacheNotifyEvent.md @@ -0,0 +1,21 @@ +--- +id: QueryCacheNotifyEvent +title: QueryCacheNotifyEvent +--- + +```ts +type QueryCacheNotifyEvent = + | NotifyEventQueryAdded + | NotifyEventQueryRemoved + | NotifyEventQueryUpdated + | NotifyEventQueryObserverAdded + | NotifyEventQueryObserverRemoved + | NotifyEventQueryObserverResultsUpdated + | NotifyEventQueryObserverOptionsUpdated; +``` + +Defined in: [packages/query-core/src/queryCache.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L84) + +The event passed to a `QueryCache` subscriber. Fired whenever a query is added or removed from +the cache, its state is updated (e.g. via `query.setState` or `queryClient.removeQueries`), or +one of its observers is added, removed, or has its results or options updated. diff --git a/docs/framework/lit/reference/type-aliases/QueryControllerOptions.md b/docs/framework/lit/reference/type-aliases/QueryControllerOptions.md index 332769cedae..4a8bf18f51a 100644 --- a/docs/framework/lit/reference/type-aliases/QueryControllerOptions.md +++ b/docs/framework/lit/reference/type-aliases/QueryControllerOptions.md @@ -19,7 +19,7 @@ Accessor-wrapped options accepted by `createQueryController`. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData @@ -31,4 +31,4 @@ Accessor-wrapped options accepted by `createQueryController`. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/lit/reference/type-aliases/QueryControllerResult.md b/docs/framework/lit/reference/type-aliases/QueryControllerResult.md index 989ab2227e6..3b29b74fa11 100644 --- a/docs/framework/lit/reference/type-aliases/QueryControllerResult.md +++ b/docs/framework/lit/reference/type-aliases/QueryControllerResult.md @@ -19,4 +19,4 @@ Result object produced by a Lit query controller. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/lit/reference/type-aliases/QueryFunction.md b/docs/framework/lit/reference/type-aliases/QueryFunction.md new file mode 100644 index 00000000000..306367388a1 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/QueryFunction.md @@ -0,0 +1,34 @@ +--- +id: QueryFunction +title: QueryFunction +--- + +```ts +type QueryFunction = (context) => T | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L102) + +## Type Parameters + +### T + +`T` = `unknown` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Parameters + +### context + +[`QueryFunctionContext`](QueryFunctionContext.md)\<`TQueryKey`, `TPageParam`\> + +## Returns + +`T` \| `Promise`\<`T`\> diff --git a/docs/framework/lit/reference/type-aliases/QueryFunctionContext.md b/docs/framework/lit/reference/type-aliases/QueryFunctionContext.md new file mode 100644 index 00000000000..d2c9fe3e2b2 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/QueryFunctionContext.md @@ -0,0 +1,20 @@ +--- +id: QueryFunctionContext +title: QueryFunctionContext +--- + +```ts +type QueryFunctionContext = [TPageParam] extends [never] ? object : object; +``` + +Defined in: [packages/query-core/src/types.ts:144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L144) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` diff --git a/docs/framework/lit/reference/type-aliases/QueryKey.md b/docs/framework/lit/reference/type-aliases/QueryKey.md new file mode 100644 index 00000000000..1a3f34cde18 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/QueryKey.md @@ -0,0 +1,10 @@ +--- +id: QueryKey +title: QueryKey +--- + +```ts +type QueryKey = Register extends object ? TQueryKey extends ReadonlyArray ? TQueryKey : TQueryKey extends unknown[] ? TQueryKey : ReadonlyArray : ReadonlyArray; +``` + +Defined in: [packages/query-core/src/types.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L51) diff --git a/docs/framework/lit/reference/type-aliases/QueryKeyHashFunction.md b/docs/framework/lit/reference/type-aliases/QueryKeyHashFunction.md new file mode 100644 index 00000000000..feda96373cc --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/QueryKeyHashFunction.md @@ -0,0 +1,26 @@ +--- +id: QueryKeyHashFunction +title: QueryKeyHashFunction +--- + +```ts +type QueryKeyHashFunction = (queryKey) => string; +``` + +Defined in: [packages/query-core/src/types.ts:192](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L192) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) + +## Parameters + +### queryKey + +`TQueryKey` + +## Returns + +`string` diff --git a/docs/framework/lit/reference/type-aliases/QueryKeyWithDataTag.md b/docs/framework/lit/reference/type-aliases/QueryKeyWithDataTag.md new file mode 100644 index 00000000000..6613f74be9e --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/QueryKeyWithDataTag.md @@ -0,0 +1,34 @@ +--- +id: QueryKeyWithDataTag +title: QueryKeyWithDataTag +--- + +```ts +type QueryKeyWithDataTag = object; +``` + +Defined in: [packages/query-core/src/types.ts:82](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L82) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +## Properties + +### queryKey + +```ts +queryKey: DataTag; +``` + +Defined in: [packages/query-core/src/types.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L87) diff --git a/docs/framework/lit/reference/type-aliases/QueryMeta.md b/docs/framework/lit/reference/type-aliases/QueryMeta.md new file mode 100644 index 00000000000..c12917b2cce --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/QueryMeta.md @@ -0,0 +1,10 @@ +--- +id: QueryMeta +title: QueryMeta +--- + +```ts +type QueryMeta = Register extends object ? TQueryMeta extends Record ? TQueryMeta : Record : Record; +``` + +Defined in: [packages/query-core/src/types.ts:215](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L215) diff --git a/docs/framework/lit/reference/type-aliases/QueryObserverResult.md b/docs/framework/lit/reference/type-aliases/QueryObserverResult.md new file mode 100644 index 00000000000..c132281b78e --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/QueryObserverResult.md @@ -0,0 +1,25 @@ +--- +id: QueryObserverResult +title: QueryObserverResult +--- + +```ts +type QueryObserverResult = + | DefinedQueryObserverResult + | QueryObserverLoadingErrorResult + | QueryObserverLoadingResult + | QueryObserverPendingResult +| QueryObserverPlaceholderResult; +``` + +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/lit/reference/type-aliases/QueryPersister.md b/docs/framework/lit/reference/type-aliases/QueryPersister.md new file mode 100644 index 00000000000..72e80165b0d --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/QueryPersister.md @@ -0,0 +1,24 @@ +--- +id: QueryPersister +title: QueryPersister +--- + +```ts +type QueryPersister = [TPageParam] extends [never] ? (queryFn, context, query) => T | Promise : (queryFn, context, query) => T | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L128) + +## Type Parameters + +### T + +`T` = `unknown` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` diff --git a/docs/framework/lit/reference/type-aliases/QueryResultAccessor.md b/docs/framework/lit/reference/type-aliases/QueryResultAccessor.md index bf4dad0371e..010f375e4ca 100644 --- a/docs/framework/lit/reference/type-aliases/QueryResultAccessor.md +++ b/docs/framework/lit/reference/type-aliases/QueryResultAccessor.md @@ -46,7 +46,7 @@ Resolves with an optimistic query result, fetching first when needed. #### Returns -`Promise`\<`QueryObserverResult`\<`TData`, `TError`\>\> +`Promise`\<[`QueryObserverResult`](QueryObserverResult.md)\<`TData`, `TError`\>\> ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/QueryStatus.md b/docs/framework/lit/reference/type-aliases/QueryStatus.md new file mode 100644 index 00000000000..ed6059e03ec --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/QueryStatus.md @@ -0,0 +1,10 @@ +--- +id: QueryStatus +title: QueryStatus +--- + +```ts +type QueryStatus = "pending" | "error" | "success"; +``` + +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) diff --git a/docs/framework/lit/reference/type-aliases/SkipToken.md b/docs/framework/lit/reference/type-aliases/SkipToken.md new file mode 100644 index 00000000000..176c23830d2 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/SkipToken.md @@ -0,0 +1,12 @@ +--- +id: SkipToken +title: SkipToken +--- + +```ts +type SkipToken = typeof skipToken; +``` + +Defined in: [packages/query-core/src/utils.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L524) + +The type of the [skipToken](../variables/skipToken.md) sentinel value. diff --git a/docs/framework/lit/reference/type-aliases/StaleTime.md b/docs/framework/lit/reference/type-aliases/StaleTime.md new file mode 100644 index 00000000000..3e7e21608be --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/StaleTime.md @@ -0,0 +1,10 @@ +--- +id: StaleTime +title: StaleTime +--- + +```ts +type StaleTime = number | "static"; +``` + +Defined in: [packages/query-core/src/types.ts:108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L108) diff --git a/docs/framework/lit/reference/type-aliases/StaleTimeFunction.md b/docs/framework/lit/reference/type-aliases/StaleTimeFunction.md new file mode 100644 index 00000000000..b1c541fa64e --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/StaleTimeFunction.md @@ -0,0 +1,28 @@ +--- +id: StaleTimeFunction +title: StaleTimeFunction +--- + +```ts +type StaleTimeFunction = StaleTime | (query) => StaleTime; +``` + +Defined in: [packages/query-core/src/types.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L110) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/lit/reference/type-aliases/ThrowOnError.md b/docs/framework/lit/reference/type-aliases/ThrowOnError.md new file mode 100644 index 00000000000..60ad44c1cd1 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/ThrowOnError.md @@ -0,0 +1,28 @@ +--- +id: ThrowOnError +title: ThrowOnError +--- + +```ts +type ThrowOnError = boolean | (error, query) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L361) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` + +### TError + +`TError` + +### TQueryData + +`TQueryData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/lit/reference/type-aliases/TimeoutCallback.md b/docs/framework/lit/reference/type-aliases/TimeoutCallback.md new file mode 100644 index 00000000000..387fb1238f3 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/TimeoutCallback.md @@ -0,0 +1,27 @@ +--- +id: TimeoutCallback +title: TimeoutCallback +--- + +```ts +type TimeoutCallback = (_) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:9](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L9) + +TimeoutManager does not support passing arguments to the callback. + +`(_: void)` is the argument type inferred by TypeScript's default typings for +`setTimeout(cb, number)`. +If we don't accept a single void argument, then +`new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. + +## Parameters + +### \_ + +`void` + +## Returns + +`void` diff --git a/docs/framework/lit/reference/type-aliases/TimeoutProvider.md b/docs/framework/lit/reference/type-aliases/TimeoutProvider.md new file mode 100644 index 00000000000..6416fe4c557 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/TimeoutProvider.md @@ -0,0 +1,106 @@ +--- +id: TimeoutProvider +title: TimeoutProvider +--- + +```ts +type TimeoutProvider = object; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:22](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L22) + +Backend for timer functions. + +## Type Parameters + +### TTimerId + +`TTimerId` *extends* [`ManagedTimerId`](ManagedTimerId.md) = [`ManagedTimerId`](ManagedTimerId.md) + +## Properties + +### clearInterval() + +```ts +readonly clearInterval: (intervalId) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) + +#### Parameters + +##### intervalId + +`TTimerId` | `undefined` + +#### Returns + +`void` + +*** + +### clearTimeout() + +```ts +readonly clearTimeout: (timeoutId) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L25) + +#### Parameters + +##### timeoutId + +`TTimerId` | `undefined` + +#### Returns + +`void` + +*** + +### setInterval() + +```ts +readonly setInterval: (callback, delay) => TTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L27) + +#### Parameters + +##### callback + +[`TimeoutCallback`](TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +`TTimerId` + +*** + +### setTimeout() + +```ts +readonly setTimeout: (callback, delay) => TTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L24) + +#### Parameters + +##### callback + +[`TimeoutCallback`](TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +`TTimerId` diff --git a/docs/framework/lit/reference/type-aliases/UndefinedInitialDataOptions.md b/docs/framework/lit/reference/type-aliases/UndefinedInitialDataOptions.md index d8002a3113e..f32722409fb 100644 --- a/docs/framework/lit/reference/type-aliases/UndefinedInitialDataOptions.md +++ b/docs/framework/lit/reference/type-aliases/UndefinedInitialDataOptions.md @@ -29,7 +29,7 @@ optional initialData: ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData @@ -37,4 +37,4 @@ optional initialData: ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/lit/reference/type-aliases/UnsetMarker.md b/docs/framework/lit/reference/type-aliases/UnsetMarker.md new file mode 100644 index 00000000000..8b9c14e1907 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/UnsetMarker.md @@ -0,0 +1,10 @@ +--- +id: UnsetMarker +title: UnsetMarker +--- + +```ts +type UnsetMarker = typeof unsetMarker; +``` + +Defined in: [packages/query-core/src/types.ts:66](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L66) diff --git a/docs/framework/lit/reference/type-aliases/UnusedSkipTokenOptions.md b/docs/framework/lit/reference/type-aliases/UnusedSkipTokenOptions.md index ba2c09c48ea..0b1f20119fc 100644 --- a/docs/framework/lit/reference/type-aliases/UnusedSkipTokenOptions.md +++ b/docs/framework/lit/reference/type-aliases/UnusedSkipTokenOptions.md @@ -27,7 +27,7 @@ optional queryFn: Exclude = TOutput | (input) => TOutput; +``` + +Defined in: [packages/query-core/src/utils.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L103) + +Either a plain value of type `TOutput`, or a function that receives `TInput` and returns `TOutput`. +Used for example by `setQueryData`-style updaters, which accept either the new data directly or a +function that computes it from the previous data. See functionalUpdate. + +## Type Parameters + +### TInput + +`TInput` + +### TOutput + +`TOutput` + +## Example + +```ts +queryClient.setQueryData(['posts'], newPosts) + +// Or, using an updater function that receives the current data: +queryClient.setQueryData(['posts'], (oldPosts) => + oldPosts ? [...oldPosts, newPost] : oldPosts, +) +``` diff --git a/docs/framework/lit/reference/type-aliases/WithRequired.md b/docs/framework/lit/reference/type-aliases/WithRequired.md new file mode 100644 index 00000000000..c8ef831db3c --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/WithRequired.md @@ -0,0 +1,20 @@ +--- +id: WithRequired +title: WithRequired +--- + +```ts +type WithRequired = TTarget & { [_ in TKey]: {} }; +``` + +Defined in: [packages/query-core/src/types.ts:505](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L505) + +## Type Parameters + +### TTarget + +`TTarget` + +### TKey + +`TKey` *extends* keyof `TTarget` diff --git a/docs/framework/lit/reference/type-aliases/dataTagErrorSymbol.md b/docs/framework/lit/reference/type-aliases/dataTagErrorSymbol.md new file mode 100644 index 00000000000..26148a94d6e --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/dataTagErrorSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagErrorSymbol +title: dataTagErrorSymbol +--- + +```ts +type dataTagErrorSymbol = typeof dataTagErrorSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:63](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L63) diff --git a/docs/framework/lit/reference/type-aliases/dataTagSymbol.md b/docs/framework/lit/reference/type-aliases/dataTagSymbol.md new file mode 100644 index 00000000000..0012c108cc5 --- /dev/null +++ b/docs/framework/lit/reference/type-aliases/dataTagSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagSymbol +title: dataTagSymbol +--- + +```ts +type dataTagSymbol = typeof dataTagSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L61) diff --git a/docs/framework/lit/reference/variables/dataTagErrorSymbol.md b/docs/framework/lit/reference/variables/dataTagErrorSymbol.md new file mode 100644 index 00000000000..20bab62fb01 --- /dev/null +++ b/docs/framework/lit/reference/variables/dataTagErrorSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagErrorSymbol +title: dataTagErrorSymbol +--- + +```ts +const dataTagErrorSymbol: typeof dataTagErrorSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:63](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L63) diff --git a/docs/framework/lit/reference/variables/dataTagSymbol.md b/docs/framework/lit/reference/variables/dataTagSymbol.md new file mode 100644 index 00000000000..83dd68a56e9 --- /dev/null +++ b/docs/framework/lit/reference/variables/dataTagSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagSymbol +title: dataTagSymbol +--- + +```ts +const dataTagSymbol: typeof dataTagSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L61) diff --git a/docs/framework/lit/reference/variables/defaultScheduler.md b/docs/framework/lit/reference/variables/defaultScheduler.md new file mode 100644 index 00000000000..70e14d3f846 --- /dev/null +++ b/docs/framework/lit/reference/variables/defaultScheduler.md @@ -0,0 +1,13 @@ +--- +id: defaultScheduler +title: defaultScheduler +--- + +```ts +const defaultScheduler: ScheduleFunction = systemSetTimeoutZero; +``` + +Defined in: [packages/query-core/src/notifyManager.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L19) + +Default scheduling function used by the notify manager. +Schedules the callback with the system's `setTimeout(callback, 0)`. diff --git a/docs/framework/lit/reference/variables/environmentManager.md b/docs/framework/lit/reference/variables/environmentManager.md new file mode 100644 index 00000000000..caa1d70b2b6 --- /dev/null +++ b/docs/framework/lit/reference/variables/environmentManager.md @@ -0,0 +1,44 @@ +--- +id: environmentManager +title: environmentManager +--- + +```ts +const environmentManager: object; +``` + +Defined in: [packages/query-core/src/environmentManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L15) + +Manages environment detection used by TanStack Query internals. + +## Type Declaration + +### isServer() + +```ts +isServer: () => boolean; +``` + +Returns whether the current runtime should be treated as a server environment. + +#### Returns + +`boolean` + +### setIsServer() + +```ts +setIsServer(isServerValue): void; +``` + +Overrides the server check globally. + +#### Parameters + +##### isServerValue + +`IsServerValue` + +#### Returns + +`void` diff --git a/docs/framework/lit/reference/variables/focusManager.md b/docs/framework/lit/reference/variables/focusManager.md new file mode 100644 index 00000000000..cbf7fcb4a17 --- /dev/null +++ b/docs/framework/lit/reference/variables/focusManager.md @@ -0,0 +1,12 @@ +--- +id: focusManager +title: focusManager +--- + +```ts +const focusManager: FocusManager; +``` + +Defined in: [packages/query-core/src/focusManager.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L142) + +Singleton instance of FocusManager, used to manage and observe the focus state within TanStack Query. diff --git a/docs/framework/lit/reference/variables/isServer.md b/docs/framework/lit/reference/variables/isServer.md new file mode 100644 index 00000000000..28956d55cbf --- /dev/null +++ b/docs/framework/lit/reference/variables/isServer.md @@ -0,0 +1,14 @@ +--- +id: isServer +title: isServer +--- + +```ts +const isServer: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L112) + +## Deprecated + +use `environmentManager.isServer()` instead. diff --git a/docs/framework/lit/reference/variables/notifyManager.md b/docs/framework/lit/reference/variables/notifyManager.md new file mode 100644 index 00000000000..e5ecca8df60 --- /dev/null +++ b/docs/framework/lit/reference/variables/notifyManager.md @@ -0,0 +1,156 @@ +--- +id: notifyManager +title: notifyManager +--- + +```ts +const notifyManager: object; +``` + +Defined in: [packages/query-core/src/notifyManager.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L135) + +Handles scheduling and batching callbacks in TanStack Query. + +## Type Declaration + +### batch() + +```ts +readonly batch: (callback) => T; +``` + +Batches all updates scheduled inside the passed callback. +This is mainly used internally to optimize query client updating. +Batches can be nested; the queue is only flushed once the outermost `batch` call finishes. +The return value of `callback` is passed through. + +#### Type Parameters + +##### T + +`T` + +#### Parameters + +##### callback + +() => `T` + +#### Returns + +`T` + +### batchCalls() + +```ts +readonly batchCalls: (callback) => BatchCallsCallback; +``` + +All calls to the wrapped function will be batched. + +#### Type Parameters + +##### T + +`T` *extends* `unknown`[] + +#### Parameters + +##### callback + +`BatchCallsCallback`\<`T`\> + +#### Returns + +`BatchCallsCallback`\<`T`\> + +### schedule() + +```ts +schedule: (callback) => void; +``` + +Schedules a function to be run on the next batch. +By default, the batch is run with a `setTimeout`, but this can be configured via `setScheduler`. + +#### Parameters + +##### callback + +`NotifyCallback` + +#### Returns + +`void` + +### setBatchNotifyFunction() + +```ts +readonly setBatchNotifyFunction: (fn) => void; +``` + +Use this method to set a custom function to batch notifications together into a single tick. +By default React Query will use the batch function provided by ReactDOM or React Native. + +#### Parameters + +##### fn + +`BatchNotifyFunction` + +#### Returns + +`void` + +### setNotifyFunction() + +```ts +readonly setNotifyFunction: (fn) => void; +``` + +Use this method to set a custom notify function. +This can be used to for example wrap notifications with `React.act` while running tests. + +#### Parameters + +##### fn + +`NotifyFunction` + +#### Returns + +`void` + +### setScheduler() + +```ts +readonly setScheduler: (fn) => void; +``` + +Configures a custom callback that schedules when the next batch runs. +The default behavior is `setTimeout(callback, 0)`. + +#### Parameters + +##### fn + +`ScheduleFunction` + +#### Returns + +`void` + +#### Example + +```ts +import { notifyManager } from '@tanstack/query-core' + +// Schedule batches in the next microtask +notifyManager.setScheduler(queueMicrotask) + +// Schedule batches before the next frame is rendered +notifyManager.setScheduler(requestAnimationFrame) + +// Schedule batches some time in the future +notifyManager.setScheduler((cb) => setTimeout(cb, 10)) +``` diff --git a/docs/framework/lit/reference/variables/onlineManager.md b/docs/framework/lit/reference/variables/onlineManager.md new file mode 100644 index 00000000000..4ae083f245b --- /dev/null +++ b/docs/framework/lit/reference/variables/onlineManager.md @@ -0,0 +1,12 @@ +--- +id: onlineManager +title: onlineManager +--- + +```ts +const onlineManager: OnlineManager; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L117) + +Singleton instance of OnlineManager, used to manage and observe the online state within TanStack Query. diff --git a/docs/framework/lit/reference/variables/skipToken.md b/docs/framework/lit/reference/variables/skipToken.md new file mode 100644 index 00000000000..3163e91c1c2 --- /dev/null +++ b/docs/framework/lit/reference/variables/skipToken.md @@ -0,0 +1,23 @@ +--- +id: skipToken +title: skipToken +--- + +```ts +const skipToken: typeof skipToken; +``` + +Defined in: [packages/query-core/src/utils.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L520) + +Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent +to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`, +a query disabled via `skipToken` cannot be triggered with `refetch`. + +## Example + +```ts +new QueryObserver(queryClient, { + queryKey: ['post', postId], + queryFn: postId != null ? () => fetchPost(postId) : skipToken, +}) +``` diff --git a/docs/framework/lit/reference/variables/timeoutManager.md b/docs/framework/lit/reference/variables/timeoutManager.md new file mode 100644 index 00000000000..2dcfa29b55a --- /dev/null +++ b/docs/framework/lit/reference/variables/timeoutManager.md @@ -0,0 +1,12 @@ +--- +id: timeoutManager +title: timeoutManager +--- + +```ts +const timeoutManager: TimeoutManager; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:226](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L226) + +Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/lit/reference/variables/unsetMarker.md b/docs/framework/lit/reference/variables/unsetMarker.md new file mode 100644 index 00000000000..d19ee65b38e --- /dev/null +++ b/docs/framework/lit/reference/variables/unsetMarker.md @@ -0,0 +1,10 @@ +--- +id: unsetMarker +title: unsetMarker +--- + +```ts +const unsetMarker: typeof unsetMarker; +``` + +Defined in: [packages/query-core/src/types.ts:65](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L65) diff --git a/docs/framework/preact/reference/classes/CancelledError.md b/docs/framework/preact/reference/classes/CancelledError.md new file mode 100644 index 00000000000..7fded5da20f --- /dev/null +++ b/docs/framework/preact/reference/classes/CancelledError.md @@ -0,0 +1,273 @@ +--- +id: CancelledError +title: CancelledError +--- + +Defined in: [packages/query-core/src/retryer.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L77) + +The error thrown by a `Retryer` (and surfaced to `query.promise`/`mutation`) when a fetch is cancelled, e.g. via +`query.cancel()`. `revert`, if `true`, tells the caller to restore the state the query was in before the fetch +started instead of surfacing the error. `silent`, if `true`, tells the caller to suppress this error and instead +resolve with the promise of the fetch that triggered the cancellation. + +## Example + +```ts +query.cancel() + +try { + await query.promise +} catch (error) { + if (error instanceof CancelledError) { + // the fetch was cancelled, e.g. via `query.cancel()` + } +} +``` + +## Extends + +- `Error` + +## Constructors + +### Constructor + +```ts +new CancelledError(options?): CancelledError; +``` + +Defined in: [packages/query-core/src/retryer.ts:80](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L80) + +#### Parameters + +##### options? + +[`CancelOptions`](../interfaces/CancelOptions.md) + +#### Returns + +`CancelledError` + +#### Overrides + +```ts +Error.constructor +``` + +## Properties + +### cause? + +```ts +optional cause: unknown; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24 + +#### Inherited from + +```ts +Error.cause +``` + +*** + +### message + +```ts +message: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 + +#### Inherited from + +```ts +Error.message +``` + +*** + +### name + +```ts +name: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 + +#### Inherited from + +```ts +Error.name +``` + +*** + +### revert? + +```ts +optional revert: boolean; +``` + +Defined in: [packages/query-core/src/retryer.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L78) + +*** + +### silent? + +```ts +optional silent: boolean; +``` + +Defined in: [packages/query-core/src/retryer.ts:79](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L79) + +*** + +### stack? + +```ts +optional stack: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 + +#### Inherited from + +```ts +Error.stack +``` + +*** + +### stackTraceLimit + +```ts +static stackTraceLimit: number; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:68 + +The `Error.stackTraceLimit` property specifies the number of stack frames +collected by a stack trace (whether generated by `new Error().stack` or +`Error.captureStackTrace(obj)`). + +The default value is `10` but may be set to any valid JavaScript number. Changes +will affect any stack trace captured _after_ the value has been changed. + +If set to a non-number value, or set to a negative number, stack traces will +not capture any frames. + +#### Inherited from + +```ts +Error.stackTraceLimit +``` + +## Methods + +### captureStackTrace() + +```ts +static captureStackTrace(targetObject, constructorOpt?): void; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:52 + +Creates a `.stack` property on `targetObject`, which when accessed returns +a string representing the location in the code at which +`Error.captureStackTrace()` was called. + +```js +const myObject = {}; +Error.captureStackTrace(myObject); +myObject.stack; // Similar to `new Error().stack` +``` + +The first line of the trace will be prefixed with +`${myObject.name}: ${myObject.message}`. + +The optional `constructorOpt` argument accepts a function. If given, all frames +above `constructorOpt`, including `constructorOpt`, will be omitted from the +generated stack trace. + +The `constructorOpt` argument is useful for hiding implementation +details of error generation from the user. For instance: + +```js +function a() { + b(); +} + +function b() { + c(); +} + +function c() { + // Create an error without stack trace to avoid calculating the stack trace twice. + const { stackTraceLimit } = Error; + Error.stackTraceLimit = 0; + const error = new Error(); + Error.stackTraceLimit = stackTraceLimit; + + // Capture the stack trace above function b + Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace + throw error; +} + +a(); +``` + +#### Parameters + +##### targetObject + +`object` + +##### constructorOpt? + +`Function` + +#### Returns + +`void` + +#### Inherited from + +```ts +Error.captureStackTrace +``` + +*** + +### prepareStackTrace() + +```ts +static prepareStackTrace(err, stackTraces): any; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:56 + +#### Parameters + +##### err + +`Error` + +##### stackTraces + +`CallSite`[] + +#### Returns + +`any` + +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +```ts +Error.prepareStackTrace +``` diff --git a/docs/framework/preact/reference/classes/InfiniteQueryObserver.md b/docs/framework/preact/reference/classes/InfiniteQueryObserver.md new file mode 100644 index 00000000000..af43087a3ad --- /dev/null +++ b/docs/framework/preact/reference/classes/InfiniteQueryObserver.md @@ -0,0 +1,665 @@ +--- +id: InfiniteQueryObserver +title: InfiniteQueryObserver +--- + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L41) + +An `InfiniteQueryObserver` extends `QueryObserver` to observe and switch +between infinite queries. It augments the base `QueryObserverResult` with +infinite-query-specific fields and methods, such as `hasNextPage` and +`fetchNextPage`, and is the primitive that framework adapters (e.g. +`useInfiniteQuery`) build their hooks on top of. + +## Example + +```ts +const observer = new InfiniteQueryObserver(queryClient, { + queryKey: ['projects'], + queryFn: ({ pageParam }) => fetchProjects(pageParam), + initialPageParam: 0, + getNextPageParam: (lastPage) => lastPage.nextCursor, +}) + +const unsubscribe = observer.subscribe((result) => console.log(result)) +``` + +## Extends + +- [`QueryObserver`](QueryObserver.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Constructors + +### Constructor + +```ts +new InfiniteQueryObserver(client, options): InfiniteQueryObserver; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L83) + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`InfiniteQueryObserver`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`constructor`](QueryObserver.md#constructor) + +## Properties + +### fetch + +```ts +protected fetch: ReplaceReturnType<(fetchOptions) => Promise>, Promise>>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:72](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L72) + +#### Overrides + +```ts +QueryObserver.fetch +``` + +*** + +### getCurrentResult + +```ts +getCurrentResult: ReplaceReturnType<() => QueryObserverResult, InfiniteQueryObserverResult>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L60) + +Returns the most recently computed `QueryObserverResult` for the +observed query. This is a point-in-time read; to be notified of updates +as they happen, subscribe to the observer instead (its inherited +`subscribe` method). + +#### Example + +```ts +const result = observer.getCurrentResult() +console.log(result.status, result.data) +``` + +#### Overrides + +```ts +QueryObserver.getCurrentResult +``` + +*** + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`listeners`](QueryObserver.md#listeners) + +*** + +### options + +```ts +options: QueryObserverOptions, TQueryKey>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L89) + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`options`](QueryObserver.md#options) + +*** + +### subscribe() + +```ts +subscribe: (listener) => () => void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L55) + +#### Parameters + +##### listener + +`InfiniteQueryObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Overrides + +```ts +QueryObserver.subscribe +``` + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L96) + +#### Returns + +`void` + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`bindMethods`](QueryObserver.md#bindmethods) + +*** + +### createResult() + +```ts +protected createResult(query, options): InfiniteQueryObserverResult; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:201](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L201) + +#### Parameters + +##### query + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`createResult`](QueryObserver.md#createresult) + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L161) + +Stops observing the current query: clears all listeners, cancels the +stale and refetch-interval timers, and removes this observer from the +query it was observing. + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`destroy`](QueryObserver.md#destroy) + +*** + +### fetchNextPage() + +```ts +fetchNextPage(options?): Promise>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L161) + +Fetches the next page of the infinite query and returns a promise that +resolves with the resulting `InfiniteQueryObserverResult`. The page +param used for the fetch is determined by `getNextPageParam`, which +receives the current pages/page params and whose result also determines +`hasNextPage`. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](../interfaces/FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const { hasNextPage } = observer.getCurrentResult() + +if (hasNextPage) { + await observer.fetchNextPage() +} +``` + +#### See + +[InfiniteQueryObserver#fetchPreviousPage](#fetchpreviouspage) + +*** + +### fetchOptimistic() + +```ts +fetchOptimistic(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:395](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L395) + +Fetches a query defined by the given options without affecting this +observer's own tracked query or result, and returns a promise that +resolves with the `QueryObserverResult` for that fetch. This is useful +for prefetching data that another observer (e.g. a query about to be +navigated to) will need, ahead of time. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.fetchOptimistic({ + queryKey: ['posts', 2], + queryFn: () => fetchPost(2), +}) +console.log(result.data) +``` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`fetchOptimistic`](QueryObserver.md#fetchoptimistic) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage(options?): Promise>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:190](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L190) + +Fetches the previous page of the infinite query and returns a promise +that resolves with the resulting `InfiniteQueryObserverResult`. The page +param used for the fetch is determined by `getPreviousPageParam`, which +receives the current pages/page params and whose result also determines +`hasPreviousPage`. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](../interfaces/FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const { hasPreviousPage } = observer.getCurrentResult() + +if (hasPreviousPage) { + await observer.fetchPreviousPage() +} +``` + +#### See + +[InfiniteQueryObserver#fetchNextPage](#fetchnextpage) + +*** + +### getCurrentQuery() + +```ts +getCurrentQuery(): Query, TQueryKey>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:357](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L357) + +Returns the `Query` instance this observer is currently observing. + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`getCurrentQuery`](QueryObserver.md#getcurrentquery) + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(options): InfiniteQueryObserverResult; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L127) + +The infinite-query counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult), marking the +options as an infinite query before delegating to it. Called by framework adapters (e.g. +`useInfiniteQuery`) ahead of subscribing, to compute the current `InfiniteQueryObserverResult` +synchronously. + +#### Parameters + +##### options + +[`DefaultedInfiniteQueryObserverOptions`](../type-aliases/DefaultedInfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`getOptimisticResult`](QueryObserver.md#getoptimisticresult) + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`hasListeners`](QueryObserver.md#haslisteners) + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L110) + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`onSubscribe`](QueryObserver.md#onsubscribe) + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L124) + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`onUnsubscribe`](QueryObserver.md#onunsubscribe) + +*** + +### refetch() + +```ts +refetch(__namedParameters): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L371) + +Refetches the observed query and returns a promise that resolves with +the resulting `QueryObserverResult`. + +#### Parameters + +##### \_\_namedParameters + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.refetch({ cancelRefetch: false }) +console.log(result.data) +``` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`refetch`](QueryObserver.md#refetch) + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:108](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L108) + +Updates the observer's options. Behaves the same as +`QueryObserver.setOptions`, additionally marking the options as +belonging to an infinite query before delegating to the base +implementation. + +#### Parameters + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`void` + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`setOptions`](QueryObserver.md#setoptions) + +*** + +### shouldFetchOnReconnect() + +```ts +shouldFetchOnReconnect(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L135) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnReconnect` option) to refetch when the network +reconnects. + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`shouldFetchOnReconnect`](QueryObserver.md#shouldfetchonreconnect) + +*** + +### shouldFetchOnWindowFocus() + +```ts +shouldFetchOnWindowFocus(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L148) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnWindowFocus` option) to refetch when the window +regains focus. + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`shouldFetchOnWindowFocus`](QueryObserver.md#shouldfetchonwindowfocus) + +*** + +### trackProp() + +```ts +trackProp(key): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:350](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L350) + +Records that the given `QueryObserverResult` property was read, so a subsequent update only +notifies this observer if a tracked property actually changed. Normally called indirectly via +[QueryObserver#trackResult](QueryObserver.md#trackresult)'s proxy; exposed directly for adapters that track property +access themselves (e.g. through their own reactivity system) instead of via the proxy. + +#### Parameters + +##### key + +`"error"` | `"data"` | `"isError"` | `"isPending"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isSuccess"` | `"isPlaceholderData"` | `"status"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`trackProp`](QueryObserver.md#trackprop) + +*** + +### trackResult() + +```ts +trackResult(result, onPropTracked?): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:331](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L331) + +Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via +[QueryObserver#trackProp](QueryObserver.md#trackprop) (and an optional `onPropTracked` callback). Used by framework +adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on +properties you actually read" behavior. + +#### Parameters + +##### result + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +##### onPropTracked? + +(`key`) => `void` + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`trackResult`](QueryObserver.md#trackresult) + +*** + +### updateResult() + +```ts +updateResult(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L735) + +Recomputes and stores the current result from the current query/options, notifying listeners +if it changed. Framework adapters call this right after subscribing to make sure no query +update was missed in the gap between creating the observer and subscribing to it. + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`updateResult`](QueryObserver.md#updateresult) diff --git a/docs/framework/preact/reference/classes/Mutation.md b/docs/framework/preact/reference/classes/Mutation.md new file mode 100644 index 00000000000..4e85a5b2d4c --- /dev/null +++ b/docs/framework/preact/reference/classes/Mutation.md @@ -0,0 +1,329 @@ +--- +id: Mutation +title: Mutation +--- + +Defined in: [packages/query-core/src/mutation.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L135) + +Represents a single mutation attempt. A `Mutation` holds the mutation's +options, state (data/error/status), and the `MutationObserver`s currently +subscribed to it. + +Instances are created and managed internally by `MutationCache`; application +code typically interacts with mutations indirectly through `QueryClient` or +a framework hook like `useMutation`. Direct access to a `Mutation` instance +is possible via `mutationCache.find()`/`getAll()` for inspecting cache state. + +## Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +``` + +## Extends + +- `Removable` + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Constructors + +### Constructor + +```ts +new Mutation(config): Mutation; +``` + +Defined in: [packages/query-core/src/mutation.ts:152](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L152) + +#### Parameters + +##### config + +`MutationConfig`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`Mutation`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Overrides + +```ts +Removable.constructor +``` + +## Properties + +### gcTime + +```ts +gcTime: number; +``` + +Defined in: [packages/query-core/src/removable.ts:7](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L7) + +#### Inherited from + +```ts +Removable.gcTime +``` + +*** + +### mutationId + +```ts +readonly mutationId: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:143](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L143) + +*** + +### options + +```ts +options: MutationOptions; +``` + +Defined in: [packages/query-core/src/mutation.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L142) + +*** + +### state + +```ts +state: MutationState; +``` + +Defined in: [packages/query-core/src/mutation.ts:141](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L141) + +## Accessors + +### meta + +#### Get Signature + +```ts +get meta(): Record | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:179](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L179) + +The `meta` object passed in the mutation's options, if any. + +##### Returns + +`Record`\<`string`, `unknown`\> \| `undefined` + +## Methods + +### clearGcTimeout() + +```ts +protected clearGcTimeout(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L32) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.clearGcTimeout +``` + +*** + +### continue() + +```ts +continue(): Promise; +``` + +Defined in: [packages/query-core/src/mutation.ts:243](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L243) + +Resumes a mutation that is currently paused or was restored from a +dehydrated, still-`pending` state. + +- If this mutation has an active retryer (it paused mid-attempt, e.g. due + to the network mode or scope-based queuing), its retryer is resumed. +- Otherwise, if the mutation's status is still `pending` (e.g. it was + dehydrated while an attempt was in flight and never got a retryer in + this instance), `execute` is called again with the last known variables. +- Otherwise the mutation has already settled and this resolves immediately + without running anything again. + +#### Returns + +`Promise`\<`unknown`\> + +#### Example + +```ts +// typically driven by reconnect handling, e.g. queryClient.resumePausedMutations() +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +await mutation?.continue() +``` + +#### See + +[Mutation#execute](#execute) + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:10](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L10) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.destroy +``` + +*** + +### execute() + +```ts +execute(variables): Promise; +``` + +Defined in: [packages/query-core/src/mutation.ts:283](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L283) + +Runs the mutation function for the given variables through a retryer, and +drives the mutation's state and lifecycle callbacks through to settlement. + +If this mutation's state is already `pending` when `execute` is called +(i.e. it was restored, still in-flight, from a dehydrated state), the +`onMutate` step is skipped and a `continue` action is dispatched to +unpause it; otherwise a `pending` action is dispatched first, then the +mutation cache's `onMutate` and the mutation's own `onMutate` option are +awaited in that order, and the resulting context is stored. + +The mutation function is then run (subject to `retry`/`retryDelay`/ +`networkMode`, and to the mutation cache's scope-based serialization). +On success, the cache's `onSuccess`/`onSettled` callbacks run before the +mutation's own `onSuccess`/`onSettled` options, a `success` action is +dispatched, and the resolved data is returned. On failure, the same +cache-then-option ordering is used for `onError`/`onSettled`, but each of +those four callbacks is individually caught so that a throwing callback +cannot mask the original error; an `error` action is then dispatched and +the original error is re-thrown. + +#### Parameters + +##### variables + +`TVariables` + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +// typically invoked by MutationObserver.mutate, not called directly +const data = await mutation.execute(variables) +``` + +#### See + +[Mutation#continue](#continue) + +*** + +### optionalRemove() + +```ts +protected optionalRemove(): void; +``` + +Defined in: [packages/query-core/src/mutation.ts:212](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L212) + +#### Returns + +`void` + +#### Overrides + +```ts +Removable.optionalRemove +``` + +*** + +### scheduleGc() + +```ts +protected scheduleGc(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L14) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.scheduleGc +``` + +*** + +### updateGcTime() + +```ts +protected updateGcTime(newGcTime): void; +``` + +Defined in: [packages/query-core/src/removable.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L24) + +#### Parameters + +##### newGcTime + +`number` | `undefined` + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.updateGcTime +``` diff --git a/docs/framework/preact/reference/classes/MutationCache.md b/docs/framework/preact/reference/classes/MutationCache.md new file mode 100644 index 00000000000..f79919b1c4b --- /dev/null +++ b/docs/framework/preact/reference/classes/MutationCache.md @@ -0,0 +1,308 @@ +--- +id: MutationCache +title: MutationCache +--- + +Defined in: [packages/query-core/src/mutationCache.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L117) + +The `MutationCache` is the storage for mutations. + +Normally, you will not interact with the `MutationCache` directly and instead use a +`QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of +safe/known updates to the cache, such as mutations being added, removed, or updated. + +## Extends + +- `Subscribable`\<`MutationCacheListener`\> + +## Constructors + +### Constructor + +```ts +new MutationCache(config): MutationCache; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) + +#### Parameters + +##### config + +[`MutationCacheConfig`](../interfaces/MutationCacheConfig.md) = `{}` + +#### Returns + +`MutationCache` + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### config + +```ts +config: MutationCacheConfig = {}; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) + +*** + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:229](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L229) + +Removes all mutations from the cache. + +#### Returns + +`void` + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +mutationCache.clear() +``` + +*** + +### find() + +```ts +find(filters): + | Mutation + | undefined; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L271) + +A slightly more advanced method that can be used to get an existing mutation instance from +the cache. If the mutation does not exist, `undefined` is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about a mutation in rare scenarios. + +#### Type Parameters + +##### TData + +`TData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TVariables + +`TVariables` = `any` + +##### TOnMutateResult + +`TOnMutateResult` = `unknown` + +#### Parameters + +##### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) + +#### Returns + + \| [`Mutation`](Mutation.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + \| `undefined` + +#### See + +[MutationCache#findAll](#findall) + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +``` + +*** + +### findAll() + +```ts +findAll(filters): Mutation[]; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:301](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L301) + +An even more advanced method that can be used to get existing mutation instances from the +cache that match the given filters. If no mutations match, an empty array is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about mutations in rare scenarios. + +#### Parameters + +##### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) = `{}` + +#### Returns + +[`Mutation`](Mutation.md)\<`unknown`, `Error`, `unknown`, `unknown`\>[] + +#### See + +[MutationCache#find](#find) + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutations = mutationCache.findAll({ mutationKey: ['addPost'] }) +``` + +*** + +### getAll() + +```ts +getAll(): Mutation[]; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:252](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L252) + +Returns all mutations within the cache. + +This is not typically needed for most applications, but can come in handy when needing more +information about a mutation in rare scenarios. + +#### Returns + +[`Mutation`](Mutation.md)\<`unknown`, `Error`, `unknown`, `unknown`\>[] + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutations = mutationCache.getAll() +``` + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L23) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L27) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`MutationCacheListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/preact/reference/classes/MutationObserver.md b/docs/framework/preact/reference/classes/MutationObserver.md new file mode 100644 index 00000000000..a121c67b0e8 --- /dev/null +++ b/docs/framework/preact/reference/classes/MutationObserver.md @@ -0,0 +1,335 @@ +--- +id: MutationObserver +title: MutationObserver +--- + +Defined in: [packages/query-core/src/mutationObserver.ts:38](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L38) + +Observes a single mutation and derives a `MutationObserverResult` from it. +A framework hook like `useMutation` creates one `MutationObserver` per hook +call, keeps it stable across re-renders, calls `setOptions` when the options +passed to the hook change, subscribes to it to re-render on updates, and +reads `getCurrentResult()` for the value to return. Calling `mutate()` +builds a new underlying `Mutation` in the `MutationCache` and executes it. + +## Example + +```ts +const observer = new MutationObserver(queryClient, { + mutationFn: (variables: { title: string }) => addPost(variables), +}) +``` + +## Extends + +- `Subscribable`\<`MutationObserverListener`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Constructors + +### Constructor + +```ts +new MutationObserver(client, options): MutationObserver; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:58](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L58) + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`MutationObserver`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Overrides + +```ts +Subscribable< + MutationObserverListener +>.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +*** + +### options + +```ts +options: MutationObserverOptions; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:46](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L46) + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L75) + +#### Returns + +`void` + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): MutationObserverResult; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:155](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L155) + +Returns the observer's current result, derived from the observed +mutation's state (or the default, `idle` state if no mutation has been +built yet, e.g. before the first `mutate()` call or after `reset()`). + +#### Returns + +[`MutationObserverResult`](../type-aliases/MutationObserverResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### mutate() + +```ts +mutate(variables, options?): Promise; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:207](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L207) + +Builds a new `Mutation` in the `MutationCache` using the observer's +current options, detaches this observer from any previously observed +mutation, attaches it to the new one, and executes it with the given +variables. + +The optional per-call `options` (`onSuccess`/`onError`/`onSettled`) are +invoked once the mutation settles, in addition to any callbacks defined +on the observer's own options. + +#### Parameters + +##### variables + +`TVariables` + +##### options? + +[`MutateOptions`](../interfaces/MutateOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +await observer.mutate( + { title: 'New post' }, + { onSuccess: (data) => console.log(data) }, +) +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L127) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L135) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### reset() + +```ts +reset(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L180) + +Detaches the observer from the mutation it is currently observing (if +any) and resets the observed result back to its default, `idle` state. + +This does not cancel an in-flight mutation; the mutation itself keeps +running to completion and its own callbacks still fire, but this +observer stops reflecting its state and a subsequent `mutate()` call +will build a brand new mutation. + +#### Returns + +`void` + +#### Example + +```ts +observer.reset() +``` + +#### See + +[MutationObserver#mutate](#mutate) + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L96) + +Updates the observer's options. + +If the new `mutationKey` differs from the previous one (and both were +defined), the observer is reset, detaching it from the mutation it was +observing. Otherwise, if the currently observed mutation is still +`pending`, its options are updated in place as well. + +#### Parameters + +##### options + +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setOptions({ + mutationFn: (variables: { title: string }) => addPost(variables), + onSuccess: (data) => console.log(data), +}) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`MutationObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/preact/reference/classes/QueriesObserver.md b/docs/framework/preact/reference/classes/QueriesObserver.md new file mode 100644 index 00000000000..a40f2d2bef6 --- /dev/null +++ b/docs/framework/preact/reference/classes/QueriesObserver.md @@ -0,0 +1,325 @@ +--- +id: QueriesObserver +title: QueriesObserver +--- + +Defined in: [packages/query-core/src/queriesObserver.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L54) + +A `QueriesObserver` watches an array of queries at once, exposing them as +a single array of `QueryObserverResult`s (or, when a `combine` option is +given, as a combined value derived from that array). It manages one +internal `QueryObserver` per query, and is the primitive that framework +adapters (e.g. `useQueries`) build their hooks on top of. + +## Example + +```ts +const observer = new QueriesObserver(queryClient, [ + { queryKey: ['post', 1], queryFn: fetchPost }, + { queryKey: ['post', 2], queryFn: fetchPost }, +]) + +const unsubscribe = observer.subscribe((result) => { + console.log(result) +}) +``` + +## Extends + +- `Subscribable`\<`QueriesObserverListener`\> + +## Type Parameters + +### TCombinedResult + +`TCombinedResult` = [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +## Constructors + +### Constructor + +```ts +new QueriesObserver( + client, + queries, +options?): QueriesObserver; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L68) + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`any`, `any`, `any`, `any`, `any`, `never`\>[] + +##### options? + +[`QueriesObserverOptions`](../interfaces/QueriesObserverOptions.md)\<`TCombinedResult`\> + +#### Returns + +`QueriesObserver`\<`TCombinedResult`\> + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L104) + +Stops observing all queries: clears all listeners and destroys every +underlying `QueryObserver` this observer manages. + +#### Returns + +`void` + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): QueryObserverResult[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L208) + +Returns the most recently computed array of `QueryObserverResult`s, one +per observed query, in the same order as the queries passed to the +constructor or `setQueries`. + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +#### Example + +```ts +const results = observer.getCurrentResult() +const data = results.map((result) => result.data) +``` + +*** + +### getObservers() + +```ts +getObservers(): QueryObserver[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L225) + +Returns the underlying `QueryObserver` instances this observer manages, +in the same order as the queries passed to the constructor or +`setQueries`. + +#### Returns + +[`QueryObserver`](QueryObserver.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[]\>[] + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(queries, combine): [QueryObserverResult[], (r?) => TCombinedResult, () => QueryObserverResult[]]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L236) + +The `QueriesObserver` counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult) — computes +the result for the given (already-defaulted) queries right now, synchronously. Called by +framework adapters (e.g. `useQueries`) ahead of subscribing, returning a tuple of the raw +per-query results, a function to compute the combined result from them, and a function to +wrap the results for property-access tracking. + +#### Parameters + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[], `never`\>[] + +##### combine + +`CombineFn`\<`TCombinedResult`\> | `undefined` + +#### Returns + +\[[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[], (`r?`) => `TCombinedResult`, () => [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[]\] + +*** + +### getQueries() + +```ts +getQueries(): Query[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:216](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L216) + +Returns the underlying `Query` instances currently being observed, in +the same order as the queries passed to the constructor or `setQueries`. + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L84) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L94) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setQueries() + +```ts +setQueries(queries, options?): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:125](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L125) + +Replaces the set of queries being observed. Existing `QueryObserver`s +are reused for queries that match an already-observed query hash; +observers for queries that are no longer present are destroyed, and new +observers are created and subscribed to for newly added queries. + +#### Parameters + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[], `never`\>[] + +##### options? + +[`QueriesObserverOptions`](../interfaces/QueriesObserverOptions.md)\<`TCombinedResult`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setQueries([ + { queryKey: ['post', 1], queryFn: fetchPost }, + { queryKey: ['post', 3], queryFn: fetchPost }, +]) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueriesObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/preact/reference/classes/Query.md b/docs/framework/preact/reference/classes/Query.md new file mode 100644 index 00000000000..bc15461e541 --- /dev/null +++ b/docs/framework/preact/reference/classes/Query.md @@ -0,0 +1,585 @@ +--- +id: Query +title: Query +--- + +Defined in: [packages/query-core/src/query.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L225) + +Represents a single cached query. A `Query` holds the query's key, options, +state (data/error/status), and the observers currently subscribed to it. + +Instances are created and managed internally by `QueryCache`; application +code typically interacts with queries indirectly through `QueryClient` or +a framework hook like `useQuery`. Direct access to a `Query` instance is +possible via `queryCache.find()`/`findAll()` for inspecting cache state. + +## Example + +```ts +const queryCache = queryClient.getQueryCache() +const query = queryCache.find({ queryKey: ['posts'] }) + +if (query) { + console.log(query.state.dataUpdatedAt) +} +``` + +## Extends + +- `Removable` + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Constructors + +### Constructor + +```ts +new Query(config): Query; +``` + +Defined in: [packages/query-core/src/query.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L246) + +#### Parameters + +##### config + +`QueryConfig`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Query`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Overrides + +```ts +Removable.constructor +``` + +## Properties + +### gcTime + +```ts +gcTime: number; +``` + +Defined in: [packages/query-core/src/removable.ts:7](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L7) + +#### Inherited from + +```ts +Removable.gcTime +``` + +*** + +### observers + +```ts +observers: QueryObserver[]; +``` + +Defined in: [packages/query-core/src/query.ts:242](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L242) + +*** + +### options + +```ts +options: QueryOptions; +``` + +Defined in: [packages/query-core/src/query.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L233) + +*** + +### queryHash + +```ts +queryHash: string; +``` + +Defined in: [packages/query-core/src/query.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L232) + +*** + +### queryKey + +```ts +queryKey: TQueryKey; +``` + +Defined in: [packages/query-core/src/query.ts:231](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L231) + +*** + +### state + +```ts +state: QueryState; +``` + +Defined in: [packages/query-core/src/query.ts:234](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L234) + +## Accessors + +### meta + +#### Get Signature + +```ts +get meta(): Record | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L264) + +The `meta` object passed in the query's options, if any. + +##### Returns + +`Record`\<`string`, `unknown`\> \| `undefined` + +*** + +### promise + +#### Get Signature + +```ts +get promise(): Promise | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L277) + +The promise for the currently in-flight fetch, if the query is fetching. +`undefined` when the query is not fetching. + +##### Returns + +`Promise`\<`TData`\> \| `undefined` + +## Methods + +### cancel() + +```ts +cancel(options?): Promise; +``` + +Defined in: [packages/query-core/src/query.ts:348](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L348) + +Cancels the query's currently in-flight fetch, if any. +- Returns a promise that resolves once the cancellation has settled. +- If no fetch is in progress, resolves immediately. + +#### Parameters + +##### options? + +[`CancelOptions`](../interfaces/CancelOptions.md) + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await query.cancel() +``` + +*** + +### clearGcTimeout() + +```ts +protected clearGcTimeout(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L32) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.clearGcTimeout +``` + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/query.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L361) + +Clears the query's garbage collection timeout and silently cancels any +in-flight fetch. Called by `QueryCache` when the query is removed from +the cache. + +#### Returns + +`void` + +#### See + +[Query#cancel](#cancel) + +#### Overrides + +```ts +Removable.destroy +``` + +*** + +### fetch() + +```ts +fetch(options?, fetchOptions?): Promise; +``` + +Defined in: [packages/query-core/src/query.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L590) + +Fetches the query, i.e. runs its `queryFn` (through any configured +retryer/behavior) and updates the query's state with the result. +- If a fetch is already in flight, returns its promise instead of + starting a new one, unless `fetchOptions.cancelRefetch` is set and the + query already has data, in which case the current fetch is silently + cancelled first. +- If `options` is passed, it replaces the query's current options + before fetching. + +#### Parameters + +##### options? + +[`QueryOptions`](../interfaces/QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\> + +##### fetchOptions? + +`FetchOptions`\<`TQueryFnData`\> + +#### Returns + +`Promise`\<`TData`\> + +*** + +### getObserversCount() + +```ts +getObserversCount(): number; +``` + +Defined in: [packages/query-core/src/query.ts:560](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L560) + +Returns the number of observers currently subscribed to this query. + +#### Returns + +`number` + +#### Example + +```ts +if (query.getObserversCount() === 0) { + // no component is currently watching this query +} +``` + +*** + +### invalidate() + +```ts +invalidate(): void; +``` + +Defined in: [packages/query-core/src/query.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L574) + +Marks the query as invalidated, unless it is already invalidated. This +updates `state.isInvalidated` and notifies observers, but does not by +itself trigger a refetch. + +#### Returns + +`void` + +#### Example + +```ts +query.invalidate() +``` + +*** + +### isActive() + +```ts +isActive(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:386](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L386) + +Returns `true` if the query has at least one observer for which `enabled` +does not resolve to `false`. + +#### Returns + +`boolean` + +*** + +### isDisabled() + +```ts +isDisabled(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:400](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L400) + +Returns `true` if the query is disabled, meaning it will not fetch +automatically. +- If the query has observers, it is disabled when none of them are active + (see `isActive`). +- If the query has no observers, it is disabled when its `queryFn` is + `skipToken` or it has never been fetched. + +#### Returns + +`boolean` + +*** + +### isFetched() + +```ts +isFetched(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:412](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L412) + +Returns `true` if the query has been fetched, i.e. it has resolved with +either data or an error at least once. + +#### Returns + +`boolean` + +*** + +### isStale() + +```ts +isStale(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:447](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L447) + +Returns `true` if the query is stale. +- If the query has observers, defers to whether any observer's current + result reports `isStale` (which accounts for each observer's own + `staleTime` and `enabled` state). +- If the query has no observers, it is considered stale when it has no + data or has been invalidated. + +#### Returns + +`boolean` + +#### See + +[Query#isStaleByTime](#isstalebytime) + +#### Example + +```ts +if (query.isStale()) { + // refetch or otherwise treat the cached data as outdated +} +``` + +*** + +### isStaleByTime() + +```ts +isStaleByTime(staleTime): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:473](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L473) + +Returns `true` if the query's data is stale relative to the given +`staleTime` (defaults to `0`). +- A query with no data is always stale. +- `staleTime: 'static'` is never stale. +- An invalidated query is always stale. +- Otherwise, staleness is based on elapsed time since `dataUpdatedAt`. + +#### Parameters + +##### staleTime + +[`StaleTime`](../type-aliases/StaleTime.md) = `0` + +#### Returns + +`boolean` + +#### See + +[Query#isStale](#isstale) + +#### Example + +```ts +const isStale = query.isStaleByTime(1000 * 60) +``` + +*** + +### isStatic() + +```ts +isStatic(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:420](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L420) + +Returns `true` if the query has at least one observer configured with +`staleTime: 'static'`, meaning it is treated as never stale. + +#### Returns + +`boolean` + +*** + +### optionalRemove() + +```ts +protected optionalRemove(): void; +``` + +Defined in: [packages/query-core/src/query.ts:305](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L305) + +#### Returns + +`void` + +#### Overrides + +```ts +Removable.optionalRemove +``` + +*** + +### reset() + +```ts +reset(): void; +``` + +Defined in: [packages/query-core/src/query.ts:377](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L377) + +Resets the query back to its initial state (the state it had when it was +first created, e.g. any `initialData`), destroying it first to cancel any +in-flight fetch. + +#### Returns + +`void` + +*** + +### scheduleGc() + +```ts +protected scheduleGc(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L14) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.scheduleGc +``` + +*** + +### setState() + +```ts +setState(state): void; +``` + +Defined in: [packages/query-core/src/query.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L334) + +Merges the given partial state directly into this query's state, notifying observers. Used +by persistence and broadcast plugins to restore a state snapshot, and by devtools to let a +user manually trigger a loading/error state or edit the cached data. + +#### Parameters + +##### state + +`Partial`\<[`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\>\> + +#### Returns + +`void` + +*** + +### updateGcTime() + +```ts +protected updateGcTime(newGcTime): void; +``` + +Defined in: [packages/query-core/src/removable.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L24) + +#### Parameters + +##### newGcTime + +`number` | `undefined` + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.updateGcTime +``` diff --git a/docs/framework/preact/reference/classes/QueryCache.md b/docs/framework/preact/reference/classes/QueryCache.md new file mode 100644 index 00000000000..8e435445b2c --- /dev/null +++ b/docs/framework/preact/reference/classes/QueryCache.md @@ -0,0 +1,461 @@ +--- +id: QueryCache +title: QueryCache +--- + +Defined in: [packages/query-core/src/queryCache.ts:113](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L113) + +The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta +information, and state of the queries it contains. + +Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient` +for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of +safe/known updates to the cache, such as queries being added, removed, or updated. + +## Extends + +- `Subscribable`\<`QueryCacheListener`\> + +## Constructors + +### Constructor + +```ts +new QueryCache(config): QueryCache; +``` + +Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) + +#### Parameters + +##### config + +[`QueryCacheConfig`](../interfaces/QueryCacheConfig.md) = `{}` + +#### Returns + +`QueryCache` + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### config + +```ts +config: QueryCacheConfig = {}; +``` + +Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) + +*** + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### build() + +```ts +build( + client, + options, +state?): Query; +``` + +Defined in: [packages/query-core/src/queryCache.ts:137](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L137) + +Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or +builds and adds a new one to the cache if none exists yet. Used by framework adapters and +plugins (e.g. broadcast/persistence) that need to get-or-create a `Query` directly, bypassing +the reactive `QueryObserver` machinery. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](../interfaces/QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\>, `"queryKey"`\> + +##### state? + +[`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\> + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const query = queryCache.build(queryClient, { + queryKey: ['posts'], + queryFn: fetchPosts, +}) +``` + +*** + +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:222](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L222) + +Removes all queries from the cache. + +#### Returns + +`void` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +queryCache.clear() +``` + +*** + +### find() + +```ts +find(filters): + | Query + | undefined; +``` + +Defined in: [packages/query-core/src/queryCache.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L289) + +A slightly more advanced method that can be used to get an existing query instance from the +cache. This instance not only contains all the state for the query, but all of the instances, +and underlying guts of the query as well. If the query does not exist, `undefined` is +returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about a query in rare scenarios (e.g. looking at `query.state.dataUpdatedAt` to +decide whether a query is fresh enough to be used as an initial value). + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +#### Parameters + +##### filters + +[`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryFilters`](../interfaces/QueryFilters.md)\, `"queryKey"`\> + +#### Returns + + \| [`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, readonly `unknown`[]\> + \| `undefined` + +#### See + +[QueryCache#findAll](#findall) + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const query = queryCache.find({ queryKey: ['posts'] }) +``` + +*** + +### findAll() + +```ts +findAll(filters): Query[]; +``` + +Defined in: [packages/query-core/src/queryCache.ts:314](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L314) + +An even more advanced method that can be used to get existing query instances from the cache +that partially match a query key. If no queries match, an empty array is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about queries in rare scenarios. + +#### Parameters + +##### filters + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = `{}` + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +#### See + +[QueryCache#find](#find) + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const queries = queryCache.findAll({ queryKey: ['posts'] }) +``` + +*** + +### get() + +```ts +get(queryHash): + | Query + | undefined; +``` + +Defined in: [packages/query-core/src/queryCache.ts:244](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L244) + +Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none +exists. Unlike [QueryCache#find](#find), this looks up by the already-computed hash rather +than by `QueryFilters`. Used by plugins (e.g. broadcast/hydration) that already have a hash +to look up directly. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### queryHash + +`string` + +#### Returns + + \| [`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + \| `undefined` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() +const queryHash = hashKey(['posts']) + +const query = queryCache.get(queryHash) +``` + +*** + +### getAll() + +```ts +getAll(): Query[]; +``` + +Defined in: [packages/query-core/src/queryCache.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L267) + +Returns all queries within the cache. + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const queries = queryCache.getAll() +``` + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L23) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L27) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### remove() + +```ts +remove(query): void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:198](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L198) + +Destroys the given `Query` and removes it from the cache, notifying subscribers with a +`'removed'` event. A no-op if the query is no longer the one currently stored under its hash +(e.g. it was already replaced). Used by plugins (e.g. the broadcast client) that mirror +removals across `QueryCache` instances. + +#### Parameters + +##### query + +[`Query`](Query.md)\<`any`, `any`, `any`, `any`\> + +#### Returns + +`void` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() +const query = queryCache.find({ queryKey: ['posts'] }) + +if (query) { + queryCache.remove(query) +} +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueryCacheListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/preact/reference/classes/QueryClient.md b/docs/framework/preact/reference/classes/QueryClient.md new file mode 100644 index 00000000000..03250c00243 --- /dev/null +++ b/docs/framework/preact/reference/classes/QueryClient.md @@ -0,0 +1,1455 @@ +--- +id: QueryClient +title: QueryClient +--- + +Defined in: [packages/query-core/src/queryClient.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L78) + +`QueryClient` is used to interact with a cache of queries and mutations. It owns a +`QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds +the default options that are applied to queries and mutations created through it. + +```ts +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + staleTime: Infinity, + }, + }, +}) + +await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts }) +``` + +## Constructors + +### Constructor + +```ts +new QueryClient(config): QueryClient; +``` + +Defined in: [packages/query-core/src/queryClient.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L88) + +#### Parameters + +##### config + +[`QueryClientConfig`](../interfaces/QueryClientConfig.md) = `{}` + +#### Returns + +`QueryClient` + +## Methods + +### cancelQueries() + +```ts +cancelQueries(filters?, cancelOptions?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L425) + +Cancels outgoing fetches for queries matching the given filters. Most useful when performing +optimistic updates, since any outgoing refetch that resolves afterwards would otherwise +overwrite the optimistic update. By default (`revert: true`), a cancelled query's data is +reverted to its state before the outgoing fetch started. + +The returned promise never rejects, even if individual cancellations fail. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +##### cancelOptions? + +[`CancelOptions`](../interfaces/CancelOptions.md) = `{}` + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.cancelQueries({ queryKey: ['posts'], exact: true }) +``` + +*** + +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1073) + +Clears both the query cache and the mutation cache this client is connected to. + +#### Returns + +`void` + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +queryClient.clear() +``` + +*** + +### defaultMutationOptions() + +```ts +defaultMutationOptions(options?): T; +``` + +Defined in: [packages/query-core/src/queryClient.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1047) + +The mutation counterpart of [QueryClient#defaultQueryOptions](#defaultqueryoptions). Called by framework +adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the +given `mutationKey`, then the client's `defaultOptions.mutations`, then the caller's options +on top. A no-op if the options are already defaulted (`_defaulted: true`). + +#### Type Parameters + +##### T + +`T` *extends* [`MutationOptions`](../interfaces/MutationOptions.md)\<`any`, `any`, `any`, `any`\> + +#### Parameters + +##### options? + +`T` + +#### Returns + +`T` + +*** + +### defaultQueryOptions() + +```ts +defaultQueryOptions(options): DefaultedQueryObserverOptions; +``` + +Defined in: [packages/query-core/src/queryClient.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L960) + +Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the +caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the +given `queryKey`, then the client's own `defaultOptions.queries`, then the caller's options +on top. A no-op if the options are already defaulted (`_defaulted: true`). + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\> | [`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +*** + +### ~~ensureInfiniteQueryData()~~ + +```ts +ensureInfiniteQueryData(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryClient.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L725) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`EnsureInfiniteQueryDataOptions`](../type-aliases/EnsureInfiniteQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\> + +#### Deprecated + +Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version. + +*** + +### ~~ensureQueryData()~~ + +```ts +ensureQueryData(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L196) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### options + +[`EnsureQueryDataOptions`](../interfaces/EnsureQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Deprecated + +Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version. + +*** + +### ~~fetchInfiniteQuery()~~ + +```ts +fetchInfiniteQuery(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryClient.ts:682](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L682) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\> + +#### Deprecated + +Use queryClient.infiniteQuery(options) instead. This method will be removed in the next major version. + +*** + +### ~~fetchQuery()~~ + +```ts +fetchQuery(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L590) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Deprecated + +Use queryClient.query(options) instead. This method will be removed in the next major version. + +*** + +### getDefaultOptions() + +```ts +getDefaultOptions(): DefaultOptions; +``` + +Defined in: [packages/query-core/src/queryClient.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L808) + +Returns the default options that were set when creating the client, or via +[QueryClient#setDefaultOptions](#setdefaultoptions). + +#### Returns + +[`DefaultOptions`](../interfaces/DefaultOptions.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const defaultOptions = queryClient.getDefaultOptions() +``` + +*** + +### getMutationCache() + +```ts +getMutationCache(): MutationCache; +``` + +Defined in: [packages/query-core/src/queryClient.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L792) + +Returns the mutation cache this client is connected to. + +#### Returns + +[`MutationCache`](MutationCache.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const mutationCache = queryClient.getMutationCache() +const mutations = mutationCache.findAll({ status: 'pending' }) +``` + +*** + +### getMutationDefaults() + +```ts +getMutationDefaults(mutationKey): OmitKeyof, "mutationKey">; +``` + +Defined in: [packages/query-core/src/queryClient.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L935) + +Returns the default options registered for mutations whose mutation key partially matches +the given `mutationKey`, via [QueryClient#setMutationDefaults](#setmutationdefaults). If multiple registered +defaults match, they are merged together in registration order. + +#### Parameters + +##### mutationKey + +readonly `unknown`[] + +#### Returns + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`any`, `any`, `any`, `any`\>, `"mutationKey"`\> + +#### Example + +```ts +const defaultOptions = queryClient.getMutationDefaults(['addPost']) +``` + +*** + +### getQueriesData() + +```ts +getQueriesData(filters): [readonly unknown[], TQueryFnData | undefined][]; +``` + +Defined in: [packages/query-core/src/queryClient.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L233) + +Imperative (non-reactive) way to retrieve the cached data of multiple queries at once. +Only queries matching the given filters are returned; if none match, an empty array is +returned. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters + +`TQueryFilters` + +#### Returns + +\[readonly `unknown`[], `TQueryFnData` \| `undefined`\][] + +#### See + +[QueryClient#getQueryData](#getquerydata) + +#### Example + +```ts +const data = queryClient.getQueriesData({ queryKey: ['posts'] }) +``` + +*** + +### getQueryCache() + +```ts +getQueryCache(): QueryCache; +``` + +Defined in: [packages/query-core/src/queryClient.ts:776](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L776) + +Returns the query cache this client is connected to. + +#### Returns + +[`QueryCache`](QueryCache.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const queryCache = queryClient.getQueryCache() +const queries = queryCache.findAll({ queryKey: ['posts'] }) +``` + +*** + +### getQueryData() + +```ts +getQueryData(queryKey): TInferredQueryFnData | undefined; +``` + +Defined in: [packages/query-core/src/queryClient.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L182) + +Imperative (non-reactive) way to retrieve data for a QueryKey. +Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. + +Hint: Do not use this function inside a component, because it won't receive updates. +Use `useQuery` to create a `QueryObserver` that subscribes to changes. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +#### Returns + +`TInferredQueryFnData` \| `undefined` + +#### See + +[QueryClient#getQueriesData](#getqueriesdata) + +*** + +### getQueryDefaults() + +```ts +getQueryDefaults(queryKey): OmitKeyof, "queryKey">; +``` + +Defined in: [packages/query-core/src/queryClient.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L878) + +Returns the default options registered for queries whose query key partially matches the +given `queryKey`, via [QueryClient#setQueryDefaults](#setquerydefaults). If multiple registered defaults +match, they are merged together in registration order. + +#### Parameters + +##### queryKey + +readonly `unknown`[] + +#### Returns + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`any`, `any`, `any`, `any`, `any`\>, `"queryKey"`\> + +#### Example + +```ts +const defaultOptions = queryClient.getQueryDefaults(['posts']) +``` + +*** + +### getQueryState() + +```ts +getQueryState(queryKey): + | QueryState + | undefined; +``` + +Defined in: [packages/query-core/src/queryClient.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L343) + +Imperative (non-reactive) way to retrieve an existing query's state. If the query does not +exist, `undefined` is returned. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +##### TInferredError + +`TInferredError` = [`InferErrorFromTag`](../type-aliases/InferErrorFromTag.md)\<`TError`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +#### Returns + + \| [`QueryState`](../interfaces/QueryState.md)\<`TInferredQueryFnData`, `TInferredError`\> + \| `undefined` + +#### Example + +```ts +const state = queryClient.getQueryState(['posts']) +console.log(state?.dataUpdatedAt) +``` + +*** + +### infiniteQuery() + +```ts +infiniteQuery(options): Promise[] ? InfiniteData : TData>; +``` + +Defined in: [packages/query-core/src/queryClient.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L656) + +Asynchronous method to fetch and cache an infinite query, resolving with an +[InfiniteData](../interfaces/InfiniteData.md) object or throwing with the error. + +Behaves like [QueryClient#query](#query), accepting the same options (minus +`initialPageParam`), plus the required `initialPageParam`, and an optional `pages` / +`getNextPageParam` pair used to refetch a fixed number of pages from the start. + +This method replaces the deprecated `fetchInfiniteQuery`, and — combined with +`{ staleTime: 'static' }` — the deprecated `ensureInfiniteQueryData`. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`InfiniteQueryExecuteOptions`](../type-aliases/InfiniteQueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`[] *extends* [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>[] ? [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\> : `TData`\> + +#### Example + +```ts +try { + const data = await queryClient.infiniteQuery({ queryKey, queryFn, initialPageParam: 0 }) + console.log(data.pages) +} catch (error) { + console.log(error) +} +``` + +*** + +### invalidateQueries() + +```ts +invalidateQueries(filters?, options?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:453](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L453) + +Marks queries matching the given filters as invalidated. Unlike +[QueryClient#removeQueries](#removequeries), invalidated queries stay in the cache. + +Unless `filters.refetchType` is `'none'`, matching queries are then refetched via +[QueryClient#refetchQueries](#refetchqueries), using `filters.refetchType` if set, otherwise +`filters.type`, otherwise `'active'`. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`InvalidateQueryFilters`](../interfaces/InvalidateQueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`InvalidateOptions`](../interfaces/InvalidateOptions.md) = `{}` + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' }) +``` + +*** + +### isFetching() + +```ts +isFetching(filters?): number; +``` + +Defined in: [packages/query-core/src/queryClient.ts:149](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L149) + +Returns the number of queries in the cache that are currently fetching, optionally +matching a set of filters. This includes background-fetching, loading new pages, and +loading more infinite query results. + +#### Type Parameters + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters? + +`TQueryFilters` + +#### Returns + +`number` + +#### Example + +```ts +if (queryClient.isFetching()) { + console.log('At least one query is fetching!') +} +``` + +*** + +### isMutating() + +```ts +isMutating(filters?): number; +``` + +Defined in: [packages/query-core/src/queryClient.ts:167](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L167) + +Returns the number of mutations in the cache that are currently pending, optionally +matching a set of filters. + +#### Type Parameters + +##### TMutationFilters + +`TMutationFilters` *extends* [`MutationFilters`](../interfaces/MutationFilters.md)\<`any`, `any`, `unknown`, `unknown`\> = [`MutationFilters`](../interfaces/MutationFilters.md)\<`unknown`, `Error`, `unknown`, `unknown`\> + +#### Parameters + +##### filters? + +`TMutationFilters` + +#### Returns + +`number` + +#### Example + +```ts +if (queryClient.isMutating()) { + console.log('At least one mutation is pending!') +} +``` + +*** + +### mount() + +```ts +mount(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L103) + +Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start +listening for focus/online events and resume paused mutations. Ref-counted via an internal +mount count, so nested or multiple providers sharing the same `QueryClient` don't tear down +the shared listeners until the last one unmounts. + +#### Returns + +`void` + +*** + +### ~~prefetchInfiniteQuery()~~ + +```ts +prefetchInfiniteQuery(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L704) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`void`\> + +#### Deprecated + +Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version. + +*** + +### ~~prefetchQuery()~~ + +```ts +prefetchQuery(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:624](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L624) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### options + +[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Promise`\<`void`\> + +#### Deprecated + +Use queryClient.query(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version. + +*** + +### query() + +```ts +query(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:544](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L544) + +Asynchronous method to fetch and cache a query, resolving with the data or throwing with +the error. + +If the query already exists in the cache and its data is not stale (per the given +`staleTime`), the cached data is returned without fetching. Otherwise, the query is fetched +and the promise resolves once the fetch settles. If a `select` function is provided, it is +applied to the data in both cases (cached or freshly fetched) before it is returned. + +Unlike `useQuery`, retries are disabled by default here (`retry: false`) unless explicitly +configured, since there is no component to catch a thrown error and retry through re-render. + +The accepted options are a subset of `useQuery`'s options: fields that only make sense for a +reactive observer (e.g. `enabled`, `refetchInterval`, `refetchOnWindowFocus`, `notifyOnChangeProps`, +`throwOnError`, `suspense`, `placeholderData`) are not part of this method's options. + +This method replaces the deprecated `fetchQuery`, and — combined with +`{ staleTime: 'static' }` — the deprecated `ensureQueryData`. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`QueryExecuteOptions`](../interfaces/QueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +try { + const data = await queryClient.query({ queryKey, queryFn, staleTime: 10000 }) +} catch (error) { + console.log(error) +} +``` + +*** + +### refetchQueries() + +```ts +refetchQueries(filters?, options?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:490](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L490) + +Refetches queries matching the given filters, regardless of whether they are stale. Without +filters, every query in the cache is refetched. Queries that are disabled, or static (only +have observers with a static `staleTime`), are never refetched. + +By default (`cancelRefetch: true`), a currently running fetch is cancelled before the new +one starts. The returned promise resolves once all matching queries have settled; it does +not reject on individual query failures unless `throwOnError` is set. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`RefetchQueryFilters`](../interfaces/RefetchQueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +// refetch all active queries partially matching a query key: +await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' }) +``` + +*** + +### removeQueries() + +```ts +removeQueries(filters?): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:369](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L369) + +Removes queries from the cache that match the given filters. Unlike +[QueryClient#invalidateQueries](#invalidatequeries) or [QueryClient#refetchQueries](#refetchqueries), this removes +matching queries from the cache instead of refetching them. Without filters, every query in +the cache is removed. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +#### Returns + +`void` + +#### Example + +```ts +queryClient.removeQueries({ queryKey: ['posts'], exact: true }) +``` + +*** + +### resetQueries() + +```ts +resetQueries(filters?, options?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L390) + +Resets queries matching the given filters back to their initial state (e.g. any +`initialData`), notifying subscribers rather than removing them. Active queries among the +matched set are then refetched, and the returned promise resolves once that refetch settles. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`ResetOptions`](../interfaces/ResetOptions.md) + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.resetQueries({ queryKey: ['posts'], exact: true }) +``` + +*** + +### resumePausedMutations() + +```ts +resumePausedMutations(): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:757](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L757) + +Resumes mutations that were paused because there was no network connection. Does nothing +(resolving immediately) if the client is currently offline. + +#### Returns + +`Promise`\<`unknown`\> + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +await queryClient.resumePausedMutations() +``` + +*** + +### setDefaultOptions() + +```ts +setDefaultOptions(options): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L829) + +Dynamically sets the default options for this client, overwriting any previously defined +default options. + +#### Parameters + +##### options + +[`DefaultOptions`](../interfaces/DefaultOptions.md) + +#### Returns + +`void` + +#### See + +[QueryClient#getDefaultOptions](#getdefaultoptions) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +queryClient.setDefaultOptions({ + queries: { + staleTime: Infinity, + }, +}) +``` + +*** + +### setMutationDefaults() + +```ts +setMutationDefaults(mutationKey, options): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L907) + +Sets default options for mutations whose mutation key partially matches the given +`mutationKey`. As with [QueryClient#setQueryDefaults](#setquerydefaults), the order of registration +matters when several registered defaults match the same mutation key. + +#### Type Parameters + +##### TData + +`TData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TVariables + +`TVariables` = `void` + +##### TOnMutateResult + +`TOnMutateResult` = `unknown` + +#### Parameters + +##### mutationKey + +readonly `unknown`[] + +##### options + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> + +#### Returns + +`void` + +#### See + +[QueryClient#getMutationDefaults](#getmutationdefaults) + +#### Example + +```ts +queryClient.setMutationDefaults(['addPost'], { mutationFn: addPost }) +``` + +*** + +### setQueriesData() + +```ts +setQueriesData( + filters, + updater, + options?): [readonly unknown[], TQueryFnData | undefined][]; +``` + +Defined in: [packages/query-core/src/queryClient.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L312) + +Synchronous way to immediately update the cached data of multiple queries at once, using +filters or partial query key matching. Only queries that already exist and match the given +filters are updated; no new cache entries are created. Internally this calls +[QueryClient#setQueryData](#setquerydata) for each matching query. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters + +`TQueryFilters` + +##### updater + +[`Updater`](../type-aliases/Updater.md)\<`NoInfer`\<`TQueryFnData`\> \| `undefined`, `NoInfer`\<`TQueryFnData`\> \| `undefined`\> + +##### options? + +[`SetDataOptions`](../interfaces/SetDataOptions.md) + +#### Returns + +\[readonly `unknown`[], `TQueryFnData` \| `undefined`\][] + +#### Example + +```ts +queryClient.setQueriesData({ queryKey: ['posts'] }, (oldPosts) => + oldPosts ? oldPosts.filter((post) => post.id !== deletedId) : oldPosts, +) +``` + +*** + +### setQueryData() + +```ts +setQueryData( + queryKey, + updater, + options?): NoInfer | undefined; +``` + +Defined in: [packages/query-core/src/queryClient.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L264) + +Synchronous way to immediately update a query's cached data. If the updater (or the value +passed) resolves to `undefined`, the cache is left untouched and no query is created; +otherwise, if the query does not exist yet, it will be created. To update multiple queries +at once by partially matching query keys, use [QueryClient#setQueriesData](#setqueriesdata) instead. + +Updates must be performed immutably: do not mutate `oldData`, or data previously retrieved +via [QueryClient#getQueryData](#getquerydata), in place. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +The query key to set data for. + +##### updater + +[`Updater`](../type-aliases/Updater.md)\<`NoInfer`\<`TInferredQueryFnData`\> \| `undefined`, `NoInfer`\<`TInferredQueryFnData`\> \| `undefined`\> + +Either the new data, or a function that receives the current data (which +may be `undefined`) and returns the new data. + +##### options? + +[`SetDataOptions`](../interfaces/SetDataOptions.md) + +#### Returns + +`NoInfer`\<`TInferredQueryFnData`\> \| `undefined` + +#### Example + +```ts +queryClient.setQueryData(['posts'], newPosts) + +// Or, using an updater function that receives the current data: +queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost]) +``` + +*** + +### setQueryDefaults() + +```ts +setQueryDefaults(queryKey, options): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L848) + +Sets default options for queries whose query key partially matches the given `queryKey`. + +If several registered query defaults match a given query key, they are merged together in +registration order by [QueryClient#getQueryDefaults](#getquerydefaults), so register defaults from the +most generic key to the least generic one — more specific defaults should be registered +after more generic ones so they take precedence. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +#### Parameters + +##### queryKey + +readonly `unknown`[] + +##### options + +`Partial`\<[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`\>, `"queryKey"`\>\> + +#### Returns + +`void` + +#### Example + +```ts +queryClient.setQueryDefaults(['posts'], { queryFn: fetchPosts }) + +await queryClient.query({ queryKey: ['posts'] }) +``` + +*** + +### unmount() + +```ts +unmount(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L126) + +The inverse of [QueryClient#mount](#mount) — called by a framework adapter's +`QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online +listeners once the mount count returns to `0`. + +#### Returns + +`void` diff --git a/docs/framework/preact/reference/classes/QueryObserver.md b/docs/framework/preact/reference/classes/QueryObserver.md new file mode 100644 index 00000000000..51ff16910df --- /dev/null +++ b/docs/framework/preact/reference/classes/QueryObserver.md @@ -0,0 +1,555 @@ +--- +id: QueryObserver +title: QueryObserver +--- + +Defined in: [packages/query-core/src/queryObserver.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L57) + +A `QueryObserver` watches a single query in the `QueryCache` and computes a +`QueryObserverResult` from its state, recomputing and notifying subscribers +whenever the underlying query (or the observer's options) changes. It is +the primitive that framework adapters (e.g. `useQuery`) build their hooks +on top of, but it can also be used directly to observe and switch between +queries outside of any framework. + +## Example + +```ts +const observer = new QueryObserver(queryClient, { + queryKey: ['posts'], + queryFn: fetchPosts, +}) + +const unsubscribe = observer.subscribe((result) => { + console.log(result.data) +}) +``` + +## Extends + +- `Subscribable`\<`QueryObserverListener`\<`TData`, `TError`\>\> + +## Extended by + +- [`InfiniteQueryObserver`](InfiniteQueryObserver.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Constructors + +### Constructor + +```ts +new QueryObserver(client, options): QueryObserver; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L87) + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`QueryObserver`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Overrides + +```ts +Subscribable>.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +*** + +### options + +```ts +options: QueryObserverOptions; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L89) + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L106) + +#### Returns + +`void` + +*** + +### createResult() + +```ts +protected createResult(query, options): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:559](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L559) + +#### Parameters + +##### query + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L161) + +Stops observing the current query: clears all listeners, cancels the +stale and refetch-interval timers, and removes this observer from the +query it was observing. + +#### Returns + +`void` + +*** + +### fetch() + +```ts +protected fetch(fetchOptions): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L448) + +#### Parameters + +##### fetchOptions + +`ObserverFetchOptions` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchOptimistic() + +```ts +fetchOptimistic(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:395](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L395) + +Fetches a query defined by the given options without affecting this +observer's own tracked query or result, and returns a promise that +resolves with the `QueryObserverResult` for that fetch. This is useful +for prefetching data that another observer (e.g. a query about to be +navigated to) will need, ahead of time. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.fetchOptimistic({ + queryKey: ['posts', 2], + queryFn: () => fetchPost(2), +}) +console.log(result.data) +``` + +*** + +### getCurrentQuery() + +```ts +getCurrentQuery(): Query; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:357](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L357) + +Returns the `Query` instance this observer is currently observing. + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L321) + +Returns the most recently computed `QueryObserverResult` for the +observed query. This is a point-in-time read; to be notified of updates +as they happen, subscribe to the observer instead (its inherited +`subscribe` method). + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +#### Example + +```ts +const result = observer.getCurrentResult() +console.log(result.status, result.data) +``` + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(options): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L272) + +Computes the result the observer would produce for the given (already-defaulted) options +right now, building the underlying `Query` if it doesn't exist yet, without waiting for a +subscription callback. Called by framework adapters on every render (e.g. `useQuery`) so the +returned value is available synchronously, ahead of `setOptions` triggering an actual fetch. + +#### Parameters + +##### options + +[`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L110) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L124) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### refetch() + +```ts +refetch(__namedParameters): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L371) + +Refetches the observed query and returns a promise that resolves with +the resulting `QueryObserverResult`. + +#### Parameters + +##### \_\_namedParameters + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.refetch({ cancelRefetch: false }) +console.log(result.data) +``` + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L182) + +Updates the observer's options. This will re-resolve the query being +observed (switching to a different query if the `queryKey` changed), +trigger a fetch if the new options require one and the observer has +subscribers, recompute the current result, and reschedule the stale and +refetch-interval timers as needed. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setOptions({ queryKey: ['posts', 1], queryFn: () => fetchPost(1) }) +// later: switch to a different query, reusing the same observer +observer.setOptions({ queryKey: ['posts', 2], queryFn: () => fetchPost(2) }) +``` + +*** + +### shouldFetchOnReconnect() + +```ts +shouldFetchOnReconnect(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L135) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnReconnect` option) to refetch when the network +reconnects. + +#### Returns + +`boolean` + +*** + +### shouldFetchOnWindowFocus() + +```ts +shouldFetchOnWindowFocus(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L148) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnWindowFocus` option) to refetch when the window +regains focus. + +#### Returns + +`boolean` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueryObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` + +*** + +### trackProp() + +```ts +trackProp(key): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:350](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L350) + +Records that the given `QueryObserverResult` property was read, so a subsequent update only +notifies this observer if a tracked property actually changed. Normally called indirectly via +[QueryObserver#trackResult](#trackresult)'s proxy; exposed directly for adapters that track property +access themselves (e.g. through their own reactivity system) instead of via the proxy. + +#### Parameters + +##### key + +`"error"` | `"data"` | `"isError"` | `"isPending"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isSuccess"` | `"isPlaceholderData"` | `"status"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` + +#### Returns + +`void` + +*** + +### trackResult() + +```ts +trackResult(result, onPropTracked?): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:331](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L331) + +Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via +[QueryObserver#trackProp](#trackprop) (and an optional `onPropTracked` callback). Used by framework +adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on +properties you actually read" behavior. + +#### Parameters + +##### result + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +##### onPropTracked? + +(`key`) => `void` + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### updateResult() + +```ts +updateResult(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L735) + +Recomputes and stores the current result from the current query/options, notifying listeners +if it changed. Framework adapters call this right after subscribing to make sure no query +update was missed in the gap between creating the observer and subscribing to it. + +#### Returns + +`void` diff --git a/docs/framework/preact/reference/functions/HydrationBoundary.md b/docs/framework/preact/reference/functions/HydrationBoundary.md index 9361aad8204..68e0b9b03a9 100644 --- a/docs/framework/preact/reference/functions/HydrationBoundary.md +++ b/docs/framework/preact/reference/functions/HydrationBoundary.md @@ -7,7 +7,7 @@ title: HydrationBoundary function HydrationBoundary(__namedParameters): Element; ``` -Defined in: [preact-query/src/HydrationBoundary.tsx:87](https://github.com/TanStack/query/blob/main/packages/preact-query/src/HydrationBoundary.tsx#L87) +Defined in: [packages/preact-query/src/HydrationBoundary.tsx:87](https://github.com/TanStack/query/blob/main/packages/preact-query/src/HydrationBoundary.tsx#L87) `HydrationBoundary` adds a previously dehydrated state into the `queryClient` that would be returned by `useQueryClient()`. If the client already contains data, the new queries will be intelligently merged based on diff --git a/docs/framework/preact/reference/functions/QueryClientProvider.md b/docs/framework/preact/reference/functions/QueryClientProvider.md index 4795634bfaa..aab9bbf4b6a 100644 --- a/docs/framework/preact/reference/functions/QueryClientProvider.md +++ b/docs/framework/preact/reference/functions/QueryClientProvider.md @@ -7,7 +7,7 @@ title: QueryClientProvider function QueryClientProvider(__namedParameters): VNode; ``` -Defined in: [preact-query/src/QueryClientProvider.tsx:70](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryClientProvider.tsx#L70) +Defined in: [packages/preact-query/src/QueryClientProvider.tsx:70](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryClientProvider.tsx#L70) Use the `QueryClientProvider` component to connect and provide a `QueryClient` to your application. Also calls `client.mount()`/`client.unmount()` as this component mounts/unmounts, which subscribes the client to diff --git a/docs/framework/preact/reference/functions/QueryErrorResetBoundary.md b/docs/framework/preact/reference/functions/QueryErrorResetBoundary.md index 070d4a909ea..f9b670fb653 100644 --- a/docs/framework/preact/reference/functions/QueryErrorResetBoundary.md +++ b/docs/framework/preact/reference/functions/QueryErrorResetBoundary.md @@ -7,7 +7,7 @@ title: QueryErrorResetBoundary function QueryErrorResetBoundary(__namedParameters): Element; ``` -Defined in: [preact-query/src/QueryErrorResetBoundary.tsx:159](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryErrorResetBoundary.tsx#L159) +Defined in: [packages/preact-query/src/QueryErrorResetBoundary.tsx:159](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryErrorResetBoundary.tsx#L159) When using `suspense` or `throwOnError` in your queries, you need a way to let queries know that you want to try again when re-rendering after some error occurred. With the `QueryErrorResetBoundary` component you can diff --git a/docs/framework/preact/reference/functions/defaultShouldDehydrateMutation.md b/docs/framework/preact/reference/functions/defaultShouldDehydrateMutation.md new file mode 100644 index 00000000000..095ccf36e7c --- /dev/null +++ b/docs/framework/preact/reference/functions/defaultShouldDehydrateMutation.md @@ -0,0 +1,23 @@ +--- +id: defaultShouldDehydrateMutation +title: defaultShouldDehydrateMutation +--- + +```ts +function defaultShouldDehydrateMutation(mutation): boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L180) + +The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are +currently paused (e.g. paused by `networkMode` while offline). + +## Parameters + +### mutation + +[`Mutation`](../classes/Mutation.md) + +## Returns + +`boolean` diff --git a/docs/framework/preact/reference/functions/defaultShouldDehydrateQuery.md b/docs/framework/preact/reference/functions/defaultShouldDehydrateQuery.md new file mode 100644 index 00000000000..06afc29d670 --- /dev/null +++ b/docs/framework/preact/reference/functions/defaultShouldDehydrateQuery.md @@ -0,0 +1,23 @@ +--- +id: defaultShouldDehydrateQuery +title: defaultShouldDehydrateQuery +--- + +```ts +function defaultShouldDehydrateQuery(query): boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:188](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L188) + +The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is +`'success'`. + +## Parameters + +### query + +[`Query`](../classes/Query.md) + +## Returns + +`boolean` diff --git a/docs/framework/preact/reference/functions/dehydrate.md b/docs/framework/preact/reference/functions/dehydrate.md new file mode 100644 index 00000000000..b7334de7729 --- /dev/null +++ b/docs/framework/preact/reference/functions/dehydrate.md @@ -0,0 +1,43 @@ +--- +id: dehydrate +title: dehydrate +--- + +```ts +function dehydrate(client, options): DehydratedState; +``` + +Defined in: [packages/query-core/src/hydration.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L210) + +Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`, +typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`. +Which queries/mutations are included, and how their data/errors are transformed, is controlled by `options`, +falling back to the client's `dehydrate` default options, and finally to `defaultShouldDehydrateQuery` / +`defaultShouldDehydrateMutation`. + +## Parameters + +### client + +[`QueryClient`](../classes/QueryClient.md) + +### options + +[`DehydrateOptions`](../interfaces/DehydrateOptions.md) = `{}` + +## Returns + +[`DehydratedState`](../interfaces/DehydratedState.md) + +## Example + +```ts +const queryClient = new QueryClient() + +await queryClient.prefetchQuery({ + queryKey: ['posts'], + queryFn: getPosts, +}) + +const dehydratedState = dehydrate(queryClient) +``` diff --git a/docs/framework/preact/reference/functions/dehydrateQuery.md b/docs/framework/preact/reference/functions/dehydrateQuery.md new file mode 100644 index 00000000000..2827d2ebb45 --- /dev/null +++ b/docs/framework/preact/reference/functions/dehydrateQuery.md @@ -0,0 +1,43 @@ +--- +id: dehydrateQuery +title: dehydrateQuery +--- + +```ts +function dehydrateQuery( + query, + serializeData?, + shouldRedactErrors?): DehydratedQuery; +``` + +Defined in: [packages/query-core/src/hydration.ts:151](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L151) + +Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g. +`queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the +de/rehydrated data, typically with `useQuery` on the client. If the query is still `pending`, its in-flight +promise is dehydrated too so it can be resumed on the other side instead of re-fetched. + +## Parameters + +### query + +[`Query`](../classes/Query.md) + +The query to dehydrate. + +### serializeData? + +`TransformerFn` + +Optional transform applied to `query.state.data` before it is included in the snapshot. + +### shouldRedactErrors? + +(`error`) => `boolean` + +Optional predicate; if it returns `false` for the promise's rejection error, that +error is kept as-is instead of being redacted. + +## Returns + +`DehydratedQuery` diff --git a/docs/framework/preact/reference/functions/experimental_streamedQuery.md b/docs/framework/preact/reference/functions/experimental_streamedQuery.md new file mode 100644 index 00000000000..afd44df7c5f --- /dev/null +++ b/docs/framework/preact/reference/functions/experimental_streamedQuery.md @@ -0,0 +1,52 @@ +--- +id: experimental_streamedQuery +title: experimental_streamedQuery +--- + +```ts +function experimental_streamedQuery(queryFn): QueryFunction; +``` + +Defined in: [packages/query-core/src/streamedQuery.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L60) + +This is a helper function to create a query function that streams data from an AsyncIterable. +Data will be an Array of all the chunks received. +The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. +The query will stay in fetchStatus 'fetching' until the stream ends. + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TData + +`TData` = `TQueryFnData`[] + +### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +## Parameters + +### queryFn + +`StreamedQueryParams`\<`TQueryFnData`, `TData`, `TQueryKey`\> + +The function that returns an AsyncIterable to stream data from. + +## Returns + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TData`, `TQueryKey`\> + +## Example + +```ts +await queryClient.query({ + queryKey: ['data'], + queryFn: streamedQuery({ + streamFn: fetchDataInChunks, + }), +}) +``` diff --git a/docs/framework/preact/reference/functions/hashKey.md b/docs/framework/preact/reference/functions/hashKey.md new file mode 100644 index 00000000000..9e7844aa09d --- /dev/null +++ b/docs/framework/preact/reference/functions/hashKey.md @@ -0,0 +1,30 @@ +--- +id: hashKey +title: hashKey +--- + +```ts +function hashKey(queryKey): string; +``` + +Defined in: [packages/query-core/src/utils.ts:282](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L282) + +Default query & mutation keys hash function. +Hashes the value into a stable hash. + +## Parameters + +### queryKey + +readonly `unknown`[] + +## Returns + +`string` + +## Example + +```ts +// Object keys are sorted, so key order doesn't affect the hash: +hashKey(['todos', { page: 1, filter: 'done' }]) // === '["todos",{"filter":"done","page":1}]' +``` diff --git a/docs/framework/preact/reference/functions/hydrate.md b/docs/framework/preact/reference/functions/hydrate.md new file mode 100644 index 00000000000..dc55e38bf64 --- /dev/null +++ b/docs/framework/preact/reference/functions/hydrate.md @@ -0,0 +1,49 @@ +--- +id: hydrate +title: hydrate +--- + +```ts +function hydrate( + client, + dehydratedState, + options?): void; +``` + +Defined in: [packages/query-core/src/hydration.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L267) + +Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the +client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`. +Queries not yet in the cache are built from the dehydrated snapshot; queries that already exist are only updated +when the dehydrated data is newer than what's already cached. Newly built queries have their `fetchStatus` reset +to `'idle'` so they don't hydrate stuck in a fetching state. If a dehydrated query still had an in-flight +promise, it is resumed via `query.fetch()` (reusing that promise as `initialPromise`) rather than re-invoking +`queryFn`. + +## Parameters + +### client + +[`QueryClient`](../classes/QueryClient.md) + +### dehydratedState + +`Partial`\<[`DehydratedState`](../interfaces/DehydratedState.md)\> + +### options? + +[`HydrateOptions`](../interfaces/HydrateOptions.md) + +## Returns + +`void` + +## Example + +```ts +// dehydratedState was produced by `dehydrate` on the server +// and sent to the client, e.g. embedded in server-rendered markup. +const queryClient = new QueryClient() + +hydrate(queryClient, dehydratedState) +``` diff --git a/docs/framework/preact/reference/functions/infiniteQueryOptions.md b/docs/framework/preact/reference/functions/infiniteQueryOptions.md index af2d8e8fcc8..e1439dfbc3f 100644 --- a/docs/framework/preact/reference/functions/infiniteQueryOptions.md +++ b/docs/framework/preact/reference/functions/infiniteQueryOptions.md @@ -9,7 +9,7 @@ title: infiniteQueryOptions function infiniteQueryOptions(options): UseInfiniteQueryOptions & object & QueryKeyWithDataTag, TError>; ``` -Defined in: [preact-query/src/infiniteQueryOptions.ts:171](https://github.com/TanStack/query/blob/main/packages/preact-query/src/infiniteQueryOptions.ts#L171) +Defined in: [packages/preact-query/src/infiniteQueryOptions.ts:171](https://github.com/TanStack/query/blob/main/packages/preact-query/src/infiniteQueryOptions.ts#L171) You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`. @@ -29,7 +29,7 @@ This overload is selected when `initialData` is set. #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -95,7 +95,7 @@ function Projects() { function infiniteQueryOptions(options): OmitKeyof, "queryFn"> & object & QueryKeyWithDataTag, TError>; ``` -Defined in: [preact-query/src/infiniteQueryOptions.ts:233](https://github.com/TanStack/query/blob/main/packages/preact-query/src/infiniteQueryOptions.ts#L233) +Defined in: [packages/preact-query/src/infiniteQueryOptions.ts:233](https://github.com/TanStack/query/blob/main/packages/preact-query/src/infiniteQueryOptions.ts#L233) You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`. @@ -113,7 +113,7 @@ These options can be shared across hooks and imperative APIs such as `queryClien #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -178,7 +178,7 @@ function Comments({ postId }: { postId: string }) { function infiniteQueryOptions(options): UseInfiniteQueryOptions & object & QueryKeyWithDataTag, TError>; ``` -Defined in: [preact-query/src/infiniteQueryOptions.ts:295](https://github.com/TanStack/query/blob/main/packages/preact-query/src/infiniteQueryOptions.ts#L295) +Defined in: [packages/preact-query/src/infiniteQueryOptions.ts:295](https://github.com/TanStack/query/blob/main/packages/preact-query/src/infiniteQueryOptions.ts#L295) You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`. @@ -196,7 +196,7 @@ These options can be shared across hooks and imperative APIs such as `queryClien #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey diff --git a/docs/framework/preact/reference/functions/isCancelledError.md b/docs/framework/preact/reference/functions/isCancelledError.md new file mode 100644 index 00000000000..c8f57c4b94d --- /dev/null +++ b/docs/framework/preact/reference/functions/isCancelledError.md @@ -0,0 +1,24 @@ +--- +id: isCancelledError +title: isCancelledError +--- + +```ts +function isCancelledError(value): value is CancelledError; +``` + +Defined in: [packages/query-core/src/retryer.ts:90](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L90) + +## Parameters + +### value + +`any` + +## Returns + +`value is CancelledError` + +## Deprecated + +Use instanceof `CancelledError` instead. diff --git a/docs/framework/preact/reference/functions/keepPreviousData.md b/docs/framework/preact/reference/functions/keepPreviousData.md new file mode 100644 index 00000000000..d41c7d7c726 --- /dev/null +++ b/docs/framework/preact/reference/functions/keepPreviousData.md @@ -0,0 +1,40 @@ +--- +id: keepPreviousData +title: keepPreviousData +--- + +```ts +function keepPreviousData(previousData): T | undefined; +``` + +Defined in: [packages/query-core/src/utils.ts:491](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L491) + +Intended to be passed as a query's `placeholderData` option, for example +`placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new +query key is fetching, it keeps displaying the previously fetched data until the new data arrives. + +## Type Parameters + +### T + +`T` + +## Parameters + +### previousData + +`T` | `undefined` + +## Returns + +`T` \| `undefined` + +## Example + +```ts +new QueryObserver(queryClient, { + queryKey: ['posts', page], + queryFn: () => fetchPosts(page), + placeholderData: keepPreviousData, +}) +``` diff --git a/docs/framework/preact/reference/functions/matchMutation.md b/docs/framework/preact/reference/functions/matchMutation.md new file mode 100644 index 00000000000..79468dcfad9 --- /dev/null +++ b/docs/framework/preact/reference/functions/matchMutation.md @@ -0,0 +1,38 @@ +--- +id: matchMutation +title: matchMutation +--- + +```ts +function matchMutation(filters, mutation): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:235](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L235) + +Checks whether a mutation matches the given [MutationFilters](../interfaces/MutationFilters.md). +Every filter that is specified must match; filters that are left unspecified are ignored. +If a `mutationKey` filter is provided but the mutation has no `mutationKey` of its own, it does not match. + +## Parameters + +### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) + +### mutation + +[`Mutation`](../classes/Mutation.md)\<`any`, `any`\> + +## Returns + +`boolean` + +## Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const matchingMutations = mutationCache + .getAll() + .filter((mutation) => matchMutation({ mutationKey: ['addPost'] }, mutation)) +``` diff --git a/docs/framework/preact/reference/functions/matchQuery.md b/docs/framework/preact/reference/functions/matchQuery.md new file mode 100644 index 00000000000..f98fe5f3537 --- /dev/null +++ b/docs/framework/preact/reference/functions/matchQuery.md @@ -0,0 +1,37 @@ +--- +id: matchQuery +title: matchQuery +--- + +```ts +function matchQuery(filters, query): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L173) + +Checks whether a query matches the given [QueryFilters](../interfaces/QueryFilters.md). +Every filter that is specified must match; filters that are left unspecified are ignored. + +## Parameters + +### filters + +[`QueryFilters`](../interfaces/QueryFilters.md) + +### query + +[`Query`](../classes/Query.md)\<`any`, `any`, `any`, `any`\> + +## Returns + +`boolean` + +## Example + +```ts +const queryCache = queryClient.getQueryCache() + +const matchingQueries = queryCache + .getAll() + .filter((query) => matchQuery({ queryKey: ['posts'] }, query)) +``` diff --git a/docs/framework/preact/reference/functions/mutationOptions.md b/docs/framework/preact/reference/functions/mutationOptions.md index 47847cb0bed..ac38fd049c5 100644 --- a/docs/framework/preact/reference/functions/mutationOptions.md +++ b/docs/framework/preact/reference/functions/mutationOptions.md @@ -9,7 +9,7 @@ title: mutationOptions function mutationOptions(options): WithRequired, "mutationKey">; ``` -Defined in: [preact-query/src/mutationOptions.ts:34](https://github.com/TanStack/query/blob/main/packages/preact-query/src/mutationOptions.ts#L34) +Defined in: [packages/preact-query/src/mutationOptions.ts:34](https://github.com/TanStack/query/blob/main/packages/preact-query/src/mutationOptions.ts#L34) You can generally pass everything to `mutationOptions` that you can also pass to `useMutation`. A `mutationKey` is required on this overload so the mutation can be looked up later, e.g. with @@ -37,14 +37,14 @@ You can generally pass everything to `mutationOptions` that you can also pass to #### options -`WithRequired`\<[`UseMutationOptions`](../interfaces/UseMutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> +[`WithRequired`](../type-aliases/WithRequired.md)\<[`UseMutationOptions`](../interfaces/UseMutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> The mutation options to use, identical to what you'd pass to `useMutation`, with a required `mutationKey`. ### Returns -`WithRequired`\<[`UseMutationOptions`](../interfaces/UseMutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> +[`WithRequired`](../type-aliases/WithRequired.md)\<[`UseMutationOptions`](../interfaces/UseMutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> The same options object, unchanged. @@ -78,7 +78,7 @@ function SavingIndicator() { function mutationOptions(options): Omit, "mutationKey">; ``` -Defined in: [preact-query/src/mutationOptions.ts:74](https://github.com/TanStack/query/blob/main/packages/preact-query/src/mutationOptions.ts#L74) +Defined in: [packages/preact-query/src/mutationOptions.ts:74](https://github.com/TanStack/query/blob/main/packages/preact-query/src/mutationOptions.ts#L74) You can generally pass everything to `mutationOptions` that you can also pass to `useMutation`. No `mutationKey` is required on this overload — use this when you don't need to target the mutation via a diff --git a/docs/framework/preact/reference/functions/noop.md b/docs/framework/preact/reference/functions/noop.md new file mode 100644 index 00000000000..fd1b8dc2ad0 --- /dev/null +++ b/docs/framework/preact/reference/functions/noop.md @@ -0,0 +1,32 @@ +--- +id: noop +title: noop +--- + +## Call Signature + +```ts +function noop(): void; +``` + +Defined in: [packages/query-core/src/utils.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L117) + +A function that does nothing. + +### Returns + +`void` + +## Call Signature + +```ts +function noop(): undefined; +``` + +Defined in: [packages/query-core/src/utils.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L118) + +A function that does nothing. + +### Returns + +`undefined` diff --git a/docs/framework/preact/reference/functions/partialMatchKey.md b/docs/framework/preact/reference/functions/partialMatchKey.md new file mode 100644 index 00000000000..3795de85b95 --- /dev/null +++ b/docs/framework/preact/reference/functions/partialMatchKey.md @@ -0,0 +1,26 @@ +--- +id: partialMatchKey +title: partialMatchKey +--- + +```ts +function partialMatchKey(a, b): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L298) + +Checks if key `b` partially matches with key `a`. + +## Parameters + +### a + +readonly `unknown`[] + +### b + +readonly `unknown`[] + +## Returns + +`boolean` diff --git a/docs/framework/preact/reference/functions/queryOptions.md b/docs/framework/preact/reference/functions/queryOptions.md index ac200a49bfe..2d39a583ad2 100644 --- a/docs/framework/preact/reference/functions/queryOptions.md +++ b/docs/framework/preact/reference/functions/queryOptions.md @@ -9,7 +9,7 @@ title: queryOptions function queryOptions(options): Omit, "queryFn"> & object & QueryKeyWithDataTag; ``` -Defined in: [preact-query/src/queryOptions.ts:143](https://github.com/TanStack/query/blob/main/packages/preact-query/src/queryOptions.ts#L143) +Defined in: [packages/preact-query/src/queryOptions.ts:143](https://github.com/TanStack/query/blob/main/packages/preact-query/src/queryOptions.ts#L143) You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and @@ -85,7 +85,7 @@ function Posts() { function queryOptions(options): OmitKeyof, "queryFn"> & object & QueryKeyWithDataTag; ``` -Defined in: [preact-query/src/queryOptions.ts:184](https://github.com/TanStack/query/blob/main/packages/preact-query/src/queryOptions.ts#L184) +Defined in: [packages/preact-query/src/queryOptions.ts:184](https://github.com/TanStack/query/blob/main/packages/preact-query/src/queryOptions.ts#L184) You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and @@ -154,7 +154,7 @@ function Post({ id }: { id: string }) { function queryOptions(options): UseQueryOptions & object & QueryKeyWithDataTag; ``` -Defined in: [preact-query/src/queryOptions.ts:248](https://github.com/TanStack/query/blob/main/packages/preact-query/src/queryOptions.ts#L248) +Defined in: [packages/preact-query/src/queryOptions.ts:248](https://github.com/TanStack/query/blob/main/packages/preact-query/src/queryOptions.ts#L248) You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and diff --git a/docs/framework/preact/reference/functions/replaceEqualDeep.md b/docs/framework/preact/reference/functions/replaceEqualDeep.md new file mode 100644 index 00000000000..77a393196ef --- /dev/null +++ b/docs/framework/preact/reference/functions/replaceEqualDeep.md @@ -0,0 +1,41 @@ +--- +id: replaceEqualDeep +title: replaceEqualDeep +--- + +```ts +function replaceEqualDeep( + a, + b, + depth?): T; +``` + +Defined in: [packages/query-core/src/utils.ts:337](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L337) + +This function returns `a` if `b` is deeply equal. +If not, it will replace any deeply equal children of `b` with those of `a`. +This can be used for structural sharing between JSON values for example. + +## Type Parameters + +### T + +`T` + +## Parameters + +### a + +`unknown` + +### b + +`T` + +### depth? + +`number` + +## Returns + +`T` diff --git a/docs/framework/preact/reference/functions/shouldThrowError.md b/docs/framework/preact/reference/functions/shouldThrowError.md new file mode 100644 index 00000000000..3146617391e --- /dev/null +++ b/docs/framework/preact/reference/functions/shouldThrowError.md @@ -0,0 +1,45 @@ +--- +id: shouldThrowError +title: shouldThrowError +--- + +```ts +function shouldThrowError(throwOnError, params): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L574) + +Resolves a `throwOnError` option to a boolean. +If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller, +additional context such as the query or mutation) and its result is returned, allowing the throwing +behavior to be decided per error. Otherwise, `throwOnError` itself is coerced to a boolean (`undefined` +resolves to `false`). + +## Type Parameters + +### T + +`T` *extends* (...`args`) => `boolean` + +## Parameters + +### throwOnError + +`boolean` | `T` | `undefined` + +### params + +`Parameters`\<`T`\> + +## Returns + +`boolean` + +## Example + +```ts +const throwOnError = + query.state.error && typeof options.throwOnError === 'function' + ? shouldThrowError(options.throwOnError, [query.state.error, query]) + : options.throwOnError +``` diff --git a/docs/framework/preact/reference/functions/useInfiniteQuery.md b/docs/framework/preact/reference/functions/useInfiniteQuery.md index 34f7ae82def..ff94b7f66b3 100644 --- a/docs/framework/preact/reference/functions/useInfiniteQuery.md +++ b/docs/framework/preact/reference/functions/useInfiniteQuery.md @@ -9,7 +9,7 @@ title: useInfiniteQuery function useInfiniteQuery(options, queryClient?): DefinedUseInfiniteQueryResult; ``` -Defined in: [preact-query/src/useInfiniteQuery.ts:65](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useInfiniteQuery.ts#L65) +Defined in: [packages/preact-query/src/useInfiniteQuery.ts:65](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useInfiniteQuery.ts#L65) The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`. @@ -28,7 +28,7 @@ This overload is selected when `initialData` is set. #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -48,7 +48,7 @@ The [DefinedInitialDataInfiniteOptions](../type-aliases/DefinedInitialDataInfini #### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. @@ -105,7 +105,7 @@ function Projects() { function useInfiniteQuery(options, queryClient?): UseInfiniteQueryResult; ``` -Defined in: [preact-query/src/useInfiniteQuery.ts:191](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useInfiniteQuery.ts#L191) +Defined in: [packages/preact-query/src/useInfiniteQuery.ts:191](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useInfiniteQuery.ts#L191) The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`. @@ -122,7 +122,7 @@ The options for `useInfiniteQuery` are identical to `useQuery`, with the additio #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -142,7 +142,7 @@ The [UndefinedInitialDataInfiniteOptions](../type-aliases/UndefinedInitialDataIn #### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. @@ -265,7 +265,7 @@ function Projects() { function useInfiniteQuery(options, queryClient?): UseInfiniteQueryResult; ``` -Defined in: [preact-query/src/useInfiniteQuery.ts:347](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useInfiniteQuery.ts#L347) +Defined in: [packages/preact-query/src/useInfiniteQuery.ts:347](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useInfiniteQuery.ts#L347) The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`. @@ -282,7 +282,7 @@ The options for `useInfiniteQuery` are identical to `useQuery`, with the additio #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -302,7 +302,7 @@ The [UseInfiniteQueryOptions](../interfaces/UseInfiniteQueryOptions.md) to use #### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/preact/reference/functions/useIsFetching.md b/docs/framework/preact/reference/functions/useIsFetching.md index 2a85ba9866b..5e4f6078b14 100644 --- a/docs/framework/preact/reference/functions/useIsFetching.md +++ b/docs/framework/preact/reference/functions/useIsFetching.md @@ -7,7 +7,7 @@ title: useIsFetching function useIsFetching(filters?, queryClient?): number; ``` -Defined in: [preact-query/src/useIsFetching.ts:44](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useIsFetching.ts#L44) +Defined in: [packages/preact-query/src/useIsFetching.ts:44](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useIsFetching.ts#L44) The `useIsFetching` hook returns the `number` of the queries that your application is loading or fetching in the background (useful for app-wide loading indicators). @@ -16,13 +16,13 @@ the background (useful for app-wide loading indicators). ### filters? -`QueryFilters`\ +[`QueryFilters`](../interfaces/QueryFilters.md)\ -The QueryFilters to narrow down the matched queries. +The [QueryFilters](../interfaces/QueryFilters.md) to narrow down the matched queries. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/preact/reference/functions/useIsMutating.md b/docs/framework/preact/reference/functions/useIsMutating.md index 3c3cce2caaa..78150aa4390 100644 --- a/docs/framework/preact/reference/functions/useIsMutating.md +++ b/docs/framework/preact/reference/functions/useIsMutating.md @@ -7,7 +7,7 @@ title: useIsMutating function useIsMutating(filters?, queryClient?): number; ``` -Defined in: [preact-query/src/useMutationState.ts:35](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useMutationState.ts#L35) +Defined in: [packages/preact-query/src/useMutationState.ts:35](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useMutationState.ts#L35) The `useIsMutating` hook returns the `number` of mutations that your application currently has `pending` (useful for app-wide loading indicators). @@ -16,13 +16,13 @@ The `useIsMutating` hook returns the `number` of mutations that your application ### filters? -`MutationFilters`\<`unknown`, `Error`, `unknown`, `unknown`\> +[`MutationFilters`](../interfaces/MutationFilters.md)\<`unknown`, `Error`, `unknown`, `unknown`\> -The MutationFilters to narrow down the matched mutations. +The [MutationFilters](../interfaces/MutationFilters.md) to narrow down the matched mutations. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/preact/reference/functions/useIsRestoring.md b/docs/framework/preact/reference/functions/useIsRestoring.md index e81909e2221..17d26e9ad8c 100644 --- a/docs/framework/preact/reference/functions/useIsRestoring.md +++ b/docs/framework/preact/reference/functions/useIsRestoring.md @@ -7,7 +7,7 @@ title: useIsRestoring function useIsRestoring(): boolean; ``` -Defined in: [preact-query/src/IsRestoringProvider.ts:13](https://github.com/TanStack/query/blob/main/packages/preact-query/src/IsRestoringProvider.ts#L13) +Defined in: [packages/preact-query/src/IsRestoringProvider.ts:13](https://github.com/TanStack/query/blob/main/packages/preact-query/src/IsRestoringProvider.ts#L13) If you are using `PersistQueryClientProvider`, you can also use the `useIsRestoring` hook alongside it to check if a restore is currently in progress. `useQuery` and friends also check this internally to avoid diff --git a/docs/framework/preact/reference/functions/useMutation.md b/docs/framework/preact/reference/functions/useMutation.md index 354feabe433..5e7af270612 100644 --- a/docs/framework/preact/reference/functions/useMutation.md +++ b/docs/framework/preact/reference/functions/useMutation.md @@ -7,7 +7,7 @@ title: useMutation function useMutation(options, queryClient?): UseMutationResult; ``` -Defined in: [preact-query/src/useMutation.ts:192](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useMutation.ts#L192) +Defined in: [packages/preact-query/src/useMutation.ts:192](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useMutation.ts#L192) Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects. `useMutation` is the hook for that. @@ -40,7 +40,7 @@ The [UseMutationOptions](../interfaces/UseMutationOptions.md) to use — everyth ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/preact/reference/functions/useMutationState.md b/docs/framework/preact/reference/functions/useMutationState.md index 8e27be52f67..61bf6aa635f 100644 --- a/docs/framework/preact/reference/functions/useMutationState.md +++ b/docs/framework/preact/reference/functions/useMutationState.md @@ -7,21 +7,21 @@ title: useMutationState function useMutationState(options, queryClient?): TResult[]; ``` -Defined in: [preact-query/src/useMutationState.ts:157](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useMutationState.ts#L157) +Defined in: [packages/preact-query/src/useMutationState.ts:157](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useMutationState.ts#L157) `useMutationState` is a hook that gives you access to all mutations in the `MutationCache`. You can pass -`filters` (MutationFilters) to narrow down your mutations, and `select` to transform the mutation +`filters` ([MutationFilters](../interfaces/MutationFilters.md)) to narrow down your mutations, and `select` to transform the mutation state. ## Type Parameters ### TResult -`TResult` = `MutationState`\<`unknown`, `Error`, `unknown`, `unknown`\> +`TResult` = [`MutationState`](../interfaces/MutationState.md)\<`unknown`, `Error`, `unknown`, `unknown`\> ### TMutation -`TMutation` *extends* `Mutation`\<`any`, `any`, `any`, `any`\> = `MutationTypeFromResult`\<`TResult`\> +`TMutation` *extends* [`Mutation`](../classes/Mutation.md)\<`any`, `any`, `any`, `any`\> = `MutationTypeFromResult`\<`TResult`\> ## Parameters @@ -34,7 +34,7 @@ mutation state. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/preact/reference/functions/usePrefetchInfiniteQuery.md b/docs/framework/preact/reference/functions/usePrefetchInfiniteQuery.md index b3995ea24db..3da9d34ad1f 100644 --- a/docs/framework/preact/reference/functions/usePrefetchInfiniteQuery.md +++ b/docs/framework/preact/reference/functions/usePrefetchInfiniteQuery.md @@ -7,7 +7,7 @@ title: usePrefetchInfiniteQuery function usePrefetchInfiniteQuery(options, queryClient?): void; ``` -Defined in: [preact-query/src/usePrefetchInfiniteQuery.tsx:51](https://github.com/TanStack/query/blob/main/packages/preact-query/src/usePrefetchInfiniteQuery.tsx#L51) +Defined in: [packages/preact-query/src/usePrefetchInfiniteQuery.tsx:51](https://github.com/TanStack/query/blob/main/packages/preact-query/src/usePrefetchInfiniteQuery.tsx#L51) `usePrefetchInfiniteQuery` does not return anything, it should be used just to fire a prefetch during render, before a suspense boundary that wraps a component that uses `useSuspenseInfiniteQuery`. You can pass @@ -55,7 +55,7 @@ The [UsePrefetchInfiniteQueryOptions](../type-aliases/UsePrefetchInfiniteQueryOp ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/preact/reference/functions/usePrefetchQuery.md b/docs/framework/preact/reference/functions/usePrefetchQuery.md index 872a6f57ec4..3fbd25b4d6a 100644 --- a/docs/framework/preact/reference/functions/usePrefetchQuery.md +++ b/docs/framework/preact/reference/functions/usePrefetchQuery.md @@ -7,7 +7,7 @@ title: usePrefetchQuery function usePrefetchQuery(options, queryClient?): void; ``` -Defined in: [preact-query/src/usePrefetchQuery.tsx:42](https://github.com/TanStack/query/blob/main/packages/preact-query/src/usePrefetchQuery.tsx#L42) +Defined in: [packages/preact-query/src/usePrefetchQuery.tsx:42](https://github.com/TanStack/query/blob/main/packages/preact-query/src/usePrefetchQuery.tsx#L42) `usePrefetchQuery` does not return anything, it should be used just to fire a prefetch during render, before a suspense boundary that wraps a component that uses `useSuspenseQuery`. You can pass everything to @@ -50,7 +50,7 @@ The [UsePrefetchQueryOptions](../type-aliases/UsePrefetchQueryOptions.md) to use ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/preact/reference/functions/useQueries.md b/docs/framework/preact/reference/functions/useQueries.md index b5d9317ee70..6688d8d5614 100644 --- a/docs/framework/preact/reference/functions/useQueries.md +++ b/docs/framework/preact/reference/functions/useQueries.md @@ -7,7 +7,7 @@ title: useQueries function useQueries(__namedParameters, queryClient?): TCombinedResult; ``` -Defined in: [preact-query/src/useQueries.ts:302](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useQueries.ts#L302) +Defined in: [packages/preact-query/src/useQueries.ts:302](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useQueries.ts#L302) The `useQueries` hook can be used to fetch a variable number of queries. @@ -50,7 +50,7 @@ shared to be as referentially stable as possible. An array with query option objects, mostly identical to `useQuery` — except that `queryClient` and `subscribed` aren't accepted per-query (`subscribed` is a top-level option here instead), and -`placeholderData` accepts a QueriesPlaceholderDataFunction, which is called with `previousData` +`placeholderData` accepts a [QueriesPlaceholderDataFunction](../type-aliases/QueriesPlaceholderDataFunction.md), which is called with `previousData` and `previousQuery` always `undefined`, rather than `useQuery`'s placeholder function. #### subscribed? @@ -67,7 +67,7 @@ true ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to provide a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/preact/reference/functions/useQuery.md b/docs/framework/preact/reference/functions/useQuery.md index 55242ebc4cb..3c38353336f 100644 --- a/docs/framework/preact/reference/functions/useQuery.md +++ b/docs/framework/preact/reference/functions/useQuery.md @@ -9,7 +9,7 @@ title: useQuery function useQuery(options, queryClient?): DefinedUseQueryResult; ``` -Defined in: [preact-query/src/useQuery.ts:50](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useQuery.ts#L50) +Defined in: [packages/preact-query/src/useQuery.ts:50](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useQuery.ts#L50) This overload is selected when `initialData` is set, so the resulting `data` is never `undefined`. @@ -41,7 +41,7 @@ The [DefinedInitialDataOptions](../type-aliases/DefinedInitialDataOptions.md) to #### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. @@ -89,7 +89,7 @@ function Posts() { function useQuery(options, queryClient?): UseQueryResult; ``` -Defined in: [preact-query/src/useQuery.ts:117](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useQuery.ts#L117) +Defined in: [packages/preact-query/src/useQuery.ts:117](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useQuery.ts#L117) ### Type Parameters @@ -119,7 +119,7 @@ The [UndefinedInitialDataOptions](../type-aliases/UndefinedInitialDataOptions.md #### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. @@ -190,7 +190,7 @@ function Posts() { function useQuery(options, queryClient?): UseQueryResult; ``` -Defined in: [preact-query/src/useQuery.ts:281](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useQuery.ts#L281) +Defined in: [packages/preact-query/src/useQuery.ts:281](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useQuery.ts#L281) ### Type Parameters @@ -220,7 +220,7 @@ The [UseQueryOptions](../interfaces/UseQueryOptions.md) to use — everything yo #### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/preact/reference/functions/useQueryClient.md b/docs/framework/preact/reference/functions/useQueryClient.md index 0e075039e25..bc98c2f9d13 100644 --- a/docs/framework/preact/reference/functions/useQueryClient.md +++ b/docs/framework/preact/reference/functions/useQueryClient.md @@ -7,7 +7,7 @@ title: useQueryClient function useQueryClient(queryClient?): QueryClient; ``` -Defined in: [preact-query/src/QueryClientProvider.tsx:21](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryClientProvider.tsx#L21) +Defined in: [packages/preact-query/src/QueryClientProvider.tsx:21](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryClientProvider.tsx#L21) The `useQueryClient` hook returns the current `QueryClient` instance. @@ -15,14 +15,14 @@ The `useQueryClient` hook returns the current `QueryClient` instance. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. ## Returns -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) The current `QueryClient` instance. diff --git a/docs/framework/preact/reference/functions/useQueryErrorResetBoundary.md b/docs/framework/preact/reference/functions/useQueryErrorResetBoundary.md index 15ec961a2b7..bf96a7d86f0 100644 --- a/docs/framework/preact/reference/functions/useQueryErrorResetBoundary.md +++ b/docs/framework/preact/reference/functions/useQueryErrorResetBoundary.md @@ -7,7 +7,7 @@ title: useQueryErrorResetBoundary function useQueryErrorResetBoundary(): QueryErrorResetBoundaryValue; ``` -Defined in: [preact-query/src/QueryErrorResetBoundary.tsx:85](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryErrorResetBoundary.tsx#L85) +Defined in: [packages/preact-query/src/QueryErrorResetBoundary.tsx:85](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryErrorResetBoundary.tsx#L85) This hook will reset any query errors within the closest `QueryErrorResetBoundary`. If there is no boundary defined it will reset them globally. diff --git a/docs/framework/preact/reference/functions/useSuspenseInfiniteQuery.md b/docs/framework/preact/reference/functions/useSuspenseInfiniteQuery.md index 2cde233cc01..2e198fe020b 100644 --- a/docs/framework/preact/reference/functions/useSuspenseInfiniteQuery.md +++ b/docs/framework/preact/reference/functions/useSuspenseInfiniteQuery.md @@ -7,7 +7,7 @@ title: useSuspenseInfiniteQuery function useSuspenseInfiniteQuery(options, queryClient?): UseSuspenseInfiniteQueryResult; ``` -Defined in: [preact-query/src/useSuspenseInfiniteQuery.ts:124](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useSuspenseInfiniteQuery.ts#L124) +Defined in: [packages/preact-query/src/useSuspenseInfiniteQuery.ts:124](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useSuspenseInfiniteQuery.ts#L124) The options for `useSuspenseInfiniteQuery` are the same as for `useInfiniteQuery`, except for `throwOnError`, `enabled`, and `placeholderData`. @@ -26,7 +26,7 @@ Caveat: cancellation does not work. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> ### TQueryKey @@ -46,7 +46,7 @@ The [UseSuspenseInfiniteQueryOptions](../interfaces/UseSuspenseInfiniteQueryOpti ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/preact/reference/functions/useSuspenseQueries.md b/docs/framework/preact/reference/functions/useSuspenseQueries.md index 5eff3f39eb5..d9a4ce39046 100644 --- a/docs/framework/preact/reference/functions/useSuspenseQueries.md +++ b/docs/framework/preact/reference/functions/useSuspenseQueries.md @@ -9,7 +9,7 @@ title: useSuspenseQueries function useSuspenseQueries(options, queryClient?): TCombinedResult; ``` -Defined in: [preact-query/src/useSuspenseQueries.ts:409](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useSuspenseQueries.ts#L409) +Defined in: [packages/preact-query/src/useSuspenseQueries.ts:409](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useSuspenseQueries.ts#L409) The options for `useSuspenseQueries` are the same as for `useQueries`, except that the top-level `subscribed` option isn't supported, and each `query` can't have `throwOnError`, `enabled`, or `placeholderData`. @@ -46,7 +46,7 @@ An array with query option objects identical to `useSuspenseQuery`. #### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to provide a custom `QueryClient`. Otherwise, the one from the nearest context will be used. @@ -279,7 +279,7 @@ function ErrorBoundary({ function useSuspenseQueries(options, queryClient?): TCombinedResult; ``` -Defined in: [preact-query/src/useSuspenseQueries.ts:589](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useSuspenseQueries.ts#L589) +Defined in: [packages/preact-query/src/useSuspenseQueries.ts:589](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useSuspenseQueries.ts#L589) The options for `useSuspenseQueries` are the same as for `useQueries`, except that the top-level `subscribed` option isn't supported, and each `query` can't have `throwOnError`, `enabled`, or `placeholderData`. @@ -315,7 +315,7 @@ An array with query option objects identical to `useSuspenseQuery`. #### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to provide a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/preact/reference/functions/useSuspenseQuery.md b/docs/framework/preact/reference/functions/useSuspenseQuery.md index 29f892a1656..2cb0ebb317c 100644 --- a/docs/framework/preact/reference/functions/useSuspenseQuery.md +++ b/docs/framework/preact/reference/functions/useSuspenseQuery.md @@ -7,7 +7,7 @@ title: useSuspenseQuery function useSuspenseQuery(options, queryClient?): UseSuspenseQueryResult; ``` -Defined in: [preact-query/src/useSuspenseQuery.ts:95](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useSuspenseQuery.ts#L95) +Defined in: [packages/preact-query/src/useSuspenseQuery.ts:95](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useSuspenseQuery.ts#L95) The options for `useSuspenseQuery` are the same as for `useQuery`, except for `throwOnError`, `enabled`, and `placeholderData`. @@ -42,7 +42,7 @@ The [UseSuspenseQueryOptions](../interfaces/UseSuspenseQueryOptions.md) to use ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/preact/reference/index.md b/docs/framework/preact/reference/index.md index 4a8bb8f6a28..14a2820a2d3 100644 --- a/docs/framework/preact/reference/index.md +++ b/docs/framework/preact/reference/index.md @@ -3,10 +3,78 @@ id: "@tanstack/preact-query" title: "@tanstack/preact-query" --- +## Classes + +- [CancelledError](classes/CancelledError.md) +- [InfiniteQueryObserver](classes/InfiniteQueryObserver.md) +- [Mutation](classes/Mutation.md) +- [MutationCache](classes/MutationCache.md) +- [MutationObserver](classes/MutationObserver.md) +- [QueriesObserver](classes/QueriesObserver.md) +- [Query](classes/Query.md) +- [QueryCache](classes/QueryCache.md) +- [QueryClient](classes/QueryClient.md) +- [QueryObserver](classes/QueryObserver.md) + ## Interfaces +- [CancelOptions](interfaces/CancelOptions.md) +- [DefaultOptions](interfaces/DefaultOptions.md) +- [DehydratedState](interfaces/DehydratedState.md) +- [DehydrateOptions](interfaces/DehydrateOptions.md) +- [~~EnsureQueryDataOptions~~](interfaces/EnsureQueryDataOptions.md) +- [FetchNextPageOptions](interfaces/FetchNextPageOptions.md) +- [FetchPreviousPageOptions](interfaces/FetchPreviousPageOptions.md) +- [~~FetchQueryOptions~~](interfaces/FetchQueryOptions.md) +- [HydrateOptions](interfaces/HydrateOptions.md) - [HydrationBoundaryProps](interfaces/HydrationBoundaryProps.md) +- [InfiniteData](interfaces/InfiniteData.md) +- [InfiniteQueryObserverBaseResult](interfaces/InfiniteQueryObserverBaseResult.md) +- [InfiniteQueryObserverLoadingErrorResult](interfaces/InfiniteQueryObserverLoadingErrorResult.md) +- [InfiniteQueryObserverLoadingResult](interfaces/InfiniteQueryObserverLoadingResult.md) +- [InfiniteQueryObserverOptions](interfaces/InfiniteQueryObserverOptions.md) +- [InfiniteQueryObserverPendingResult](interfaces/InfiniteQueryObserverPendingResult.md) +- [InfiniteQueryObserverPlaceholderResult](interfaces/InfiniteQueryObserverPlaceholderResult.md) +- [InfiniteQueryObserverRefetchErrorResult](interfaces/InfiniteQueryObserverRefetchErrorResult.md) +- [InfiniteQueryObserverSuccessResult](interfaces/InfiniteQueryObserverSuccessResult.md) +- [InfiniteQueryPageParamsOptions](interfaces/InfiniteQueryPageParamsOptions.md) +- [InitialPageParam](interfaces/InitialPageParam.md) +- [InvalidateOptions](interfaces/InvalidateOptions.md) +- [InvalidateQueryFilters](interfaces/InvalidateQueryFilters.md) +- [MutateOptions](interfaces/MutateOptions.md) +- [MutationCacheConfig](interfaces/MutationCacheConfig.md) +- [MutationFilters](interfaces/MutationFilters.md) +- [MutationObserverBaseResult](interfaces/MutationObserverBaseResult.md) +- [MutationObserverErrorResult](interfaces/MutationObserverErrorResult.md) +- [MutationObserverIdleResult](interfaces/MutationObserverIdleResult.md) +- [MutationObserverLoadingResult](interfaces/MutationObserverLoadingResult.md) +- [MutationObserverOptions](interfaces/MutationObserverOptions.md) +- [MutationObserverSuccessResult](interfaces/MutationObserverSuccessResult.md) +- [MutationOptions](interfaces/MutationOptions.md) +- [MutationState](interfaces/MutationState.md) +- [NotifyEvent](interfaces/NotifyEvent.md) +- [QueriesObserverOptions](interfaces/QueriesObserverOptions.md) +- [QueryCacheConfig](interfaces/QueryCacheConfig.md) +- [QueryClientConfig](interfaces/QueryClientConfig.md) - [QueryErrorResetBoundaryProps](interfaces/QueryErrorResetBoundaryProps.md) +- [QueryExecuteOptions](interfaces/QueryExecuteOptions.md) +- [QueryFilters](interfaces/QueryFilters.md) +- [QueryObserverBaseResult](interfaces/QueryObserverBaseResult.md) +- [QueryObserverLoadingErrorResult](interfaces/QueryObserverLoadingErrorResult.md) +- [QueryObserverLoadingResult](interfaces/QueryObserverLoadingResult.md) +- [QueryObserverOptions](interfaces/QueryObserverOptions.md) +- [QueryObserverPendingResult](interfaces/QueryObserverPendingResult.md) +- [QueryObserverPlaceholderResult](interfaces/QueryObserverPlaceholderResult.md) +- [QueryObserverRefetchErrorResult](interfaces/QueryObserverRefetchErrorResult.md) +- [QueryObserverSuccessResult](interfaces/QueryObserverSuccessResult.md) +- [QueryOptions](interfaces/QueryOptions.md) +- [QueryState](interfaces/QueryState.md) +- [RefetchOptions](interfaces/RefetchOptions.md) +- [RefetchQueryFilters](interfaces/RefetchQueryFilters.md) +- [Register](interfaces/Register.md) +- [ResetOptions](interfaces/ResetOptions.md) +- [ResultOptions](interfaces/ResultOptions.md) +- [SetDataOptions](interfaces/SetDataOptions.md) - [UseBaseQueryOptions](interfaces/UseBaseQueryOptions.md) - [UseInfiniteQueryOptions](interfaces/UseInfiniteQueryOptions.md) - [UseMutationOptions](interfaces/UseMutationOptions.md) @@ -16,29 +84,87 @@ title: "@tanstack/preact-query" ## Type Aliases +- [AnyDataTag](type-aliases/AnyDataTag.md) - [AnyUseBaseQueryOptions](type-aliases/AnyUseBaseQueryOptions.md) - [AnyUseInfiniteQueryOptions](type-aliases/AnyUseInfiniteQueryOptions.md) - [AnyUseMutationOptions](type-aliases/AnyUseMutationOptions.md) - [AnyUseQueryOptions](type-aliases/AnyUseQueryOptions.md) - [AnyUseSuspenseInfiniteQueryOptions](type-aliases/AnyUseSuspenseInfiniteQueryOptions.md) - [AnyUseSuspenseQueryOptions](type-aliases/AnyUseSuspenseQueryOptions.md) +- [DataTag](type-aliases/DataTag.md) +- [dataTagErrorSymbol](type-aliases/dataTagErrorSymbol.md) +- [dataTagSymbol](type-aliases/dataTagSymbol.md) +- [DefaultedInfiniteQueryObserverOptions](type-aliases/DefaultedInfiniteQueryObserverOptions.md) +- [DefaultedQueryObserverOptions](type-aliases/DefaultedQueryObserverOptions.md) +- [DefaultError](type-aliases/DefaultError.md) +- [DefinedInfiniteQueryObserverResult](type-aliases/DefinedInfiniteQueryObserverResult.md) - [DefinedInitialDataInfiniteOptions](type-aliases/DefinedInitialDataInfiniteOptions.md) - [DefinedInitialDataOptions](type-aliases/DefinedInitialDataOptions.md) +- [DefinedQueryObserverResult](type-aliases/DefinedQueryObserverResult.md) - [DefinedUseInfiniteQueryResult](type-aliases/DefinedUseInfiniteQueryResult.md) - [DefinedUseQueryResult](type-aliases/DefinedUseQueryResult.md) +- [DistributiveOmit](type-aliases/DistributiveOmit.md) +- [~~EnsureInfiniteQueryDataOptions~~](type-aliases/EnsureInfiniteQueryDataOptions.md) +- [~~FetchInfiniteQueryOptions~~](type-aliases/FetchInfiniteQueryOptions.md) +- [FetchStatus](type-aliases/FetchStatus.md) +- [GetNextPageParamFunction](type-aliases/GetNextPageParamFunction.md) +- [GetPreviousPageParamFunction](type-aliases/GetPreviousPageParamFunction.md) +- [InferDataFromTag](type-aliases/InferDataFromTag.md) +- [InferErrorFromTag](type-aliases/InferErrorFromTag.md) +- [InfiniteQueryExecuteOptions](type-aliases/InfiniteQueryExecuteOptions.md) +- [InfiniteQueryObserverResult](type-aliases/InfiniteQueryObserverResult.md) +- [InitialDataFunction](type-aliases/InitialDataFunction.md) +- [ManagedTimerId](type-aliases/ManagedTimerId.md) +- [MutateFunction](type-aliases/MutateFunction.md) +- [MutateFunctionRest](type-aliases/MutateFunctionRest.md) +- [MutationCacheNotifyEvent](type-aliases/MutationCacheNotifyEvent.md) +- [MutationFunction](type-aliases/MutationFunction.md) +- [MutationFunctionContext](type-aliases/MutationFunctionContext.md) +- [MutationKey](type-aliases/MutationKey.md) +- [MutationMeta](type-aliases/MutationMeta.md) +- [MutationObserverResult](type-aliases/MutationObserverResult.md) +- [MutationScope](type-aliases/MutationScope.md) +- [MutationStatus](type-aliases/MutationStatus.md) +- [NetworkMode](type-aliases/NetworkMode.md) +- [NonUndefinedGuard](type-aliases/NonUndefinedGuard.md) +- [NotifyEventType](type-aliases/NotifyEventType.md) +- [NotifyOnChangeProps](type-aliases/NotifyOnChangeProps.md) +- [OmitKeyof](type-aliases/OmitKeyof.md) +- [Override](type-aliases/Override.md) +- [PlaceholderDataFunction](type-aliases/PlaceholderDataFunction.md) - [QueriesOptions](type-aliases/QueriesOptions.md) +- [QueriesPlaceholderDataFunction](type-aliases/QueriesPlaceholderDataFunction.md) - [QueriesResults](type-aliases/QueriesResults.md) +- [QueryBooleanOption](type-aliases/QueryBooleanOption.md) +- [QueryCacheNotifyEvent](type-aliases/QueryCacheNotifyEvent.md) - [QueryClientProviderProps](type-aliases/QueryClientProviderProps.md) - [QueryErrorClearResetFunction](type-aliases/QueryErrorClearResetFunction.md) - [QueryErrorIsResetFunction](type-aliases/QueryErrorIsResetFunction.md) - [QueryErrorResetBoundaryFunction](type-aliases/QueryErrorResetBoundaryFunction.md) - [QueryErrorResetFunction](type-aliases/QueryErrorResetFunction.md) +- [QueryFunction](type-aliases/QueryFunction.md) +- [QueryFunctionContext](type-aliases/QueryFunctionContext.md) +- [QueryKey](type-aliases/QueryKey.md) +- [QueryKeyHashFunction](type-aliases/QueryKeyHashFunction.md) +- [QueryKeyWithDataTag](type-aliases/QueryKeyWithDataTag.md) +- [QueryMeta](type-aliases/QueryMeta.md) +- [QueryObserverResult](type-aliases/QueryObserverResult.md) +- [QueryPersister](type-aliases/QueryPersister.md) +- [QueryStatus](type-aliases/QueryStatus.md) +- [SkipToken](type-aliases/SkipToken.md) +- [StaleTime](type-aliases/StaleTime.md) +- [StaleTimeFunction](type-aliases/StaleTimeFunction.md) - [SuspenseQueriesOptions](type-aliases/SuspenseQueriesOptions.md) - [SuspenseQueriesResults](type-aliases/SuspenseQueriesResults.md) +- [ThrowOnError](type-aliases/ThrowOnError.md) +- [TimeoutCallback](type-aliases/TimeoutCallback.md) +- [TimeoutProvider](type-aliases/TimeoutProvider.md) - [UndefinedInitialDataInfiniteOptions](type-aliases/UndefinedInitialDataInfiniteOptions.md) - [UndefinedInitialDataOptions](type-aliases/UndefinedInitialDataOptions.md) +- [UnsetMarker](type-aliases/UnsetMarker.md) - [UnusedSkipTokenInfiniteOptions](type-aliases/UnusedSkipTokenInfiniteOptions.md) - [UnusedSkipTokenOptions](type-aliases/UnusedSkipTokenOptions.md) +- [Updater](type-aliases/Updater.md) - [UseBaseMutationResult](type-aliases/UseBaseMutationResult.md) - [UseBaseQueryResult](type-aliases/UseBaseQueryResult.md) - [UseInfiniteQueryResult](type-aliases/UseInfiniteQueryResult.md) @@ -50,20 +176,47 @@ title: "@tanstack/preact-query" - [UseQueryResult](type-aliases/UseQueryResult.md) - [UseSuspenseInfiniteQueryResult](type-aliases/UseSuspenseInfiniteQueryResult.md) - [UseSuspenseQueryResult](type-aliases/UseSuspenseQueryResult.md) +- [WithRequired](type-aliases/WithRequired.md) ## Variables +- [dataTagErrorSymbol](variables/dataTagErrorSymbol.md) +- [dataTagSymbol](variables/dataTagSymbol.md) +- [defaultScheduler](variables/defaultScheduler.md) +- [environmentManager](variables/environmentManager.md) +- [focusManager](variables/focusManager.md) - [IsRestoringProvider](variables/IsRestoringProvider.md) +- [~~isServer~~](variables/isServer.md) +- [notifyManager](variables/notifyManager.md) +- [onlineManager](variables/onlineManager.md) - [QueryClientContext](variables/QueryClientContext.md) +- [skipToken](variables/skipToken.md) +- [timeoutManager](variables/timeoutManager.md) +- [unsetMarker](variables/unsetMarker.md) ## Functions +- [defaultShouldDehydrateMutation](functions/defaultShouldDehydrateMutation.md) +- [defaultShouldDehydrateQuery](functions/defaultShouldDehydrateQuery.md) +- [dehydrate](functions/dehydrate.md) +- [dehydrateQuery](functions/dehydrateQuery.md) +- [experimental\_streamedQuery](functions/experimental_streamedQuery.md) +- [hashKey](functions/hashKey.md) +- [hydrate](functions/hydrate.md) - [HydrationBoundary](functions/HydrationBoundary.md) - [infiniteQueryOptions](functions/infiniteQueryOptions.md) +- [~~isCancelledError~~](functions/isCancelledError.md) +- [keepPreviousData](functions/keepPreviousData.md) +- [matchMutation](functions/matchMutation.md) +- [matchQuery](functions/matchQuery.md) - [mutationOptions](functions/mutationOptions.md) +- [noop](functions/noop.md) +- [partialMatchKey](functions/partialMatchKey.md) - [QueryClientProvider](functions/QueryClientProvider.md) - [QueryErrorResetBoundary](functions/QueryErrorResetBoundary.md) - [queryOptions](functions/queryOptions.md) +- [replaceEqualDeep](functions/replaceEqualDeep.md) +- [shouldThrowError](functions/shouldThrowError.md) - [useInfiniteQuery](functions/useInfiniteQuery.md) - [useIsFetching](functions/useIsFetching.md) - [useIsMutating](functions/useIsMutating.md) diff --git a/docs/framework/preact/reference/interfaces/CancelOptions.md b/docs/framework/preact/reference/interfaces/CancelOptions.md new file mode 100644 index 00000000000..2b9293712d2 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/CancelOptions.md @@ -0,0 +1,26 @@ +--- +id: CancelOptions +title: CancelOptions +--- + +Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) + +## Properties + +### revert? + +```ts +optional revert: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1444) + +*** + +### silent? + +```ts +optional silent: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1445](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1445) diff --git a/docs/framework/preact/reference/interfaces/DefaultOptions.md b/docs/framework/preact/reference/interfaces/DefaultOptions.md new file mode 100644 index 00000000000..149ef5b3444 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/DefaultOptions.md @@ -0,0 +1,76 @@ +--- +id: DefaultOptions +title: DefaultOptions +--- + +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) + +## Type Parameters + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### dehydrate? + +```ts +optional dehydrate: DehydrateOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) + +*** + +### hydrate? + +```ts +optional hydrate: object; +``` + +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) + +#### deserializeData? + +```ts +optional deserializeData: TransformerFn; +``` + +Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. + +#### mutations? + +```ts +optional mutations: MutationOptions; +``` + +Default options merged into every mutation restored from the dehydrated state. + +#### queries? + +```ts +optional queries: QueryOptions; +``` + +Default options merged into every query restored from the dehydrated state. + +*** + +### mutations? + +```ts +optional mutations: MutationObserverOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) + +*** + +### queries? + +```ts +optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; +``` + +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) diff --git a/docs/framework/preact/reference/interfaces/DehydrateOptions.md b/docs/framework/preact/reference/interfaces/DehydrateOptions.md new file mode 100644 index 00000000000..e862ae88b43 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/DehydrateOptions.md @@ -0,0 +1,89 @@ +--- +id: DehydrateOptions +title: DehydrateOptions +--- + +Defined in: [packages/query-core/src/hydration.ts:42](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L42) + +Options for `dehydrate`, controlling which queries/mutations are included in the resulting `DehydratedState` and +how their data/errors are transformed before being serialized (e.g. for embedding in server-rendered markup). + +## Properties + +### serializeData? + +```ts +optional serializeData: TransformerFn; +``` + +Defined in: [packages/query-core/src/hydration.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L44) + +Transforms a query's `data` before it is dehydrated. Useful for non-JSON-serializable data. + +*** + +### shouldDehydrateMutation()? + +```ts +optional shouldDehydrateMutation: (mutation) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:46](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L46) + +Predicate to decide whether a given `Mutation` should be dehydrated. Defaults to `defaultShouldDehydrateMutation`. + +#### Parameters + +##### mutation + +[`Mutation`](../classes/Mutation.md) + +#### Returns + +`boolean` + +*** + +### shouldDehydrateQuery()? + +```ts +optional shouldDehydrateQuery: (query) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:48](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L48) + +Predicate to decide whether a given `Query` should be dehydrated. Defaults to `defaultShouldDehydrateQuery`. + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +*** + +### shouldRedactErrors()? + +```ts +optional shouldRedactErrors: (error) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L54) + +Predicate to decide whether a query's error should be redacted before dehydration. Errors are redacted +(replaced with a generic `Error('redacted')`) unless this function is provided and returns `false` for the +given error, in which case the original error is kept. + +#### Parameters + +##### error + +`unknown` + +#### Returns + +`boolean` diff --git a/docs/framework/preact/reference/interfaces/DehydratedState.md b/docs/framework/preact/reference/interfaces/DehydratedState.md new file mode 100644 index 00000000000..7edce60a00d --- /dev/null +++ b/docs/framework/preact/reference/interfaces/DehydratedState.md @@ -0,0 +1,30 @@ +--- +id: DehydratedState +title: DehydratedState +--- + +Defined in: [packages/query-core/src/hydration.ts:97](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L97) + +A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically +transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data +that has already been fetched, avoiding a redundant fetch on the client. + +## Properties + +### mutations + +```ts +mutations: DehydratedMutation[]; +``` + +Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L98) + +*** + +### queries + +```ts +queries: DehydratedQuery[]; +``` + +Defined in: [packages/query-core/src/hydration.ts:99](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L99) diff --git a/docs/framework/preact/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/preact/reference/interfaces/EnsureQueryDataOptions.md new file mode 100644 index 00000000000..d7b4751a9d3 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/EnsureQueryDataOptions.md @@ -0,0 +1,343 @@ +--- +id: EnsureQueryDataOptions +title: EnsureQueryDataOptions +--- + +Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) + +## Deprecated + +## Extends + +- [`FetchQueryOptions`](FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### ~~gcTime?~~ + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`gcTime`](FetchQueryOptions.md#gctime) + +*** + +### ~~initialData?~~ + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialData`](FetchQueryOptions.md#initialdata) + +*** + +### ~~initialDataUpdatedAt?~~ + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialDataUpdatedAt`](FetchQueryOptions.md#initialdataupdatedat) + +*** + +### ~~initialPageParam?~~ + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialPageParam`](FetchQueryOptions.md#initialpageparam) + +*** + +### ~~maxPages?~~ + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`maxPages`](FetchQueryOptions.md#maxpages) + +*** + +### ~~meta?~~ + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`meta`](FetchQueryOptions.md#meta) + +*** + +### ~~networkMode?~~ + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`networkMode`](FetchQueryOptions.md#networkmode) + +*** + +### ~~persister?~~ + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`persister`](FetchQueryOptions.md#persister) + +*** + +### ~~queryFn?~~ + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryFn`](FetchQueryOptions.md#queryfn) + +*** + +### ~~queryHash?~~ + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryHash`](FetchQueryOptions.md#queryhash) + +*** + +### ~~queryKey~~ + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryKey`](FetchQueryOptions.md#querykey) + +*** + +### ~~queryKeyHashFn?~~ + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryKeyHashFn`](FetchQueryOptions.md#querykeyhashfn) + +*** + +### ~~retry?~~ + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`retry`](FetchQueryOptions.md#retry) + +*** + +### ~~retryDelay?~~ + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`retryDelay`](FetchQueryOptions.md#retrydelay) + +*** + +### ~~revalidateIfStale?~~ + +```ts +optional revalidateIfStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L608) + +*** + +### ~~staleTime?~~ + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`staleTime`](FetchQueryOptions.md#staletime) + +*** + +### ~~structuralSharing?~~ + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`structuralSharing`](FetchQueryOptions.md#structuralsharing) diff --git a/docs/framework/preact/reference/interfaces/FetchNextPageOptions.md b/docs/framework/preact/reference/interfaces/FetchNextPageOptions.md new file mode 100644 index 00000000000..fefe7f30c13 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/FetchNextPageOptions.md @@ -0,0 +1,41 @@ +--- +id: FetchNextPageOptions +title: FetchNextPageOptions +--- + +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) + +If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, +whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + +If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/preact/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/preact/reference/interfaces/FetchPreviousPageOptions.md new file mode 100644 index 00000000000..ad3c3c736c9 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/FetchPreviousPageOptions.md @@ -0,0 +1,41 @@ +--- +id: FetchPreviousPageOptions +title: FetchPreviousPageOptions +--- + +Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) + +If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, +whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + +If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/preact/reference/interfaces/FetchQueryOptions.md b/docs/framework/preact/reference/interfaces/FetchQueryOptions.md new file mode 100644 index 00000000000..3b9347e06ea --- /dev/null +++ b/docs/framework/preact/reference/interfaces/FetchQueryOptions.md @@ -0,0 +1,357 @@ +--- +id: FetchQueryOptions +title: FetchQueryOptions +--- + +Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L576) + +## Deprecated + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Extended by + +- [`EnsureQueryDataOptions`](EnsureQueryDataOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### ~~gcTime?~~ + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### ~~initialData?~~ + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### ~~initialDataUpdatedAt?~~ + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### ~~initialPageParam?~~ + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) + +*** + +### ~~maxPages?~~ + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### ~~meta?~~ + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### ~~networkMode?~~ + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### ~~persister?~~ + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### ~~queryFn?~~ + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### ~~queryHash?~~ + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### ~~queryKey~~ + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### ~~queryKeyHashFn?~~ + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### ~~retry?~~ + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### ~~retryDelay?~~ + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### ~~staleTime?~~ + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +*** + +### ~~structuralSharing?~~ + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` diff --git a/docs/framework/preact/reference/interfaces/HydrateOptions.md b/docs/framework/preact/reference/interfaces/HydrateOptions.md new file mode 100644 index 00000000000..fe8b92317e3 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/HydrateOptions.md @@ -0,0 +1,43 @@ +--- +id: HydrateOptions +title: HydrateOptions +--- + +Defined in: [packages/query-core/src/hydration.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L61) + +Options for `hydrate`, controlling the default options applied to queries/mutations restored from a +`DehydratedState`, and how to reverse any transformation applied by `DehydrateOptions.serializeData`. + +## Properties + +### defaultOptions? + +```ts +optional defaultOptions: object; +``` + +Defined in: [packages/query-core/src/hydration.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L62) + +#### deserializeData? + +```ts +optional deserializeData: TransformerFn; +``` + +Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. + +#### mutations? + +```ts +optional mutations: MutationOptions; +``` + +Default options merged into every mutation restored from the dehydrated state. + +#### queries? + +```ts +optional queries: QueryOptions; +``` + +Default options merged into every query restored from the dehydrated state. diff --git a/docs/framework/preact/reference/interfaces/HydrationBoundaryProps.md b/docs/framework/preact/reference/interfaces/HydrationBoundaryProps.md index 16b34036647..223a3168825 100644 --- a/docs/framework/preact/reference/interfaces/HydrationBoundaryProps.md +++ b/docs/framework/preact/reference/interfaces/HydrationBoundaryProps.md @@ -3,7 +3,7 @@ id: HydrationBoundaryProps title: HydrationBoundaryProps --- -Defined in: [preact-query/src/HydrationBoundary.tsx:17](https://github.com/TanStack/query/blob/main/packages/preact-query/src/HydrationBoundary.tsx#L17) +Defined in: [packages/preact-query/src/HydrationBoundary.tsx:17](https://github.com/TanStack/query/blob/main/packages/preact-query/src/HydrationBoundary.tsx#L17) The props accepted by `HydrationBoundary`. @@ -15,7 +15,7 @@ The props accepted by `HydrationBoundary`. optional children: ComponentChildren; ``` -Defined in: [preact-query/src/HydrationBoundary.tsx:37](https://github.com/TanStack/query/blob/main/packages/preact-query/src/HydrationBoundary.tsx#L37) +Defined in: [packages/preact-query/src/HydrationBoundary.tsx:37](https://github.com/TanStack/query/blob/main/packages/preact-query/src/HydrationBoundary.tsx#L37) The components to render — always rendered unconditionally, not gated on hydration. New queries are hydrated into the cache during render; for queries that already exist in the cache, only newer dehydrated @@ -30,7 +30,7 @@ lands. optional options: OmitKeyof & object; ``` -Defined in: [preact-query/src/HydrationBoundary.tsx:25](https://github.com/TanStack/query/blob/main/packages/preact-query/src/HydrationBoundary.tsx#L25) +Defined in: [packages/preact-query/src/HydrationBoundary.tsx:25](https://github.com/TanStack/query/blob/main/packages/preact-query/src/HydrationBoundary.tsx#L25) Optional. Note: unlike `hydrate`, `mutations` cannot be set here. @@ -40,6 +40,9 @@ Optional. Note: unlike `hydrate`, `mutations` cannot be set here. ```ts optional defaultOptions: OmitKeyof<{ + deserializeData?: TransformerFn; + mutations?: MutationOptions; + queries?: QueryOptions; }, "mutations">; ``` @@ -51,7 +54,7 @@ optional defaultOptions: OmitKeyof<{ optional queryClient: QueryClient; ``` -Defined in: [preact-query/src/HydrationBoundary.tsx:41](https://github.com/TanStack/query/blob/main/packages/preact-query/src/HydrationBoundary.tsx#L41) +Defined in: [packages/preact-query/src/HydrationBoundary.tsx:41](https://github.com/TanStack/query/blob/main/packages/preact-query/src/HydrationBoundary.tsx#L41) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. @@ -63,6 +66,6 @@ Use this to use a custom `QueryClient`. Otherwise, the one from the nearest cont state: DehydratedState | null | undefined; ``` -Defined in: [preact-query/src/HydrationBoundary.tsx:21](https://github.com/TanStack/query/blob/main/packages/preact-query/src/HydrationBoundary.tsx#L21) +Defined in: [packages/preact-query/src/HydrationBoundary.tsx:21](https://github.com/TanStack/query/blob/main/packages/preact-query/src/HydrationBoundary.tsx#L21) The state to hydrate. diff --git a/docs/framework/preact/reference/interfaces/InfiniteData.md b/docs/framework/preact/reference/interfaces/InfiniteData.md new file mode 100644 index 00000000000..4d7ad595c2d --- /dev/null +++ b/docs/framework/preact/reference/interfaces/InfiniteData.md @@ -0,0 +1,36 @@ +--- +id: InfiniteData +title: InfiniteData +--- + +Defined in: [packages/query-core/src/types.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L210) + +## Type Parameters + +### TData + +`TData` + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### pageParams + +```ts +pageParams: TPageParam[]; +``` + +Defined in: [packages/query-core/src/types.ts:212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L212) + +*** + +### pages + +```ts +pages: TData[]; +``` + +Defined in: [packages/query-core/src/types.ts:211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L211) diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult.md new file mode 100644 index 00000000000..94347ea2e40 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -0,0 +1,577 @@ +--- +id: InfiniteQueryObserverBaseResult +title: InfiniteQueryObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Extended by + +- [`InfiniteQueryObserverPendingResult`](InfiniteQueryObserverPendingResult.md) +- [`InfiniteQueryObserverLoadingResult`](InfiniteQueryObserverLoadingResult.md) +- [`InfiniteQueryObserverLoadingErrorResult`](InfiniteQueryObserverLoadingErrorResult.md) +- [`InfiniteQueryObserverRefetchErrorResult`](InfiniteQueryObserverRefetchErrorResult.md) +- [`InfiniteQueryObserverSuccessResult`](InfiniteQueryObserverSuccessResult.md) +- [`InfiniteQueryObserverPlaceholderResult`](InfiniteQueryObserverPlaceholderResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) + +The last successfully resolved data for the query. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) + +Will be `true` if the query failed while fetching the next page. + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) + +Will be `true` if the query failed while fetching the previous page. + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) + +Will be `true` if the query failed while fetching for the first time. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) + +Will be `true` if the data shown is the placeholder data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) + +Will be `true` if the query failed while refetching. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md new file mode 100644 index 00000000000..3e0d3a79fa1 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverLoadingErrorResult +title: InfiniteQueryObserverLoadingErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult.md new file mode 100644 index 00000000000..f6400f44b52 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverLoadingResult +title: InfiniteQueryObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: true; +``` + +Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverOptions.md new file mode 100644 index 00000000000..db1ca7f18fe --- /dev/null +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverOptions.md @@ -0,0 +1,605 @@ +--- +id: InfiniteQueryObserverOptions +title: InfiniteQueryObserverOptions +--- + +Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) + +## Extends + +- [`QueryObserverOptions`](QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`, `TPageParam`\>.[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md)\<`TQueryFnData`, `TPageParam`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### enabled? + +```ts +optional enabled: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`enabled`](QueryObserverOptions.md#enabled) + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`gcTime`](QueryObserverOptions.md#gctime) + +*** + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`getNextPageParam`](InfiniteQueryPageParamsOptions.md#getnextpageparam) + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`getPreviousPageParam`](InfiniteQueryPageParamsOptions.md#getpreviouspageparam) + +*** + +### initialData? + +```ts +optional initialData: + | InfiniteData +| InitialDataFunction>; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialData`](QueryObserverOptions.md#initialdata) + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialDataUpdatedAt`](QueryObserverOptions.md#initialdataupdatedat) + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`initialPageParam`](InfiniteQueryPageParamsOptions.md#initialpageparam) + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`maxPages`](QueryObserverOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`meta`](QueryObserverOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`networkMode`](QueryObserverOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`persister`](QueryObserverOptions.md#persister) + +*** + +### placeholderData? + +```ts +optional placeholderData: + | InfiniteData +| PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`placeholderData`](QueryObserverOptions.md#placeholderdata) + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryFn`](QueryObserverOptions.md#queryfn) + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryHash`](QueryObserverOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKey`](QueryObserverOptions.md#querykey) + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKeyHashFn`](QueryObserverOptions.md#querykeyhashfn) + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchInterval`](QueryObserverOptions.md#refetchinterval) + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnMount`](QueryObserverOptions.md#refetchonmount) + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnReconnect`](QueryObserverOptions.md#refetchonreconnect) + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnWindowFocus`](QueryObserverOptions.md#refetchonwindowfocus) + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retry`](QueryObserverOptions.md#retry) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryOnMount`](QueryObserverOptions.md#retryonmount) + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +[`InfiniteData`](InfiniteData.md) + +#### Returns + +`TData` + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`select`](QueryObserverOptions.md#select) + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`staleTime`](QueryObserverOptions.md#staletime) + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`structuralSharing`](QueryObserverOptions.md#structuralsharing) + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`suspense`](QueryObserverOptions.md#suspense) + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`throwOnError`](QueryObserverOptions.md#throwonerror) diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult.md new file mode 100644 index 00000000000..53d910f545d --- /dev/null +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverPendingResult +title: InfiniteQueryObserverPendingResult +--- + +Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1009) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1013](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1013) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1017](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1017) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1016](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1016) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1021](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1021) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1023](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1023) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md new file mode 100644 index 00000000000..5949179bc6f --- /dev/null +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverPlaceholderResult +title: InfiniteQueryObserverPlaceholderResult +--- + +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: true; +``` + +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md new file mode 100644 index 00000000000..e299e60ddc3 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverRefetchErrorResult +title: InfiniteQueryObserverRefetchErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) + +Will be `true` if the query failed while fetching the next page. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) + +Will be `true` if the query failed while fetching the previous page. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult.md new file mode 100644 index 00000000000..7b550e0a90b --- /dev/null +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverSuccessResult +title: InfiniteQueryObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/preact/reference/interfaces/InfiniteQueryPageParamsOptions.md new file mode 100644 index 00000000000..bfab8bfc319 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -0,0 +1,64 @@ +--- +id: InfiniteQueryPageParamsOptions +title: InfiniteQueryPageParamsOptions +--- + +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) + +## Extends + +- [`InitialPageParam`](InitialPageParam.md)\<`TPageParam`\> + +## Extended by + +- [`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +[`InitialPageParam`](InitialPageParam.md).[`initialPageParam`](InitialPageParam.md#initialpageparam) diff --git a/docs/framework/preact/reference/interfaces/InitialPageParam.md b/docs/framework/preact/reference/interfaces/InitialPageParam.md new file mode 100644 index 00000000000..ffbf32ae0d6 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/InitialPageParam.md @@ -0,0 +1,26 @@ +--- +id: InitialPageParam +title: InitialPageParam +--- + +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) + +## Extended by + +- [`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md) + +## Type Parameters + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) diff --git a/docs/framework/preact/reference/interfaces/InvalidateOptions.md b/docs/framework/preact/reference/interfaces/InvalidateOptions.md new file mode 100644 index 00000000000..494afe1c465 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/InvalidateOptions.md @@ -0,0 +1,44 @@ +--- +id: InvalidateOptions +title: InvalidateOptions +--- + +Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L700) + +## Extends + +- [`RefetchOptions`](RefetchOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`cancelRefetch`](RefetchOptions.md#cancelrefetch) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`throwOnError`](RefetchOptions.md#throwonerror) diff --git a/docs/framework/preact/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/preact/reference/interfaces/InvalidateQueryFilters.md new file mode 100644 index 00000000000..4824d80d910 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/InvalidateQueryFilters.md @@ -0,0 +1,135 @@ +--- +id: InvalidateQueryFilters +title: InvalidateQueryFilters +--- + +Defined in: [packages/query-core/src/types.ts:690](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L690) + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extends + +- [`QueryFilters`](QueryFilters.md)\<`TQueryKey`\> + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`exact`](QueryFilters.md#exact) + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`fetchStatus`](QueryFilters.md#fetchstatus) + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`predicate`](QueryFilters.md#predicate) + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`queryKey`](QueryFilters.md#querykey) + +*** + +### refetchType? + +```ts +optional refetchType: QueryTypeFilter | "none"; +``` + +Defined in: [packages/query-core/src/types.ts:693](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L693) + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`stale`](QueryFilters.md#stale) + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/preact/reference/interfaces/MutateOptions.md b/docs/framework/preact/reference/interfaces/MutateOptions.md new file mode 100644 index 00000000000..a0af091a997 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/MutateOptions.md @@ -0,0 +1,124 @@ +--- +id: MutateOptions +title: MutateOptions +--- + +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1228) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1234) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1222](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1222) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` diff --git a/docs/framework/preact/reference/interfaces/MutationCacheConfig.md b/docs/framework/preact/reference/interfaces/MutationCacheConfig.md new file mode 100644 index 00000000000..c38d2dc26f4 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/MutationCacheConfig.md @@ -0,0 +1,161 @@ +--- +id: MutationCacheConfig +title: MutationCacheConfig +--- + +Defined in: [packages/query-core/src/mutationCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L26) + +Global callbacks that fire for every mutation handled by a `MutationCache`, regardless of which +component or observer triggered it. They differ from the `defaultOptions` provided to a +`QueryClient` in two ways: `defaultOptions` can be overridden by each mutation, while these +callbacks are always called, and `onMutate` here does not allow returning a result. + +If a callback returns a promise, it will be awaited before the mutation continues. + +## Properties + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L28) + +Called when any mutation in the cache encounters an error. + +#### Parameters + +##### error + +`Error` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L44) + +Called before any mutation in the cache executes. + +#### Parameters + +##### variables + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:50](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L50) + +Called when any mutation in the cache is settled, either successfully or with an error. + +#### Parameters + +##### data + +`unknown` + +##### error + +`Error` | `null` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:36](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L36) + +Called when any mutation in the cache is successful. + +#### Parameters + +##### data + +`unknown` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` diff --git a/docs/framework/preact/reference/interfaces/MutationFilters.md b/docs/framework/preact/reference/interfaces/MutationFilters.md new file mode 100644 index 00000000000..378a411bfe5 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/MutationFilters.md @@ -0,0 +1,85 @@ +--- +id: MutationFilters +title: MutationFilters +--- + +Defined in: [packages/query-core/src/utils.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L62) + +Filters used to select mutations, for example in `mutationCache.findAll` or `queryClient.isMutating`. +All provided filters must match; filters that are left unspecified are ignored. + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L71) + +Match mutation key exactly + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/utils.ts:81](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L81) + +Include mutations matching this mutation key + +*** + +### predicate()? + +```ts +optional predicate: (mutation) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L75) + +Include mutations matching this predicate function + +#### Parameters + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`boolean` + +*** + +### status? + +```ts +optional status: MutationStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L85) + +Filter by mutation status diff --git a/docs/framework/preact/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/preact/reference/interfaces/MutationObserverBaseResult.md new file mode 100644 index 00000000000..98810323966 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/MutationObserverBaseResult.md @@ -0,0 +1,291 @@ +--- +id: MutationObserverBaseResult +title: MutationObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationState`](MutationState.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Extended by + +- [`MutationObserverIdleResult`](MutationObserverIdleResult.md) +- [`MutationObserverLoadingResult`](MutationObserverLoadingResult.md) +- [`MutationObserverErrorResult`](MutationObserverErrorResult.md) +- [`MutationObserverSuccessResult`](MutationObserverSuccessResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationState`](MutationState.md).[`context`](MutationState.md#context) + +*** + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationState`](MutationState.md).[`data`](MutationState.md#data) + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:1285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1285) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationState`](MutationState.md).[`error`](MutationState.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationState`](MutationState.md).[`failureCount`](MutationState.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationState`](MutationState.md).[`failureReason`](MutationState.md#failurereason) + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +*** + +### isIdle + +```ts +isIdle: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1295) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationState`](MutationState.md).[`isPaused`](MutationState.md#ispaused) + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1300](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1300) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1305](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1305) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +*** + +### status + +```ts +status: MutationStatus; +``` + +Defined in: [packages/query-core/src/types.ts:1314](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1314) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationState`](MutationState.md).[`status`](MutationState.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationState`](MutationState.md).[`submittedAt`](MutationState.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationState`](MutationState.md).[`variables`](MutationState.md#variables) diff --git a/docs/framework/preact/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/preact/reference/interfaces/MutationObserverErrorResult.md new file mode 100644 index 00000000000..d61f244ced4 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/MutationObserverErrorResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverErrorResult +title: MutationObserverErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1374](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1374) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1385](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1385) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1386](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1386) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1388](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1388) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1389](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1389) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1390) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/preact/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/preact/reference/interfaces/MutationObserverIdleResult.md new file mode 100644 index 00000000000..93655da0aa5 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/MutationObserverIdleResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverIdleResult +title: MutationObserverIdleResult +--- + +Defined in: [packages/query-core/src/types.ts:1332](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1332) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1346](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1346) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: true; +``` + +Defined in: [packages/query-core/src/types.ts:1347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1347) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1349) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "idle"; +``` + +Defined in: [packages/query-core/src/types.ts:1350](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1350) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/preact/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/preact/reference/interfaces/MutationObserverLoadingResult.md new file mode 100644 index 00000000000..de146c45f5c --- /dev/null +++ b/docs/framework/preact/reference/interfaces/MutationObserverLoadingResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverLoadingResult +title: MutationObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1364](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1364) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1367](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1367) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1369](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1369) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1370](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1370) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1371](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1371) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1365) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/preact/reference/interfaces/MutationObserverOptions.md b/docs/framework/preact/reference/interfaces/MutationObserverOptions.md new file mode 100644 index 00000000000..fe59cc7444d --- /dev/null +++ b/docs/framework/preact/reference/interfaces/MutationObserverOptions.md @@ -0,0 +1,290 @@ +--- +id: MutationObserverOptions +title: MutationObserverOptions +--- + +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) + +## Extends + +- [`MutationOptions`](MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`gcTime`](MutationOptions.md#gctime) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`meta`](MutationOptions.md#meta) + +*** + +### mutationFn? + +```ts +optional mutationFn: MutationFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`mutationFn`](MutationOptions.md#mutationfn) + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`mutationKey`](MutationOptions.md#mutationkey) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`networkMode`](MutationOptions.md#networkmode) + +*** + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onError`](MutationOptions.md#onerror) + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, context) => TOnMutateResult | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) + +#### Parameters + +##### variables + +`TVariables` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`TOnMutateResult` \| `Promise`\<`TOnMutateResult`\> + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onMutate`](MutationOptions.md#onmutate) + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onSettled`](MutationOptions.md#onsettled) + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onSuccess`](MutationOptions.md#onsuccess) + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`retry`](MutationOptions.md#retry) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`retryDelay`](MutationOptions.md#retrydelay) + +*** + +### scope? + +```ts +optional scope: MutationScope; +``` + +Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`scope`](MutationOptions.md#scope) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean | (error) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) diff --git a/docs/framework/preact/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/preact/reference/interfaces/MutationObserverSuccessResult.md new file mode 100644 index 00000000000..b50ec4ab6f1 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/MutationObserverSuccessResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverSuccessResult +title: MutationObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1406](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1406) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1407) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1409) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1410](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1410) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/preact/reference/interfaces/MutationOptions.md b/docs/framework/preact/reference/interfaces/MutationOptions.md new file mode 100644 index 00000000000..f641d241142 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/MutationOptions.md @@ -0,0 +1,232 @@ +--- +id: MutationOptions +title: MutationOptions +--- + +Defined in: [packages/query-core/src/types.ts:1166](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1166) + +## Extended by + +- [`MutationObserverOptions`](MutationObserverOptions.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) + +*** + +### mutationFn? + +```ts +optional mutationFn: MutationFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) + +*** + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, context) => TOnMutateResult | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) + +#### Parameters + +##### variables + +`TVariables` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`TOnMutateResult` \| `Promise`\<`TOnMutateResult`\> + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) + +*** + +### scope? + +```ts +optional scope: MutationScope; +``` + +Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) diff --git a/docs/framework/preact/reference/interfaces/MutationState.md b/docs/framework/preact/reference/interfaces/MutationState.md new file mode 100644 index 00000000000..bec050ec1d3 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/MutationState.md @@ -0,0 +1,142 @@ +--- +id: MutationState +title: MutationState +--- + +Defined in: [packages/query-core/src/mutation.ts:30](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L30) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extended by + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +*** + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L44) + +The last successfully resolved data for the mutation. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L49) + +The error object for the mutation, if the last attempt resulted in an error. +- Defaults to `null`. + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +*** + +### status + +```ts +status: MutationStatus; +``` + +Defined in: [packages/query-core/src/mutation.ts:66](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L66) + +The status of the mutation. + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +*** + +### variables + +```ts +variables: TVariables | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L70) + +The variables the mutation was last called with. diff --git a/docs/framework/preact/reference/interfaces/NotifyEvent.md b/docs/framework/preact/reference/interfaces/NotifyEvent.md new file mode 100644 index 00000000000..1dc93464df1 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/NotifyEvent.md @@ -0,0 +1,16 @@ +--- +id: NotifyEvent +title: NotifyEvent +--- + +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) + +## Properties + +### type + +```ts +type: NotifyEventType; +``` + +Defined in: [packages/query-core/src/types.ts:1462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1462) diff --git a/docs/framework/preact/reference/interfaces/QueriesObserverOptions.md b/docs/framework/preact/reference/interfaces/QueriesObserverOptions.md new file mode 100644 index 00000000000..16035c45714 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/QueriesObserverOptions.md @@ -0,0 +1,27 @@ +--- +id: QueriesObserverOptions +title: QueriesObserverOptions +--- + +Defined in: [packages/query-core/src/queriesObserver.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L23) + +## Type Parameters + +### TCombinedResult + +`TCombinedResult` = [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +## Properties + +### combine? + +```ts +optional combine: CombineFn; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L32) + +A function that combines the array of `QueryObserverResult`s (one per +observed query) into a single value. The combined value is memoized and +only recomputed when one of the underlying results, the query hashes, or +the `combine` function itself changes. diff --git a/docs/framework/preact/reference/interfaces/QueryCacheConfig.md b/docs/framework/preact/reference/interfaces/QueryCacheConfig.md new file mode 100644 index 00000000000..69ea600366c --- /dev/null +++ b/docs/framework/preact/reference/interfaces/QueryCacheConfig.md @@ -0,0 +1,92 @@ +--- +id: QueryCacheConfig +title: QueryCacheConfig +--- + +Defined in: [packages/query-core/src/queryCache.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L24) + +Global callbacks that fire for every query handled by a `QueryCache`, regardless of which +component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can +override, these callbacks are always called. + +## Properties + +### onError()? + +```ts +optional onError: (error, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L26) + +Called when any query in the cache encounters an error. + +#### Parameters + +##### error + +`Error` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L33) + +Called when any query in the cache is settled, either successfully or with an error. + +#### Parameters + +##### data + +`unknown` + +##### error + +`Error` | `null` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L31) + +Called when any query in the cache is successful. + +#### Parameters + +##### data + +`unknown` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` diff --git a/docs/framework/preact/reference/interfaces/QueryClientConfig.md b/docs/framework/preact/reference/interfaces/QueryClientConfig.md new file mode 100644 index 00000000000..7c9bc255b35 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/QueryClientConfig.md @@ -0,0 +1,36 @@ +--- +id: QueryClientConfig +title: QueryClientConfig +--- + +Defined in: [packages/query-core/src/types.ts:1427](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1427) + +## Properties + +### defaultOptions? + +```ts +optional defaultOptions: DefaultOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1430](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1430) + +*** + +### mutationCache? + +```ts +optional mutationCache: MutationCache; +``` + +Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) + +*** + +### queryCache? + +```ts +optional queryCache: QueryCache; +``` + +Defined in: [packages/query-core/src/types.ts:1428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1428) diff --git a/docs/framework/preact/reference/interfaces/QueryErrorResetBoundaryProps.md b/docs/framework/preact/reference/interfaces/QueryErrorResetBoundaryProps.md index a11940b348b..df8d5756552 100644 --- a/docs/framework/preact/reference/interfaces/QueryErrorResetBoundaryProps.md +++ b/docs/framework/preact/reference/interfaces/QueryErrorResetBoundaryProps.md @@ -3,7 +3,7 @@ id: QueryErrorResetBoundaryProps title: QueryErrorResetBoundaryProps --- -Defined in: [preact-query/src/QueryErrorResetBoundary.tsx:103](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryErrorResetBoundary.tsx#L103) +Defined in: [packages/preact-query/src/QueryErrorResetBoundary.tsx:103](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryErrorResetBoundary.tsx#L103) The props accepted by `QueryErrorResetBoundary`. @@ -17,7 +17,7 @@ children: | QueryErrorResetBoundaryFunction; ``` -Defined in: [preact-query/src/QueryErrorResetBoundary.tsx:108](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryErrorResetBoundary.tsx#L108) +Defined in: [packages/preact-query/src/QueryErrorResetBoundary.tsx:108](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryErrorResetBoundary.tsx#L108) Either a plain node, or a function that receives the boundary's QueryErrorResetBoundaryValue and returns a node. diff --git a/docs/framework/preact/reference/interfaces/QueryExecuteOptions.md b/docs/framework/preact/reference/interfaces/QueryExecuteOptions.md new file mode 100644 index 00000000000..5a055675308 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/QueryExecuteOptions.md @@ -0,0 +1,375 @@ +--- +id: QueryExecuteOptions +title: QueryExecuteOptions +--- + +Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L555) + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](QueryOptions.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### initialPageParam? + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L567) + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:572](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L572) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` diff --git a/docs/framework/preact/reference/interfaces/QueryFilters.md b/docs/framework/preact/reference/interfaces/QueryFilters.md new file mode 100644 index 00000000000..6b177d93aa5 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/QueryFilters.md @@ -0,0 +1,102 @@ +--- +id: QueryFilters +title: QueryFilters +--- + +Defined in: [packages/query-core/src/utils.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L31) + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extended by + +- [`InvalidateQueryFilters`](InvalidateQueryFilters.md) +- [`RefetchQueryFilters`](RefetchQueryFilters.md) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries diff --git a/docs/framework/preact/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/preact/reference/interfaces/QueryObserverBaseResult.md new file mode 100644 index 00000000000..2840be27e27 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/QueryObserverBaseResult.md @@ -0,0 +1,358 @@ +--- +id: QueryObserverBaseResult +title: QueryObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) + +## Extended by + +- [`QueryObserverPendingResult`](QueryObserverPendingResult.md) +- [`QueryObserverLoadingResult`](QueryObserverLoadingResult.md) +- [`QueryObserverLoadingErrorResult`](QueryObserverLoadingErrorResult.md) +- [`QueryObserverRefetchErrorResult`](QueryObserverRefetchErrorResult.md) +- [`QueryObserverSuccessResult`](QueryObserverSuccessResult.md) +- [`QueryObserverPlaceholderResult`](QueryObserverPlaceholderResult.md) +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) + +The last successfully resolved data for the query. + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +*** + +### isLoadingError + +```ts +isLoadingError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) + +Will be `true` if the query failed while fetching for the first time. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) + +Will be `true` if the data shown is the placeholder data. + +*** + +### isRefetchError + +```ts +isRefetchError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) + +Will be `true` if the query failed while refetching. + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. diff --git a/docs/framework/preact/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/preact/reference/interfaces/QueryObserverLoadingErrorResult.md new file mode 100644 index 00000000000..97d5d5125a7 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverLoadingErrorResult +title: QueryObserverLoadingErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: true; +``` + +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/preact/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/preact/reference/interfaces/QueryObserverLoadingResult.md new file mode 100644 index 00000000000..1f442f18130 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/QueryObserverLoadingResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverLoadingResult +title: QueryObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L873) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: true; +``` + +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:885](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L885) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:884](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L884) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/preact/reference/interfaces/QueryObserverOptions.md b/docs/framework/preact/reference/interfaces/QueryObserverOptions.md new file mode 100644 index 00000000000..6d3cf82607b --- /dev/null +++ b/docs/framework/preact/reference/interfaces/QueryObserverOptions.md @@ -0,0 +1,542 @@ +--- +id: QueryObserverOptions +title: QueryObserverOptions +--- + +Defined in: [packages/query-core/src/types.ts:373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L373) + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](QueryOptions.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Extended by + +- [`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md) +- [`UseBaseQueryOptions`](UseBaseQueryOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### enabled? + +```ts +optional enabled: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### placeholderData? + +```ts +optional placeholderData: + | NonFunctionGuard +| PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. diff --git a/docs/framework/preact/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/preact/reference/interfaces/QueryObserverPendingResult.md new file mode 100644 index 00000000000..ad040ff9cc5 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/QueryObserverPendingResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverPendingResult +title: QueryObserverPendingResult +--- + +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:862](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L862) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:864](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L864) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:866](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L866) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:865](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L865) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:869](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L869) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:870](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L870) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/preact/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/preact/reference/interfaces/QueryObserverPlaceholderResult.md new file mode 100644 index 00000000000..8a1ae61dee9 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/QueryObserverPlaceholderResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverPlaceholderResult +title: QueryObserverPlaceholderResult +--- + +Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: true; +``` + +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/preact/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/preact/reference/interfaces/QueryObserverRefetchErrorResult.md new file mode 100644 index 00000000000..c8d5274697a --- /dev/null +++ b/docs/framework/preact/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverRefetchErrorResult +title: QueryObserverRefetchErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: true; +``` + +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/preact/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/preact/reference/interfaces/QueryObserverSuccessResult.md new file mode 100644 index 00000000000..e3c834e6c3a --- /dev/null +++ b/docs/framework/preact/reference/interfaces/QueryObserverSuccessResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverSuccessResult +title: QueryObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/preact/reference/interfaces/QueryOptions.md b/docs/framework/preact/reference/interfaces/QueryOptions.md new file mode 100644 index 00000000000..ba603a4332f --- /dev/null +++ b/docs/framework/preact/reference/interfaces/QueryOptions.md @@ -0,0 +1,240 @@ +--- +id: QueryOptions +title: QueryOptions +--- + +Defined in: [packages/query-core/src/types.ts:231](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L231) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +*** + +### initialData? + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +*** + +### queryFn? + +```ts +optional queryFn: + | QueryFunction + | typeof skipToken; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. diff --git a/docs/framework/preact/reference/interfaces/QueryState.md b/docs/framework/preact/reference/interfaces/QueryState.md new file mode 100644 index 00000000000..7dce476d743 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/QueryState.md @@ -0,0 +1,175 @@ +--- +id: QueryState +title: QueryState +--- + +Defined in: [packages/query-core/src/query.ts:52](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L52) + +The raw state stored on a `Query` instance. This is the underlying state +that observer results (e.g. `QueryObserverResult`) are derived from. + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:56](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L56) + +The last successfully resolved data for the query. + +*** + +### dataUpdateCount + +```ts +dataUpdateCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L60) + +The number of times the query has successfully resolved. + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/query.ts:64](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L64) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/query.ts:69](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L69) + +The error object for the query, if the last attempt resulted in an error. +- Defaults to `null`. + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:73](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L73) + +The sum of all errors, incremented every time the query resolves with an error. + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/query.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L77) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +*** + +### fetchFailureCount + +```ts +fetchFailureCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L83) + +The failure count for the current fetch. +- Incremented every time the fetch fails. +- Reset to `0` when the fetch succeeds. + +*** + +### fetchFailureReason + +```ts +fetchFailureReason: TError | null; +``` + +Defined in: [packages/query-core/src/query.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L88) + +The reason the current fetch failed, as reported by the retryer. +- Reset to `null` when the fetch succeeds. + +*** + +### fetchMeta + +```ts +fetchMeta: FetchMeta | null; +``` + +Defined in: [packages/query-core/src/query.ts:93](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L93) + +Metadata passed to the currently in-flight (or most recent) fetch, e.g. the +`fetchMore` direction for infinite queries. + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/query.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L112) + +The fetch status of the query. +- `fetching`: the `queryFn` is currently executing. +- `paused`: a fetch wanted to run but has been paused (see network mode). +- `idle`: the query is not fetching. + +*** + +### isInvalidated + +```ts +isInvalidated: boolean; +``` + +Defined in: [packages/query-core/src/query.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L98) + +Whether the query has been marked as invalidated via `invalidate()`. +- Reset to `false` whenever the query resolves successfully. + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/query.ts:105](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L105) + +The status of the query. +- `pending` if there's no cached data and no attempt was finished yet. +- `error` if the last attempt resulted in an error. +- `success` if the query has data. diff --git a/docs/framework/preact/reference/interfaces/RefetchOptions.md b/docs/framework/preact/reference/interfaces/RefetchOptions.md new file mode 100644 index 00000000000..a3db94b1674 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/RefetchOptions.md @@ -0,0 +1,45 @@ +--- +id: RefetchOptions +title: RefetchOptions +--- + +Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L679) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Extended by + +- [`InvalidateOptions`](InvalidateOptions.md) +- [`ResetOptions`](ResetOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/preact/reference/interfaces/RefetchQueryFilters.md b/docs/framework/preact/reference/interfaces/RefetchQueryFilters.md new file mode 100644 index 00000000000..f2b6b287875 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/RefetchQueryFilters.md @@ -0,0 +1,125 @@ +--- +id: RefetchQueryFilters +title: RefetchQueryFilters +--- + +Defined in: [packages/query-core/src/types.ts:696](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L696) + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extends + +- [`QueryFilters`](QueryFilters.md)\<`TQueryKey`\> + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`exact`](QueryFilters.md#exact) + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`fetchStatus`](QueryFilters.md#fetchstatus) + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`predicate`](QueryFilters.md#predicate) + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`queryKey`](QueryFilters.md#querykey) + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`stale`](QueryFilters.md#stale) + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/preact/reference/interfaces/Register.md b/docs/framework/preact/reference/interfaces/Register.md new file mode 100644 index 00000000000..4f442442b48 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/Register.md @@ -0,0 +1,6 @@ +--- +id: Register +title: Register +--- + +Defined in: [packages/query-core/src/types.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L37) diff --git a/docs/framework/preact/reference/interfaces/ResetOptions.md b/docs/framework/preact/reference/interfaces/ResetOptions.md new file mode 100644 index 00000000000..bfa931717f8 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/ResetOptions.md @@ -0,0 +1,44 @@ +--- +id: ResetOptions +title: ResetOptions +--- + +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) + +## Extends + +- [`RefetchOptions`](RefetchOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`cancelRefetch`](RefetchOptions.md#cancelrefetch) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`throwOnError`](RefetchOptions.md#throwonerror) diff --git a/docs/framework/preact/reference/interfaces/ResultOptions.md b/docs/framework/preact/reference/interfaces/ResultOptions.md new file mode 100644 index 00000000000..dbf00d6c67e --- /dev/null +++ b/docs/framework/preact/reference/interfaces/ResultOptions.md @@ -0,0 +1,22 @@ +--- +id: ResultOptions +title: ResultOptions +--- + +Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) + +## Extended by + +- [`RefetchOptions`](RefetchOptions.md) +- [`FetchNextPageOptions`](FetchNextPageOptions.md) +- [`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +## Properties + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) diff --git a/docs/framework/preact/reference/interfaces/SetDataOptions.md b/docs/framework/preact/reference/interfaces/SetDataOptions.md new file mode 100644 index 00000000000..5fcbcfdf7cd --- /dev/null +++ b/docs/framework/preact/reference/interfaces/SetDataOptions.md @@ -0,0 +1,16 @@ +--- +id: SetDataOptions +title: SetDataOptions +--- + +Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1448) + +## Properties + +### updatedAt? + +```ts +optional updatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) diff --git a/docs/framework/preact/reference/interfaces/UseBaseQueryOptions.md b/docs/framework/preact/reference/interfaces/UseBaseQueryOptions.md index 537e461bbef..f9e68ee7510 100644 --- a/docs/framework/preact/reference/interfaces/UseBaseQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/UseBaseQueryOptions.md @@ -3,14 +3,14 @@ id: UseBaseQueryOptions title: UseBaseQueryOptions --- -Defined in: [preact-query/src/types.ts:46](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L46) +Defined in: [packages/preact-query/src/types.ts:46](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L46) -The options shared by `useQuery` and `useSuspenseQuery`. Extends QueryObserverOptions from +The options shared by `useQuery` and `useSuspenseQuery`. Extends [QueryObserverOptions](QueryObserverOptions.md) from `@tanstack/query-core` with the `preact-query`-specific `subscribed` option. ## Extends -- `QueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> +- [`QueryObserverOptions`](QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> ## Type Parameters @@ -22,7 +22,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. @@ -42,19 +42,550 @@ The type of the data actually held in the query cache — the input to `select` ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. ## Properties +### enabled? + +```ts +optional enabled: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`enabled`](QueryObserverOptions.md#enabled) + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`gcTime`](QueryObserverOptions.md#gctime) + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialData`](QueryObserverOptions.md#initialdata) + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialDataUpdatedAt`](QueryObserverOptions.md#initialdataupdatedat) + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`maxPages`](QueryObserverOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`meta`](QueryObserverOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`networkMode`](QueryObserverOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister()? + +```ts +optional persister: (queryFn, context, query) => TQueryFnData | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Parameters + +##### queryFn + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TQueryFnData`, `NoInfer`\<`TQueryKey`\>, `never`\> + +##### context + +###### client + +[`QueryClient`](../classes/QueryClient.md) + +###### direction? + +`unknown` + +**Deprecated** + +if you want access to the direction, you can add it to the pageParam + +###### meta + +`Record`\<`string`, `unknown`\> \| `undefined` + +###### pageParam? + +`unknown` + +###### queryKey + +`NoInfer`\<`TQueryKey`\> + +###### signal + +`AbortSignal` + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`TQueryFnData` \| `Promise`\<`TQueryFnData`\> + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`persister`](QueryObserverOptions.md#persister) + +*** + +### placeholderData? + +```ts +optional placeholderData: + | NonFunctionGuard +| PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`placeholderData`](QueryObserverOptions.md#placeholderdata) + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryFn`](QueryObserverOptions.md#queryfn) + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryHash`](QueryObserverOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKey`](QueryObserverOptions.md#querykey) + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKeyHashFn`](QueryObserverOptions.md#querykeyhashfn) + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchInterval`](QueryObserverOptions.md#refetchinterval) + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnMount`](QueryObserverOptions.md#refetchonmount) + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnReconnect`](QueryObserverOptions.md#refetchonreconnect) + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnWindowFocus`](QueryObserverOptions.md#refetchonwindowfocus) + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retry`](QueryObserverOptions.md#retry) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryOnMount`](QueryObserverOptions.md#retryonmount) + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`select`](QueryObserverOptions.md#select) + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`staleTime`](QueryObserverOptions.md#staletime) + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`structuralSharing`](QueryObserverOptions.md#structuralsharing) + +*** + ### subscribed? ```ts optional subscribed: boolean; ``` -Defined in: [preact-query/src/types.ts:64](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L64) +Defined in: [packages/preact-query/src/types.ts:64](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L64) Set this to `false` to unsubscribe this observer from updates to the query cache. @@ -63,3 +594,41 @@ Set this to `false` to unsubscribe this observer from updates to the query cache ```ts true ``` + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`suspense`](QueryObserverOptions.md#suspense) + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`throwOnError`](QueryObserverOptions.md#throwonerror) diff --git a/docs/framework/preact/reference/interfaces/UseInfiniteQueryOptions.md b/docs/framework/preact/reference/interfaces/UseInfiniteQueryOptions.md index e7a6d226843..42ff42bbdc5 100644 --- a/docs/framework/preact/reference/interfaces/UseInfiniteQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/UseInfiniteQueryOptions.md @@ -3,15 +3,15 @@ id: UseInfiniteQueryOptions title: UseInfiniteQueryOptions --- -Defined in: [preact-query/src/types.ts:237](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L237) +Defined in: [packages/preact-query/src/types.ts:237](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L237) -The options accepted by `useInfiniteQuery`. Extends InfiniteQueryObserverOptions from +The options accepted by `useInfiniteQuery`. Extends [InfiniteQueryObserverOptions](InfiniteQueryObserverOptions.md) from `@tanstack/query-core` with the `preact-query`-specific `subscribed` option, minus `suspense` (which `preact-query` derives from which hook you call rather than exposing as an option). ## Extends -- `OmitKeyof`\<`InfiniteQueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"suspense"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"suspense"`\> ## Type Parameters @@ -23,20 +23,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. @@ -48,13 +48,590 @@ The type of the parameter passed to `queryFn` to fetch a given page. ## Properties +### enabled? + +```ts +optional enabled: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.enabled +``` + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`gcTime`](QueryOptions.md#gctime) + +*** + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +#### Inherited from + +```ts +OmitKeyof.getNextPageParam +``` + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +#### Inherited from + +```ts +OmitKeyof.getPreviousPageParam +``` + +*** + +### initialData? + +```ts +optional initialData: + | InfiniteData +| InitialDataFunction>; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +OmitKeyof.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +OmitKeyof.initialDataUpdatedAt +``` + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +```ts +OmitKeyof.initialPageParam +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`maxPages`](QueryOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`meta`](QueryOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`networkMode`](QueryOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +OmitKeyof.persister +``` + +*** + +### placeholderData? + +```ts +optional placeholderData: + | InfiniteData +| PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +```ts +OmitKeyof.placeholderData +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +OmitKeyof.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`queryHash`](QueryOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +OmitKeyof.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +OmitKeyof.queryKeyHashFn +``` + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchInterval +``` + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnMount +``` + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnReconnect +``` + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnWindowFocus +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.retryOnMount +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +[`InfiniteData`](InfiniteData.md) + +#### Returns + +`TData` + +#### Inherited from + +```ts +OmitKeyof.select +``` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +```ts +OmitKeyof.staleTime +``` + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.structuralSharing +``` + +*** + ### subscribed? ```ts optional subscribed: boolean; ``` -Defined in: [preact-query/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L258) +Defined in: [packages/preact-query/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L258) Set this to `false` to unsubscribe this observer from updates to the query cache. @@ -63,3 +640,25 @@ Set this to `false` to unsubscribe this observer from updates to the query cache ```ts true ``` + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.throwOnError +``` diff --git a/docs/framework/preact/reference/interfaces/UseMutationOptions.md b/docs/framework/preact/reference/interfaces/UseMutationOptions.md index e3b5143b26a..af61a2f0862 100644 --- a/docs/framework/preact/reference/interfaces/UseMutationOptions.md +++ b/docs/framework/preact/reference/interfaces/UseMutationOptions.md @@ -3,14 +3,14 @@ id: UseMutationOptions title: UseMutationOptions --- -Defined in: [preact-query/src/types.ts:411](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L411) +Defined in: [packages/preact-query/src/types.ts:411](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L411) -The options accepted by `useMutation`. Same as MutationObserverOptions from `@tanstack/query-core`, +The options accepted by `useMutation`. Same as [MutationObserverOptions](MutationObserverOptions.md) from `@tanstack/query-core`, minus the internal `_defaulted` flag. ## Extends -- `OmitKeyof`\<`MutationObserverOptions`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"_defaulted"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"_defaulted"`\> ## Type Parameters @@ -22,7 +22,7 @@ The type your mutation function resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your mutation function may throw. @@ -38,3 +38,285 @@ The type of the variable passed to `mutate`/`mutateAsync`. The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as their `onMutateResult` parameter — useful for optimistic-update rollback data. + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`gcTime`](MutationOptions.md#gctime) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`meta`](MutationOptions.md#meta) + +*** + +### mutationFn? + +```ts +optional mutationFn: MutationFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) + +#### Inherited from + +```ts +OmitKeyof.mutationFn +``` + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`mutationKey`](MutationOptions.md#mutationkey) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`networkMode`](MutationOptions.md#networkmode) + +*** + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +OmitKeyof.onError +``` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, context) => TOnMutateResult | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) + +#### Parameters + +##### variables + +`TVariables` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`TOnMutateResult` \| `Promise`\<`TOnMutateResult`\> + +#### Inherited from + +```ts +OmitKeyof.onMutate +``` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +OmitKeyof.onSettled +``` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +OmitKeyof.onSuccess +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### scope? + +```ts +optional scope: MutationScope; +``` + +Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`scope`](MutationOptions.md#scope) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean | (error) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) + +#### Inherited from + +```ts +OmitKeyof.throwOnError +``` diff --git a/docs/framework/preact/reference/interfaces/UseQueryOptions.md b/docs/framework/preact/reference/interfaces/UseQueryOptions.md index b524552cc68..b200cf05d99 100644 --- a/docs/framework/preact/reference/interfaces/UseQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/UseQueryOptions.md @@ -3,14 +3,14 @@ id: UseQueryOptions title: UseQueryOptions --- -Defined in: [preact-query/src/types.ts:164](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L164) +Defined in: [packages/preact-query/src/types.ts:164](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L164) The options accepted by `useQuery`. Same as [UseBaseQueryOptions](UseBaseQueryOptions.md), minus `suspense` (which `preact-query` derives from which hook you call rather than exposing as an option). ## Extends -- `OmitKeyof`\<[`UseBaseQueryOptions`](UseBaseQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryFnData`, `TQueryKey`\>, `"suspense"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`UseBaseQueryOptions`](UseBaseQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryFnData`, `TQueryKey`\>, `"suspense"`\> ## Type Parameters @@ -22,7 +22,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. @@ -35,19 +35,586 @@ The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` when ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. ## Properties +### enabled? + +```ts +optional enabled: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.enabled +``` + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`gcTime`](QueryOptions.md#gctime) + +*** + +### initialData? + +```ts +optional initialData: + | TQueryFnData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +OmitKeyof.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +OmitKeyof.initialDataUpdatedAt +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`maxPages`](QueryOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`meta`](QueryOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`networkMode`](QueryOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister()? + +```ts +optional persister: (queryFn, context, query) => TQueryFnData | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Parameters + +##### queryFn + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TQueryFnData`, `NoInfer`\<`TQueryKey`\>, `never`\> + +##### context + +###### client + +[`QueryClient`](../classes/QueryClient.md) + +###### direction? + +`unknown` + +**Deprecated** + +if you want access to the direction, you can add it to the pageParam + +###### meta + +`Record`\<`string`, `unknown`\> \| `undefined` + +###### pageParam? + +`unknown` + +###### queryKey + +`NoInfer`\<`TQueryKey`\> + +###### signal + +`AbortSignal` + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`TQueryFnData` \| `Promise`\<`TQueryFnData`\> + +#### Inherited from + +```ts +OmitKeyof.persister +``` + +*** + +### placeholderData? + +```ts +optional placeholderData: + | NonFunctionGuard +| PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +```ts +OmitKeyof.placeholderData +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +OmitKeyof.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`queryHash`](QueryOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +OmitKeyof.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +OmitKeyof.queryKeyHashFn +``` + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchInterval +``` + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnMount +``` + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnReconnect +``` + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnWindowFocus +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.retryOnMount +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryFnData` + +#### Returns + +`TData` + +#### Inherited from + +```ts +OmitKeyof.select +``` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +```ts +OmitKeyof.staleTime +``` + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.structuralSharing +``` + +*** + ### subscribed? ```ts optional subscribed: boolean; ``` -Defined in: [preact-query/src/types.ts:64](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L64) +Defined in: [packages/preact-query/src/types.ts:64](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L64) Set this to `false` to unsubscribe this observer from updates to the query cache. @@ -62,3 +629,25 @@ true ```ts OmitKeyof.subscribed ``` + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.throwOnError +``` diff --git a/docs/framework/preact/reference/interfaces/UseSuspenseInfiniteQueryOptions.md b/docs/framework/preact/reference/interfaces/UseSuspenseInfiniteQueryOptions.md index 123b9f4e2b3..51692370924 100644 --- a/docs/framework/preact/reference/interfaces/UseSuspenseInfiniteQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/UseSuspenseInfiniteQueryOptions.md @@ -3,7 +3,7 @@ id: UseSuspenseInfiniteQueryOptions title: UseSuspenseInfiniteQueryOptions --- -Defined in: [preact-query/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L279) +Defined in: [packages/preact-query/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L279) The options accepted by `useSuspenseInfiniteQuery`. Same as [UseInfiniteQueryOptions](UseInfiniteQueryOptions.md), minus `enabled`, `throwOnError`, and `placeholderData` — Suspense hooks cannot render a "disabled" or "placeholder" state, so @@ -11,7 +11,7 @@ those options don't apply. ## Extends -- `OmitKeyof`\<[`UseInfiniteQueryOptions`](UseInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"queryFn"` \| `"enabled"` \| `"throwOnError"` \| `"placeholderData"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`UseInfiniteQueryOptions`](UseInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"queryFn"` \| `"enabled"` \| `"throwOnError"` \| `"placeholderData"`\> ## Type Parameters @@ -23,20 +23,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. @@ -48,26 +48,538 @@ The type of the parameter passed to `queryFn` to fetch a given page. ## Properties +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`gcTime`](QueryOptions.md#gctime) + +*** + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +#### Inherited from + +```ts +OmitKeyof.getNextPageParam +``` + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +#### Inherited from + +```ts +OmitKeyof.getPreviousPageParam +``` + +*** + +### initialData? + +```ts +optional initialData: + | InfiniteData +| InitialDataFunction>; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +OmitKeyof.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +OmitKeyof.initialDataUpdatedAt +``` + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +```ts +OmitKeyof.initialPageParam +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`maxPages`](QueryOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`meta`](QueryOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`networkMode`](QueryOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +OmitKeyof.persister +``` + +*** + ### queryFn? ```ts optional queryFn: QueryFunction; ``` -Defined in: [preact-query/src/types.ts:293](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L293) +Defined in: [packages/preact-query/src/types.ts:293](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L293) `skipToken` is not allowed here — Suspense hooks cannot render a "disabled" state, so a query function must always be provided, unless a default query function has been defined. *** +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`queryHash`](QueryOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +OmitKeyof.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +OmitKeyof.queryKeyHashFn +``` + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchInterval +``` + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnMount +``` + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnReconnect +``` + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnWindowFocus +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.retryOnMount +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +[`InfiniteData`](InfiniteData.md) + +#### Returns + +`TData` + +#### Inherited from + +```ts +OmitKeyof.select +``` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +```ts +OmitKeyof.staleTime +``` + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.structuralSharing +``` + +*** + ### subscribed? ```ts optional subscribed: boolean; ``` -Defined in: [preact-query/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L258) +Defined in: [packages/preact-query/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L258) Set this to `false` to unsubscribe this observer from updates to the query cache. diff --git a/docs/framework/preact/reference/interfaces/UseSuspenseQueryOptions.md b/docs/framework/preact/reference/interfaces/UseSuspenseQueryOptions.md index d3534bfb060..bbe163863e6 100644 --- a/docs/framework/preact/reference/interfaces/UseSuspenseQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/UseSuspenseQueryOptions.md @@ -3,7 +3,7 @@ id: UseSuspenseQueryOptions title: UseSuspenseQueryOptions --- -Defined in: [preact-query/src/types.ts:195](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L195) +Defined in: [packages/preact-query/src/types.ts:195](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L195) The options accepted by `useSuspenseQuery`. Same as [UseQueryOptions](UseQueryOptions.md), minus `enabled`, `throwOnError`, and `placeholderData` — Suspense hooks cannot render a "disabled" or "placeholder" state, so those options @@ -11,7 +11,7 @@ don't apply. ## Extends -- `OmitKeyof`\<[`UseQueryOptions`](UseQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\>, `"queryFn"` \| `"enabled"` \| `"throwOnError"` \| `"placeholderData"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`UseQueryOptions`](UseQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\>, `"queryFn"` \| `"enabled"` \| `"throwOnError"` \| `"placeholderData"`\> ## Type Parameters @@ -23,7 +23,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. @@ -36,32 +36,534 @@ The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` when ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. ## Properties +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`gcTime`](QueryOptions.md#gctime) + +*** + +### initialData? + +```ts +optional initialData: + | TQueryFnData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +OmitKeyof.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +OmitKeyof.initialDataUpdatedAt +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`maxPages`](QueryOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`meta`](QueryOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`networkMode`](QueryOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister()? + +```ts +optional persister: (queryFn, context, query) => TQueryFnData | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Parameters + +##### queryFn + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TQueryFnData`, `NoInfer`\<`TQueryKey`\>, `never`\> + +##### context + +###### client + +[`QueryClient`](../classes/QueryClient.md) + +###### direction? + +`unknown` + +**Deprecated** + +if you want access to the direction, you can add it to the pageParam + +###### meta + +`Record`\<`string`, `unknown`\> \| `undefined` + +###### pageParam? + +`unknown` + +###### queryKey + +`NoInfer`\<`TQueryKey`\> + +###### signal + +`AbortSignal` + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`TQueryFnData` \| `Promise`\<`TQueryFnData`\> + +#### Inherited from + +```ts +OmitKeyof.persister +``` + +*** + ### queryFn? ```ts optional queryFn: QueryFunction; ``` -Defined in: [preact-query/src/types.ts:208](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L208) +Defined in: [packages/preact-query/src/types.ts:208](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L208) `skipToken` is not allowed here — Suspense hooks cannot render a "disabled" state, so a query function must always be provided, unless a default query function has been defined. *** +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`queryHash`](QueryOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +OmitKeyof.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +OmitKeyof.queryKeyHashFn +``` + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchInterval +``` + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnMount +``` + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnReconnect +``` + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnWindowFocus +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.retryOnMount +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryFnData` + +#### Returns + +`TData` + +#### Inherited from + +```ts +OmitKeyof.select +``` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +```ts +OmitKeyof.staleTime +``` + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.structuralSharing +``` + +*** + ### subscribed? ```ts optional subscribed: boolean; ``` -Defined in: [preact-query/src/types.ts:64](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L64) +Defined in: [packages/preact-query/src/types.ts:64](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L64) Set this to `false` to unsubscribe this observer from updates to the query cache. diff --git a/docs/framework/preact/reference/type-aliases/AnyDataTag.md b/docs/framework/preact/reference/type-aliases/AnyDataTag.md new file mode 100644 index 00000000000..d3d5e33bb3e --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/AnyDataTag.md @@ -0,0 +1,30 @@ +--- +id: AnyDataTag +title: AnyDataTag +--- + +```ts +type AnyDataTag = object; +``` + +Defined in: [packages/query-core/src/types.ts:67](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L67) + +## Properties + +### \[dataTagErrorSymbol\] + +```ts +[dataTagErrorSymbol]: any; +``` + +Defined in: [packages/query-core/src/types.ts:69](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L69) + +*** + +### \[dataTagSymbol\] + +```ts +[dataTagSymbol]: any; +``` + +Defined in: [packages/query-core/src/types.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L68) diff --git a/docs/framework/preact/reference/type-aliases/AnyUseBaseQueryOptions.md b/docs/framework/preact/reference/type-aliases/AnyUseBaseQueryOptions.md index a0afa87f3e1..0f9329e5a86 100644 --- a/docs/framework/preact/reference/type-aliases/AnyUseBaseQueryOptions.md +++ b/docs/framework/preact/reference/type-aliases/AnyUseBaseQueryOptions.md @@ -7,7 +7,7 @@ title: AnyUseBaseQueryOptions type AnyUseBaseQueryOptions = UseBaseQueryOptions; ``` -Defined in: [preact-query/src/types.ts:27](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L27) +Defined in: [packages/preact-query/src/types.ts:27](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L27) [UseBaseQueryOptions](../interfaces/UseBaseQueryOptions.md) with all type parameters set to `any`, useful when the specific types aren't relevant, e.g. when accepting options for any query in a helper function. diff --git a/docs/framework/preact/reference/type-aliases/AnyUseInfiniteQueryOptions.md b/docs/framework/preact/reference/type-aliases/AnyUseInfiniteQueryOptions.md index 64a50dc5b0b..5d76b7c671d 100644 --- a/docs/framework/preact/reference/type-aliases/AnyUseInfiniteQueryOptions.md +++ b/docs/framework/preact/reference/type-aliases/AnyUseInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: AnyUseInfiniteQueryOptions type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions; ``` -Defined in: [preact-query/src/types.ts:218](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L218) +Defined in: [packages/preact-query/src/types.ts:218](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L218) [UseInfiniteQueryOptions](../interfaces/UseInfiniteQueryOptions.md) with all type parameters set to `any`, useful when the specific types aren't relevant, e.g. when accepting options for any query in a helper function. diff --git a/docs/framework/preact/reference/type-aliases/AnyUseMutationOptions.md b/docs/framework/preact/reference/type-aliases/AnyUseMutationOptions.md index d0f9eb8c2e4..7afacd10bc7 100644 --- a/docs/framework/preact/reference/type-aliases/AnyUseMutationOptions.md +++ b/docs/framework/preact/reference/type-aliases/AnyUseMutationOptions.md @@ -7,7 +7,7 @@ title: AnyUseMutationOptions type AnyUseMutationOptions = UseMutationOptions; ``` -Defined in: [preact-query/src/types.ts:400](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L400) +Defined in: [packages/preact-query/src/types.ts:400](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L400) [UseMutationOptions](../interfaces/UseMutationOptions.md) with all type parameters set to `any`, useful when the specific types aren't relevant, e.g. when accepting options for any mutation in a helper function. diff --git a/docs/framework/preact/reference/type-aliases/AnyUseQueryOptions.md b/docs/framework/preact/reference/type-aliases/AnyUseQueryOptions.md index ebc8ca98c68..bf120153f81 100644 --- a/docs/framework/preact/reference/type-aliases/AnyUseQueryOptions.md +++ b/docs/framework/preact/reference/type-aliases/AnyUseQueryOptions.md @@ -7,7 +7,7 @@ title: AnyUseQueryOptions type AnyUseQueryOptions = UseQueryOptions; ``` -Defined in: [preact-query/src/types.ts:153](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L153) +Defined in: [packages/preact-query/src/types.ts:153](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L153) [UseQueryOptions](../interfaces/UseQueryOptions.md) with all type parameters set to `any`, useful when the specific types aren't relevant, e.g. when accepting options for any query in a helper function. diff --git a/docs/framework/preact/reference/type-aliases/AnyUseSuspenseInfiniteQueryOptions.md b/docs/framework/preact/reference/type-aliases/AnyUseSuspenseInfiniteQueryOptions.md index 61db42561ae..92b60ec7591 100644 --- a/docs/framework/preact/reference/type-aliases/AnyUseSuspenseInfiniteQueryOptions.md +++ b/docs/framework/preact/reference/type-aliases/AnyUseSuspenseInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: AnyUseSuspenseInfiniteQueryOptions type AnyUseSuspenseInfiniteQueryOptions = UseSuspenseInfiniteQueryOptions; ``` -Defined in: [preact-query/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L265) +Defined in: [packages/preact-query/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L265) [UseSuspenseInfiniteQueryOptions](../interfaces/UseSuspenseInfiniteQueryOptions.md) with all type parameters set to `any`, useful when the specific types aren't relevant, e.g. when accepting options for any query in a helper function. diff --git a/docs/framework/preact/reference/type-aliases/AnyUseSuspenseQueryOptions.md b/docs/framework/preact/reference/type-aliases/AnyUseSuspenseQueryOptions.md index 017114a5290..6bf0ce0703b 100644 --- a/docs/framework/preact/reference/type-aliases/AnyUseSuspenseQueryOptions.md +++ b/docs/framework/preact/reference/type-aliases/AnyUseSuspenseQueryOptions.md @@ -7,7 +7,7 @@ title: AnyUseSuspenseQueryOptions type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions; ``` -Defined in: [preact-query/src/types.ts:178](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L178) +Defined in: [packages/preact-query/src/types.ts:178](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L178) [UseSuspenseQueryOptions](../interfaces/UseSuspenseQueryOptions.md) with all type parameters set to `any`, useful when the specific types aren't relevant, e.g. when accepting options for any query in a helper function. diff --git a/docs/framework/preact/reference/type-aliases/DataTag.md b/docs/framework/preact/reference/type-aliases/DataTag.md new file mode 100644 index 00000000000..904ca124464 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/DataTag.md @@ -0,0 +1,24 @@ +--- +id: DataTag +title: DataTag +--- + +```ts +type DataTag = TType extends AnyDataTag ? TType : TType & object; +``` + +Defined in: [packages/query-core/src/types.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L71) + +## Type Parameters + +### TType + +`TType` + +### TValue + +`TValue` + +### TError + +`TError` = [`UnsetMarker`](UnsetMarker.md) diff --git a/docs/framework/preact/reference/type-aliases/DefaultError.md b/docs/framework/preact/reference/type-aliases/DefaultError.md new file mode 100644 index 00000000000..da9f615482f --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/DefaultError.md @@ -0,0 +1,10 @@ +--- +id: DefaultError +title: DefaultError +--- + +```ts +type DefaultError = Register extends object ? TError : Error; +``` + +Defined in: [packages/query-core/src/types.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L45) diff --git a/docs/framework/preact/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/preact/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md new file mode 100644 index 00000000000..733a1a5ad75 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -0,0 +1,32 @@ +--- +id: DefaultedInfiniteQueryObserverOptions +title: DefaultedInfiniteQueryObserverOptions +--- + +```ts +type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; +``` + +Defined in: [packages/query-core/src/types.ts:538](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L538) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` diff --git a/docs/framework/preact/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/preact/reference/type-aliases/DefaultedQueryObserverOptions.md new file mode 100644 index 00000000000..1b4309f150c --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -0,0 +1,32 @@ +--- +id: DefaultedQueryObserverOptions +title: DefaultedQueryObserverOptions +--- + +```ts +type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; +``` + +Defined in: [packages/query-core/src/types.ts:509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L509) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult.md new file mode 100644 index 00000000000..ced8e568299 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -0,0 +1,22 @@ +--- +id: DefinedInfiniteQueryObserverResult +title: DefinedInfiniteQueryObserverResult +--- + +```ts +type DefinedInfiniteQueryObserverResult = + | InfiniteQueryObserverRefetchErrorResult +| InfiniteQueryObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/preact/reference/type-aliases/DefinedInitialDataInfiniteOptions.md b/docs/framework/preact/reference/type-aliases/DefinedInitialDataInfiniteOptions.md index 6847a19a143..51b78d85c96 100644 --- a/docs/framework/preact/reference/type-aliases/DefinedInitialDataInfiniteOptions.md +++ b/docs/framework/preact/reference/type-aliases/DefinedInitialDataInfiniteOptions.md @@ -7,7 +7,7 @@ title: DefinedInitialDataInfiniteOptions type DefinedInitialDataInfiniteOptions = UseInfiniteQueryOptions & object; ``` -Defined in: [preact-query/src/infiniteQueryOptions.ts:104](https://github.com/TanStack/query/blob/main/packages/preact-query/src/infiniteQueryOptions.ts#L104) +Defined in: [packages/preact-query/src/infiniteQueryOptions.ts:104](https://github.com/TanStack/query/blob/main/packages/preact-query/src/infiniteQueryOptions.ts#L104) The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is set — `data` is never `undefined`. @@ -39,20 +39,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/preact/reference/type-aliases/DefinedInitialDataOptions.md b/docs/framework/preact/reference/type-aliases/DefinedInitialDataOptions.md index e365ec00646..5187c08ab47 100644 --- a/docs/framework/preact/reference/type-aliases/DefinedInitialDataOptions.md +++ b/docs/framework/preact/reference/type-aliases/DefinedInitialDataOptions.md @@ -7,7 +7,7 @@ title: DefinedInitialDataOptions type DefinedInitialDataOptions = Omit, "queryFn"> & object; ``` -Defined in: [preact-query/src/queryOptions.ts:81](https://github.com/TanStack/query/blob/main/packages/preact-query/src/queryOptions.ts#L81) +Defined in: [packages/preact-query/src/queryOptions.ts:81](https://github.com/TanStack/query/blob/main/packages/preact-query/src/queryOptions.ts#L81) The options accepted by the `queryOptions` overload selected when `initialData` is set — `data` is never `undefined`. @@ -48,7 +48,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -60,6 +60,6 @@ The type `data` ends up as after `select` runs. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/preact/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/preact/reference/type-aliases/DefinedQueryObserverResult.md new file mode 100644 index 00000000000..7afdbfd38bc --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/DefinedQueryObserverResult.md @@ -0,0 +1,22 @@ +--- +id: DefinedQueryObserverResult +title: DefinedQueryObserverResult +--- + +```ts +type DefinedQueryObserverResult = + | QueryObserverRefetchErrorResult +| QueryObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/preact/reference/type-aliases/DefinedUseInfiniteQueryResult.md b/docs/framework/preact/reference/type-aliases/DefinedUseInfiniteQueryResult.md index 93ed3177ecf..6c97c2285aa 100644 --- a/docs/framework/preact/reference/type-aliases/DefinedUseInfiniteQueryResult.md +++ b/docs/framework/preact/reference/type-aliases/DefinedUseInfiniteQueryResult.md @@ -7,10 +7,10 @@ title: DefinedUseInfiniteQueryResult type DefinedUseInfiniteQueryResult = DefinedInfiniteQueryObserverResult; ``` -Defined in: [preact-query/src/types.ts:376](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L376) +Defined in: [packages/preact-query/src/types.ts:376](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L376) The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined`. Re-exports -DefinedInfiniteQueryObserverResult from `@tanstack/query-core`. +[DefinedInfiniteQueryObserverResult](DefinedInfiniteQueryObserverResult.md) from `@tanstack/query-core`. ## Type Parameters @@ -22,6 +22,6 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. diff --git a/docs/framework/preact/reference/type-aliases/DefinedUseQueryResult.md b/docs/framework/preact/reference/type-aliases/DefinedUseQueryResult.md index c467e0dca24..4f9f9fdfb25 100644 --- a/docs/framework/preact/reference/type-aliases/DefinedUseQueryResult.md +++ b/docs/framework/preact/reference/type-aliases/DefinedUseQueryResult.md @@ -7,10 +7,10 @@ title: DefinedUseQueryResult type DefinedUseQueryResult = DefinedQueryObserverResult; ``` -Defined in: [preact-query/src/types.ts:352](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L352) +Defined in: [packages/preact-query/src/types.ts:352](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L352) The result of `useQuery` when `initialData` is set, or of `useSuspenseQuery` before the `isPlaceholderData` -omission — `data` is never `undefined`. Re-exports DefinedQueryObserverResult from +omission — `data` is never `undefined`. Re-exports [DefinedQueryObserverResult](DefinedQueryObserverResult.md) from `@tanstack/query-core`. ## Type Parameters @@ -23,6 +23,6 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. diff --git a/docs/framework/preact/reference/type-aliases/DistributiveOmit.md b/docs/framework/preact/reference/type-aliases/DistributiveOmit.md new file mode 100644 index 00000000000..33b87a5cd6e --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/DistributiveOmit.md @@ -0,0 +1,20 @@ +--- +id: DistributiveOmit +title: DistributiveOmit +--- + +```ts +type DistributiveOmit = TObject extends any ? Omit : never; +``` + +Defined in: [packages/query-core/src/types.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L14) + +## Type Parameters + +### TObject + +`TObject` + +### TKey + +`TKey` *extends* keyof `TObject` diff --git a/docs/framework/preact/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/preact/reference/type-aliases/EnsureInfiniteQueryDataOptions.md new file mode 100644 index 00000000000..305eef94893 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -0,0 +1,42 @@ +--- +id: EnsureInfiniteQueryDataOptions +title: EnsureInfiniteQueryDataOptions +--- + +```ts +type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; +``` + +Defined in: [packages/query-core/src/types.ts:612](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L612) + +## Type Declaration + +### ~~revalidateIfStale?~~ + +```ts +optional revalidateIfStale: boolean; +``` + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Deprecated diff --git a/docs/framework/preact/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/preact/reference/type-aliases/FetchInfiniteQueryOptions.md new file mode 100644 index 00000000000..1ee1470b14a --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -0,0 +1,34 @@ +--- +id: FetchInfiniteQueryOptions +title: FetchInfiniteQueryOptions +--- + +```ts +type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; +``` + +Defined in: [packages/query-core/src/types.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L656) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Deprecated diff --git a/docs/framework/preact/reference/type-aliases/FetchStatus.md b/docs/framework/preact/reference/type-aliases/FetchStatus.md new file mode 100644 index 00000000000..4dae9444af6 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/FetchStatus.md @@ -0,0 +1,10 @@ +--- +id: FetchStatus +title: FetchStatus +--- + +```ts +type FetchStatus = "fetching" | "paused" | "idle"; +``` + +Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) diff --git a/docs/framework/preact/reference/type-aliases/GetNextPageParamFunction.md b/docs/framework/preact/reference/type-aliases/GetNextPageParamFunction.md new file mode 100644 index 00000000000..81d1a1544ab --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/GetNextPageParamFunction.md @@ -0,0 +1,42 @@ +--- +id: GetNextPageParamFunction +title: GetNextPageParamFunction +--- + +```ts +type GetNextPageParamFunction = (lastPage, allPages, lastPageParam, allPageParams) => TPageParam | undefined | null; +``` + +Defined in: [packages/query-core/src/types.ts:203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L203) + +## Type Parameters + +### TPageParam + +`TPageParam` + +### TQueryFnData + +`TQueryFnData` = `unknown` + +## Parameters + +### lastPage + +`TQueryFnData` + +### allPages + +`TQueryFnData`[] + +### lastPageParam + +`TPageParam` + +### allPageParams + +`TPageParam`[] + +## Returns + +`TPageParam` \| `undefined` \| `null` diff --git a/docs/framework/preact/reference/type-aliases/GetPreviousPageParamFunction.md b/docs/framework/preact/reference/type-aliases/GetPreviousPageParamFunction.md new file mode 100644 index 00000000000..5a6d9b93d7e --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/GetPreviousPageParamFunction.md @@ -0,0 +1,42 @@ +--- +id: GetPreviousPageParamFunction +title: GetPreviousPageParamFunction +--- + +```ts +type GetPreviousPageParamFunction = (firstPage, allPages, firstPageParam, allPageParams) => TPageParam | undefined | null; +``` + +Defined in: [packages/query-core/src/types.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L196) + +## Type Parameters + +### TPageParam + +`TPageParam` + +### TQueryFnData + +`TQueryFnData` = `unknown` + +## Parameters + +### firstPage + +`TQueryFnData` + +### allPages + +`TQueryFnData`[] + +### firstPageParam + +`TPageParam` + +### allPageParams + +`TPageParam`[] + +## Returns + +`TPageParam` \| `undefined` \| `null` diff --git a/docs/framework/preact/reference/type-aliases/InferDataFromTag.md b/docs/framework/preact/reference/type-aliases/InferDataFromTag.md new file mode 100644 index 00000000000..09a15ca4b1c --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/InferDataFromTag.md @@ -0,0 +1,20 @@ +--- +id: InferDataFromTag +title: InferDataFromTag +--- + +```ts +type InferDataFromTag = TTaggedQueryKey extends DataTag ? TaggedValue : TQueryFnData; +``` + +Defined in: [packages/query-core/src/types.ts:90](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L90) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` + +### TTaggedQueryKey + +`TTaggedQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/preact/reference/type-aliases/InferErrorFromTag.md b/docs/framework/preact/reference/type-aliases/InferErrorFromTag.md new file mode 100644 index 00000000000..cd94e4b5c3f --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/InferErrorFromTag.md @@ -0,0 +1,20 @@ +--- +id: InferErrorFromTag +title: InferErrorFromTag +--- + +```ts +type InferErrorFromTag = TTaggedQueryKey extends DataTag ? TaggedError extends UnsetMarker ? TError : TaggedError : TError; +``` + +Defined in: [packages/query-core/src/types.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L95) + +## Type Parameters + +### TError + +`TError` + +### TTaggedQueryKey + +`TTaggedQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/preact/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/preact/reference/type-aliases/InfiniteQueryExecuteOptions.md new file mode 100644 index 00000000000..29c974cfddf --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -0,0 +1,32 @@ +--- +id: InfiniteQueryExecuteOptions +title: InfiniteQueryExecuteOptions +--- + +```ts +type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; +``` + +Defined in: [packages/query-core/src/types.ts:635](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L635) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` diff --git a/docs/framework/preact/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/preact/reference/type-aliases/InfiniteQueryObserverResult.md new file mode 100644 index 00000000000..95fda780d1d --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/InfiniteQueryObserverResult.md @@ -0,0 +1,25 @@ +--- +id: InfiniteQueryObserverResult +title: InfiniteQueryObserverResult +--- + +```ts +type InfiniteQueryObserverResult = + | DefinedInfiniteQueryObserverResult + | InfiniteQueryObserverLoadingErrorResult + | InfiniteQueryObserverLoadingResult + | InfiniteQueryObserverPendingResult +| InfiniteQueryObserverPlaceholderResult; +``` + +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/preact/reference/type-aliases/InitialDataFunction.md b/docs/framework/preact/reference/type-aliases/InitialDataFunction.md new file mode 100644 index 00000000000..6ba4aaabe61 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/InitialDataFunction.md @@ -0,0 +1,20 @@ +--- +id: InitialDataFunction +title: InitialDataFunction +--- + +```ts +type InitialDataFunction = () => T | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L173) + +## Type Parameters + +### T + +`T` + +## Returns + +`T` \| `undefined` diff --git a/docs/framework/preact/reference/type-aliases/ManagedTimerId.md b/docs/framework/preact/reference/type-aliases/ManagedTimerId.md new file mode 100644 index 00000000000..d7833e3e4f0 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/ManagedTimerId.md @@ -0,0 +1,19 @@ +--- +id: ManagedTimerId +title: ManagedTimerId +--- + +```ts +type ManagedTimerId = + | number + | { + [toPrimitive]: () => number; +}; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:17](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L17) + +Wrapping `setTimeout` is awkward from a typing perspective because platform +typings may extend the return type of `setTimeout`. For example, NodeJS +typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be +able to return such a type. diff --git a/docs/framework/preact/reference/type-aliases/MutateFunction.md b/docs/framework/preact/reference/type-aliases/MutateFunction.md new file mode 100644 index 00000000000..f574ca7f8ca --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/MutateFunction.md @@ -0,0 +1,38 @@ +--- +id: MutateFunction +title: MutateFunction +--- + +```ts +type MutateFunction = (...rest) => Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1258) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Parameters + +### rest + +...[`MutateFunctionRest`](MutateFunctionRest.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Returns + +`Promise`\<`TData`\> diff --git a/docs/framework/preact/reference/type-aliases/MutateFunctionRest.md b/docs/framework/preact/reference/type-aliases/MutateFunctionRest.md new file mode 100644 index 00000000000..aef21572aeb --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/MutateFunctionRest.md @@ -0,0 +1,28 @@ +--- +id: MutateFunctionRest +title: MutateFunctionRest +--- + +```ts +type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; +``` + +Defined in: [packages/query-core/src/types.ts:1243](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1243) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` diff --git a/docs/framework/preact/reference/type-aliases/MutationCacheNotifyEvent.md b/docs/framework/preact/reference/type-aliases/MutationCacheNotifyEvent.md new file mode 100644 index 00000000000..aa5e196bc72 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/MutationCacheNotifyEvent.md @@ -0,0 +1,20 @@ +--- +id: MutationCacheNotifyEvent +title: MutationCacheNotifyEvent +--- + +```ts +type MutationCacheNotifyEvent = + | NotifyEventMutationAdded + | NotifyEventMutationRemoved + | NotifyEventMutationObserverAdded + | NotifyEventMutationObserverRemoved + | NotifyEventMutationObserverOptionsUpdated + | NotifyEventMutationUpdated; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L98) + +The event passed to a `MutationCache` subscriber. Fired whenever a mutation is added or removed +from the cache, its state is updated, or one of its observers is added, removed, or has its +options updated. diff --git a/docs/framework/preact/reference/type-aliases/MutationFunction.md b/docs/framework/preact/reference/type-aliases/MutationFunction.md new file mode 100644 index 00000000000..e306a5f1a48 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/MutationFunction.md @@ -0,0 +1,34 @@ +--- +id: MutationFunction +title: MutationFunction +--- + +```ts +type MutationFunction = (variables, context) => Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1161](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1161) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TVariables + +`TVariables` = `unknown` + +## Parameters + +### variables + +`TVariables` + +### context + +[`MutationFunctionContext`](MutationFunctionContext.md) + +## Returns + +`Promise`\<`TData`\> diff --git a/docs/framework/preact/reference/type-aliases/MutationFunctionContext.md b/docs/framework/preact/reference/type-aliases/MutationFunctionContext.md new file mode 100644 index 00000000000..b29a54df298 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/MutationFunctionContext.md @@ -0,0 +1,40 @@ +--- +id: MutationFunctionContext +title: MutationFunctionContext +--- + +```ts +type MutationFunctionContext = object; +``` + +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) + +## Properties + +### client + +```ts +client: QueryClient; +``` + +Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) + +*** + +### meta + +```ts +meta: MutationMeta | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) + +*** + +### mutationKey? + +```ts +optional mutationKey: MutationKey; +``` + +Defined in: [packages/query-core/src/types.ts:1158](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1158) diff --git a/docs/framework/preact/reference/type-aliases/MutationKey.md b/docs/framework/preact/reference/type-aliases/MutationKey.md new file mode 100644 index 00000000000..f89c6959883 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/MutationKey.md @@ -0,0 +1,10 @@ +--- +id: MutationKey +title: MutationKey +--- + +```ts +type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; +``` + +Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) diff --git a/docs/framework/preact/reference/type-aliases/MutationMeta.md b/docs/framework/preact/reference/type-aliases/MutationMeta.md new file mode 100644 index 00000000000..e1d481cdcf1 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/MutationMeta.md @@ -0,0 +1,10 @@ +--- +id: MutationMeta +title: MutationMeta +--- + +```ts +type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; +``` + +Defined in: [packages/query-core/src/types.ts:1147](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1147) diff --git a/docs/framework/preact/reference/type-aliases/MutationObserverResult.md b/docs/framework/preact/reference/type-aliases/MutationObserverResult.md new file mode 100644 index 00000000000..cbd07f40537 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/MutationObserverResult.md @@ -0,0 +1,32 @@ +--- +id: MutationObserverResult +title: MutationObserverResult +--- + +```ts +type MutationObserverResult = + | MutationObserverIdleResult + | MutationObserverLoadingResult + | MutationObserverErrorResult +| MutationObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` diff --git a/docs/framework/preact/reference/type-aliases/MutationScope.md b/docs/framework/preact/reference/type-aliases/MutationScope.md new file mode 100644 index 00000000000..6ec14643477 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/MutationScope.md @@ -0,0 +1,20 @@ +--- +id: MutationScope +title: MutationScope +--- + +```ts +type MutationScope = object; +``` + +Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) + +## Properties + +### id + +```ts +id: string; +``` + +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) diff --git a/docs/framework/preact/reference/type-aliases/MutationStatus.md b/docs/framework/preact/reference/type-aliases/MutationStatus.md new file mode 100644 index 00000000000..eedf0fb979a --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/MutationStatus.md @@ -0,0 +1,10 @@ +--- +id: MutationStatus +title: MutationStatus +--- + +```ts +type MutationStatus = "idle" | "pending" | "success" | "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) diff --git a/docs/framework/preact/reference/type-aliases/NetworkMode.md b/docs/framework/preact/reference/type-aliases/NetworkMode.md new file mode 100644 index 00000000000..94ae0ba76ed --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/NetworkMode.md @@ -0,0 +1,10 @@ +--- +id: NetworkMode +title: NetworkMode +--- + +```ts +type NetworkMode = "online" | "always" | "offlineFirst"; +``` + +Defined in: [packages/query-core/src/types.ts:223](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L223) diff --git a/docs/framework/preact/reference/type-aliases/NonUndefinedGuard.md b/docs/framework/preact/reference/type-aliases/NonUndefinedGuard.md new file mode 100644 index 00000000000..4aaf208013b --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/NonUndefinedGuard.md @@ -0,0 +1,16 @@ +--- +id: NonUndefinedGuard +title: NonUndefinedGuard +--- + +```ts +type NonUndefinedGuard = T extends undefined ? never : T; +``` + +Defined in: [packages/query-core/src/types.ts:12](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L12) + +## Type Parameters + +### T + +`T` diff --git a/docs/framework/preact/reference/type-aliases/NotifyEventType.md b/docs/framework/preact/reference/type-aliases/NotifyEventType.md new file mode 100644 index 00000000000..7b788ced7af --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/NotifyEventType.md @@ -0,0 +1,17 @@ +--- +id: NotifyEventType +title: NotifyEventType +--- + +```ts +type NotifyEventType = + | "added" + | "removed" + | "updated" + | "observerAdded" + | "observerRemoved" + | "observerResultsUpdated" + | "observerOptionsUpdated"; +``` + +Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) diff --git a/docs/framework/preact/reference/type-aliases/NotifyOnChangeProps.md b/docs/framework/preact/reference/type-aliases/NotifyOnChangeProps.md new file mode 100644 index 00000000000..7de194fa10b --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/NotifyOnChangeProps.md @@ -0,0 +1,17 @@ +--- +id: NotifyOnChangeProps +title: NotifyOnChangeProps +--- + +```ts +type NotifyOnChangeProps = + | keyof InfiniteQueryObserverResult[] + | "all" + | undefined + | () => + | keyof InfiniteQueryObserverResult[] + | "all" + | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L225) diff --git a/docs/framework/preact/reference/type-aliases/OmitKeyof.md b/docs/framework/preact/reference/type-aliases/OmitKeyof.md new file mode 100644 index 00000000000..690a7b0a5d2 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/OmitKeyof.md @@ -0,0 +1,28 @@ +--- +id: OmitKeyof +title: OmitKeyof +--- + +```ts +type OmitKeyof = Omit; +``` + +Defined in: [packages/query-core/src/types.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L19) + +## Type Parameters + +### TObject + +`TObject` + +### TKey + +`TKey` *extends* `TStrictly` *extends* `"safely"` ? + \| keyof `TObject` + \| `string` & `Record`\<`never`, `never`\> + \| `number` & `Record`\<`never`, `never`\> + \| `symbol` & `Record`\<`never`, `never`\> : keyof `TObject` + +### TStrictly + +`TStrictly` *extends* `"strictly"` \| `"safely"` = `"strictly"` diff --git a/docs/framework/preact/reference/type-aliases/Override.md b/docs/framework/preact/reference/type-aliases/Override.md new file mode 100644 index 00000000000..8abcecd1e1b --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/Override.md @@ -0,0 +1,20 @@ +--- +id: Override +title: Override +--- + +```ts +type Override = { [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey] }; +``` + +Defined in: [packages/query-core/src/types.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L31) + +## Type Parameters + +### TTargetA + +`TTargetA` + +### TTargetB + +`TTargetB` diff --git a/docs/framework/preact/reference/type-aliases/PlaceholderDataFunction.md b/docs/framework/preact/reference/type-aliases/PlaceholderDataFunction.md new file mode 100644 index 00000000000..cd40f28b41e --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/PlaceholderDataFunction.md @@ -0,0 +1,42 @@ +--- +id: PlaceholderDataFunction +title: PlaceholderDataFunction +--- + +```ts +type PlaceholderDataFunction = (previousData, previousQuery) => TQueryData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:177](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L177) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +## Parameters + +### previousData + +`TQueryData` | `undefined` + +### previousQuery + +[`Query`](../classes/Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> | `undefined` + +## Returns + +`TQueryData` \| `undefined` diff --git a/docs/framework/preact/reference/type-aliases/QueriesOptions.md b/docs/framework/preact/reference/type-aliases/QueriesOptions.md index 3ae066a07d9..e5b2da7823f 100644 --- a/docs/framework/preact/reference/type-aliases/QueriesOptions.md +++ b/docs/framework/preact/reference/type-aliases/QueriesOptions.md @@ -7,7 +7,7 @@ title: QueriesOptions type QueriesOptions = TDepth["length"] extends MAXIMUM_DEPTH ? UseQueryOptionsForUseQueries[] : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryOptionsForUseQueries] : T extends [infer Head, ...(infer Tails)] ? QueriesOptions<[...Tails], [...TResults, GetUseQueryOptionsForUseQueries], [...TDepth, 1]> : ReadonlyArray extends T ? T : T extends UseQueryOptionsForUseQueries[] ? UseQueryOptionsForUseQueries[] : UseQueryOptionsForUseQueries[]; ``` -Defined in: [preact-query/src/useQueries.ts:156](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useQueries.ts#L156) +Defined in: [packages/preact-query/src/useQueries.ts:156](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useQueries.ts#L156) The `queries` array accepted by `useQueries`. Recursively unwraps each tuple element so every entry's `queryFn`/`select`/`throwOnError` are inferred individually, up to 20 elements. An opaque array (e.g. diff --git a/docs/framework/preact/reference/type-aliases/QueriesPlaceholderDataFunction.md b/docs/framework/preact/reference/type-aliases/QueriesPlaceholderDataFunction.md new file mode 100644 index 00000000000..5d3fca8c9e0 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/QueriesPlaceholderDataFunction.md @@ -0,0 +1,30 @@ +--- +id: QueriesPlaceholderDataFunction +title: QueriesPlaceholderDataFunction +--- + +```ts +type QueriesPlaceholderDataFunction = (previousData, previousQuery) => TQueryData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L187) + +## Type Parameters + +### TQueryData + +`TQueryData` + +## Parameters + +### previousData + +`undefined` + +### previousQuery + +`undefined` + +## Returns + +`TQueryData` \| `undefined` diff --git a/docs/framework/preact/reference/type-aliases/QueriesResults.md b/docs/framework/preact/reference/type-aliases/QueriesResults.md index cfc82c12955..ab0ce69b005 100644 --- a/docs/framework/preact/reference/type-aliases/QueriesResults.md +++ b/docs/framework/preact/reference/type-aliases/QueriesResults.md @@ -7,7 +7,7 @@ title: QueriesResults type QueriesResults = TDepth["length"] extends MAXIMUM_DEPTH ? UseQueryResult[] : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryResult] : T extends [infer Head, ...(infer Tails)] ? QueriesResults<[...Tails], [...TResults, GetUseQueryResult], [...TDepth, 1]> : { [K in keyof T]: GetUseQueryResult }; ``` -Defined in: [preact-query/src/useQueries.ts:207](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useQueries.ts#L207) +Defined in: [packages/preact-query/src/useQueries.ts:207](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useQueries.ts#L207) The result type returned by `useQueries`, when no `combine` is provided. Mirrors [QueriesOptions](QueriesOptions.md): each tuple element's result type is inferred individually, up to 20 elements. A non-tuple array is mapped diff --git a/docs/framework/preact/reference/type-aliases/QueryBooleanOption.md b/docs/framework/preact/reference/type-aliases/QueryBooleanOption.md new file mode 100644 index 00000000000..9759e3ddb42 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/QueryBooleanOption.md @@ -0,0 +1,28 @@ +--- +id: QueryBooleanOption +title: QueryBooleanOption +--- + +```ts +type QueryBooleanOption = boolean | (query) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L119) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/preact/reference/type-aliases/QueryCacheNotifyEvent.md b/docs/framework/preact/reference/type-aliases/QueryCacheNotifyEvent.md new file mode 100644 index 00000000000..8e52da9e279 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/QueryCacheNotifyEvent.md @@ -0,0 +1,21 @@ +--- +id: QueryCacheNotifyEvent +title: QueryCacheNotifyEvent +--- + +```ts +type QueryCacheNotifyEvent = + | NotifyEventQueryAdded + | NotifyEventQueryRemoved + | NotifyEventQueryUpdated + | NotifyEventQueryObserverAdded + | NotifyEventQueryObserverRemoved + | NotifyEventQueryObserverResultsUpdated + | NotifyEventQueryObserverOptionsUpdated; +``` + +Defined in: [packages/query-core/src/queryCache.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L84) + +The event passed to a `QueryCache` subscriber. Fired whenever a query is added or removed from +the cache, its state is updated (e.g. via `query.setState` or `queryClient.removeQueries`), or +one of its observers is added, removed, or has its results or options updated. diff --git a/docs/framework/preact/reference/type-aliases/QueryClientProviderProps.md b/docs/framework/preact/reference/type-aliases/QueryClientProviderProps.md index c23626b16f5..ef92581d1bc 100644 --- a/docs/framework/preact/reference/type-aliases/QueryClientProviderProps.md +++ b/docs/framework/preact/reference/type-aliases/QueryClientProviderProps.md @@ -7,7 +7,7 @@ title: QueryClientProviderProps type QueryClientProviderProps = object; ``` -Defined in: [preact-query/src/QueryClientProvider.tsx:38](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryClientProvider.tsx#L38) +Defined in: [packages/preact-query/src/QueryClientProvider.tsx:38](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryClientProvider.tsx#L38) The props accepted by `QueryClientProvider`. @@ -19,7 +19,7 @@ The props accepted by `QueryClientProvider`. optional children: ComponentChildren; ``` -Defined in: [preact-query/src/QueryClientProvider.tsx:48](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryClientProvider.tsx#L48) +Defined in: [packages/preact-query/src/QueryClientProvider.tsx:48](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryClientProvider.tsx#L48) The components that get access to the provided `QueryClient`. @@ -31,7 +31,7 @@ The components that get access to the provided `QueryClient`. client: QueryClient; ``` -Defined in: [preact-query/src/QueryClientProvider.tsx:44](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryClientProvider.tsx#L44) +Defined in: [packages/preact-query/src/QueryClientProvider.tsx:44](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryClientProvider.tsx#L44) **Required** diff --git a/docs/framework/preact/reference/type-aliases/QueryErrorClearResetFunction.md b/docs/framework/preact/reference/type-aliases/QueryErrorClearResetFunction.md index d80f43bf5e8..becc826aed2 100644 --- a/docs/framework/preact/reference/type-aliases/QueryErrorClearResetFunction.md +++ b/docs/framework/preact/reference/type-aliases/QueryErrorClearResetFunction.md @@ -7,7 +7,7 @@ title: QueryErrorClearResetFunction type QueryErrorClearResetFunction = () => void; ``` -Defined in: [preact-query/src/QueryErrorResetBoundary.tsx:20](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryErrorResetBoundary.tsx#L20) +Defined in: [packages/preact-query/src/QueryErrorResetBoundary.tsx:20](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryErrorResetBoundary.tsx#L20) Clears the reset state, so queries know not to try again until the boundary is reset again. diff --git a/docs/framework/preact/reference/type-aliases/QueryErrorIsResetFunction.md b/docs/framework/preact/reference/type-aliases/QueryErrorIsResetFunction.md index c1cd3ca73e9..3504fae41ec 100644 --- a/docs/framework/preact/reference/type-aliases/QueryErrorIsResetFunction.md +++ b/docs/framework/preact/reference/type-aliases/QueryErrorIsResetFunction.md @@ -7,7 +7,7 @@ title: QueryErrorIsResetFunction type QueryErrorIsResetFunction = () => boolean; ``` -Defined in: [preact-query/src/QueryErrorResetBoundary.tsx:15](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryErrorResetBoundary.tsx#L15) +Defined in: [packages/preact-query/src/QueryErrorResetBoundary.tsx:15](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryErrorResetBoundary.tsx#L15) Returns whether the boundary has been reset and not yet cleared. diff --git a/docs/framework/preact/reference/type-aliases/QueryErrorResetBoundaryFunction.md b/docs/framework/preact/reference/type-aliases/QueryErrorResetBoundaryFunction.md index 2ed65c16cb7..0ba3184fc42 100644 --- a/docs/framework/preact/reference/type-aliases/QueryErrorResetBoundaryFunction.md +++ b/docs/framework/preact/reference/type-aliases/QueryErrorResetBoundaryFunction.md @@ -7,7 +7,7 @@ title: QueryErrorResetBoundaryFunction type QueryErrorResetBoundaryFunction = (value) => ComponentChildren; ``` -Defined in: [preact-query/src/QueryErrorResetBoundary.tsx:96](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryErrorResetBoundary.tsx#L96) +Defined in: [packages/preact-query/src/QueryErrorResetBoundary.tsx:96](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryErrorResetBoundary.tsx#L96) A render-prop function usable as `children` on `QueryErrorResetBoundary`. diff --git a/docs/framework/preact/reference/type-aliases/QueryErrorResetFunction.md b/docs/framework/preact/reference/type-aliases/QueryErrorResetFunction.md index 963e0bba8ae..311e79adf6e 100644 --- a/docs/framework/preact/reference/type-aliases/QueryErrorResetFunction.md +++ b/docs/framework/preact/reference/type-aliases/QueryErrorResetFunction.md @@ -7,7 +7,7 @@ title: QueryErrorResetFunction type QueryErrorResetFunction = () => void; ``` -Defined in: [preact-query/src/QueryErrorResetBoundary.tsx:10](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryErrorResetBoundary.tsx#L10) +Defined in: [packages/preact-query/src/QueryErrorResetBoundary.tsx:10](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryErrorResetBoundary.tsx#L10) Resets any query errors within the boundary, so queries know they can try again. diff --git a/docs/framework/preact/reference/type-aliases/QueryFunction.md b/docs/framework/preact/reference/type-aliases/QueryFunction.md new file mode 100644 index 00000000000..306367388a1 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/QueryFunction.md @@ -0,0 +1,34 @@ +--- +id: QueryFunction +title: QueryFunction +--- + +```ts +type QueryFunction = (context) => T | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L102) + +## Type Parameters + +### T + +`T` = `unknown` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Parameters + +### context + +[`QueryFunctionContext`](QueryFunctionContext.md)\<`TQueryKey`, `TPageParam`\> + +## Returns + +`T` \| `Promise`\<`T`\> diff --git a/docs/framework/preact/reference/type-aliases/QueryFunctionContext.md b/docs/framework/preact/reference/type-aliases/QueryFunctionContext.md new file mode 100644 index 00000000000..d2c9fe3e2b2 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/QueryFunctionContext.md @@ -0,0 +1,20 @@ +--- +id: QueryFunctionContext +title: QueryFunctionContext +--- + +```ts +type QueryFunctionContext = [TPageParam] extends [never] ? object : object; +``` + +Defined in: [packages/query-core/src/types.ts:144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L144) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` diff --git a/docs/framework/preact/reference/type-aliases/QueryKey.md b/docs/framework/preact/reference/type-aliases/QueryKey.md new file mode 100644 index 00000000000..1a3f34cde18 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/QueryKey.md @@ -0,0 +1,10 @@ +--- +id: QueryKey +title: QueryKey +--- + +```ts +type QueryKey = Register extends object ? TQueryKey extends ReadonlyArray ? TQueryKey : TQueryKey extends unknown[] ? TQueryKey : ReadonlyArray : ReadonlyArray; +``` + +Defined in: [packages/query-core/src/types.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L51) diff --git a/docs/framework/preact/reference/type-aliases/QueryKeyHashFunction.md b/docs/framework/preact/reference/type-aliases/QueryKeyHashFunction.md new file mode 100644 index 00000000000..feda96373cc --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/QueryKeyHashFunction.md @@ -0,0 +1,26 @@ +--- +id: QueryKeyHashFunction +title: QueryKeyHashFunction +--- + +```ts +type QueryKeyHashFunction = (queryKey) => string; +``` + +Defined in: [packages/query-core/src/types.ts:192](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L192) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) + +## Parameters + +### queryKey + +`TQueryKey` + +## Returns + +`string` diff --git a/docs/framework/preact/reference/type-aliases/QueryKeyWithDataTag.md b/docs/framework/preact/reference/type-aliases/QueryKeyWithDataTag.md new file mode 100644 index 00000000000..6613f74be9e --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/QueryKeyWithDataTag.md @@ -0,0 +1,34 @@ +--- +id: QueryKeyWithDataTag +title: QueryKeyWithDataTag +--- + +```ts +type QueryKeyWithDataTag = object; +``` + +Defined in: [packages/query-core/src/types.ts:82](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L82) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +## Properties + +### queryKey + +```ts +queryKey: DataTag; +``` + +Defined in: [packages/query-core/src/types.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L87) diff --git a/docs/framework/preact/reference/type-aliases/QueryMeta.md b/docs/framework/preact/reference/type-aliases/QueryMeta.md new file mode 100644 index 00000000000..c12917b2cce --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/QueryMeta.md @@ -0,0 +1,10 @@ +--- +id: QueryMeta +title: QueryMeta +--- + +```ts +type QueryMeta = Register extends object ? TQueryMeta extends Record ? TQueryMeta : Record : Record; +``` + +Defined in: [packages/query-core/src/types.ts:215](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L215) diff --git a/docs/framework/preact/reference/type-aliases/QueryObserverResult.md b/docs/framework/preact/reference/type-aliases/QueryObserverResult.md new file mode 100644 index 00000000000..f6c4118a978 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/QueryObserverResult.md @@ -0,0 +1,25 @@ +--- +id: QueryObserverResult +title: QueryObserverResult +--- + +```ts +type QueryObserverResult = + | DefinedQueryObserverResult + | QueryObserverLoadingErrorResult + | QueryObserverLoadingResult + | QueryObserverPendingResult +| QueryObserverPlaceholderResult; +``` + +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/preact/reference/type-aliases/QueryPersister.md b/docs/framework/preact/reference/type-aliases/QueryPersister.md new file mode 100644 index 00000000000..72e80165b0d --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/QueryPersister.md @@ -0,0 +1,24 @@ +--- +id: QueryPersister +title: QueryPersister +--- + +```ts +type QueryPersister = [TPageParam] extends [never] ? (queryFn, context, query) => T | Promise : (queryFn, context, query) => T | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L128) + +## Type Parameters + +### T + +`T` = `unknown` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` diff --git a/docs/framework/preact/reference/type-aliases/QueryStatus.md b/docs/framework/preact/reference/type-aliases/QueryStatus.md new file mode 100644 index 00000000000..ed6059e03ec --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/QueryStatus.md @@ -0,0 +1,10 @@ +--- +id: QueryStatus +title: QueryStatus +--- + +```ts +type QueryStatus = "pending" | "error" | "success"; +``` + +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) diff --git a/docs/framework/preact/reference/type-aliases/SkipToken.md b/docs/framework/preact/reference/type-aliases/SkipToken.md new file mode 100644 index 00000000000..176c23830d2 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/SkipToken.md @@ -0,0 +1,12 @@ +--- +id: SkipToken +title: SkipToken +--- + +```ts +type SkipToken = typeof skipToken; +``` + +Defined in: [packages/query-core/src/utils.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L524) + +The type of the [skipToken](../variables/skipToken.md) sentinel value. diff --git a/docs/framework/preact/reference/type-aliases/StaleTime.md b/docs/framework/preact/reference/type-aliases/StaleTime.md new file mode 100644 index 00000000000..3e7e21608be --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/StaleTime.md @@ -0,0 +1,10 @@ +--- +id: StaleTime +title: StaleTime +--- + +```ts +type StaleTime = number | "static"; +``` + +Defined in: [packages/query-core/src/types.ts:108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L108) diff --git a/docs/framework/preact/reference/type-aliases/StaleTimeFunction.md b/docs/framework/preact/reference/type-aliases/StaleTimeFunction.md new file mode 100644 index 00000000000..b1c541fa64e --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/StaleTimeFunction.md @@ -0,0 +1,28 @@ +--- +id: StaleTimeFunction +title: StaleTimeFunction +--- + +```ts +type StaleTimeFunction = StaleTime | (query) => StaleTime; +``` + +Defined in: [packages/query-core/src/types.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L110) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/preact/reference/type-aliases/SuspenseQueriesOptions.md b/docs/framework/preact/reference/type-aliases/SuspenseQueriesOptions.md index 270f2e1423c..a61ae66de38 100644 --- a/docs/framework/preact/reference/type-aliases/SuspenseQueriesOptions.md +++ b/docs/framework/preact/reference/type-aliases/SuspenseQueriesOptions.md @@ -7,7 +7,7 @@ title: SuspenseQueriesOptions type SuspenseQueriesOptions = TDepth["length"] extends MAXIMUM_DEPTH ? UseSuspenseQueryOptions[] : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryOptions] : T extends [infer Head, ...(infer Tails)] ? SuspenseQueriesOptions<[...Tails], [...TResults, GetUseSuspenseQueryOptions], [...TDepth, 1]> : unknown[] extends T ? T : T extends UseSuspenseQueryOptions[] ? UseSuspenseQueryOptions[] : UseSuspenseQueryOptions[]; ``` -Defined in: [preact-query/src/useSuspenseQueries.ts:119](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useSuspenseQueries.ts#L119) +Defined in: [packages/preact-query/src/useSuspenseQueries.ts:119](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useSuspenseQueries.ts#L119) The `queries` array accepted by `useSuspenseQueries`. Recursively unwraps each tuple element so every entry's `queryFn`/`select` are inferred individually, up to 20 elements. An opaque array (e.g. `unknown[]`) diff --git a/docs/framework/preact/reference/type-aliases/SuspenseQueriesResults.md b/docs/framework/preact/reference/type-aliases/SuspenseQueriesResults.md index aa814a6ac9d..747e090ef9e 100644 --- a/docs/framework/preact/reference/type-aliases/SuspenseQueriesResults.md +++ b/docs/framework/preact/reference/type-aliases/SuspenseQueriesResults.md @@ -7,7 +7,7 @@ title: SuspenseQueriesResults type SuspenseQueriesResults = TDepth["length"] extends MAXIMUM_DEPTH ? UseSuspenseQueryResult[] : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryResult] : T extends [infer Head, ...(infer Tails)] ? SuspenseQueriesResults<[...Tails], [...TResults, GetUseSuspenseQueryResult], [...TDepth, 1]> : { [K in keyof T]: GetUseSuspenseQueryResult }; ``` -Defined in: [preact-query/src/useSuspenseQueries.ts:165](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useSuspenseQueries.ts#L165) +Defined in: [packages/preact-query/src/useSuspenseQueries.ts:165](https://github.com/TanStack/query/blob/main/packages/preact-query/src/useSuspenseQueries.ts#L165) The result type returned by `useSuspenseQueries`, when no `combine` is provided. Mirrors [SuspenseQueriesOptions](SuspenseQueriesOptions.md): each tuple element's result type is inferred individually, up to 20 elements. diff --git a/docs/framework/preact/reference/type-aliases/ThrowOnError.md b/docs/framework/preact/reference/type-aliases/ThrowOnError.md new file mode 100644 index 00000000000..60ad44c1cd1 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/ThrowOnError.md @@ -0,0 +1,28 @@ +--- +id: ThrowOnError +title: ThrowOnError +--- + +```ts +type ThrowOnError = boolean | (error, query) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L361) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` + +### TError + +`TError` + +### TQueryData + +`TQueryData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/preact/reference/type-aliases/TimeoutCallback.md b/docs/framework/preact/reference/type-aliases/TimeoutCallback.md new file mode 100644 index 00000000000..387fb1238f3 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/TimeoutCallback.md @@ -0,0 +1,27 @@ +--- +id: TimeoutCallback +title: TimeoutCallback +--- + +```ts +type TimeoutCallback = (_) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:9](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L9) + +TimeoutManager does not support passing arguments to the callback. + +`(_: void)` is the argument type inferred by TypeScript's default typings for +`setTimeout(cb, number)`. +If we don't accept a single void argument, then +`new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. + +## Parameters + +### \_ + +`void` + +## Returns + +`void` diff --git a/docs/framework/preact/reference/type-aliases/TimeoutProvider.md b/docs/framework/preact/reference/type-aliases/TimeoutProvider.md new file mode 100644 index 00000000000..6416fe4c557 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/TimeoutProvider.md @@ -0,0 +1,106 @@ +--- +id: TimeoutProvider +title: TimeoutProvider +--- + +```ts +type TimeoutProvider = object; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:22](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L22) + +Backend for timer functions. + +## Type Parameters + +### TTimerId + +`TTimerId` *extends* [`ManagedTimerId`](ManagedTimerId.md) = [`ManagedTimerId`](ManagedTimerId.md) + +## Properties + +### clearInterval() + +```ts +readonly clearInterval: (intervalId) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) + +#### Parameters + +##### intervalId + +`TTimerId` | `undefined` + +#### Returns + +`void` + +*** + +### clearTimeout() + +```ts +readonly clearTimeout: (timeoutId) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L25) + +#### Parameters + +##### timeoutId + +`TTimerId` | `undefined` + +#### Returns + +`void` + +*** + +### setInterval() + +```ts +readonly setInterval: (callback, delay) => TTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L27) + +#### Parameters + +##### callback + +[`TimeoutCallback`](TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +`TTimerId` + +*** + +### setTimeout() + +```ts +readonly setTimeout: (callback, delay) => TTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L24) + +#### Parameters + +##### callback + +[`TimeoutCallback`](TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +`TTimerId` diff --git a/docs/framework/preact/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md b/docs/framework/preact/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md index 361e6c306e4..a2245f65836 100644 --- a/docs/framework/preact/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md +++ b/docs/framework/preact/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md @@ -7,7 +7,7 @@ title: UndefinedInitialDataInfiniteOptions type UndefinedInitialDataInfiniteOptions = UseInfiniteQueryOptions & object; ``` -Defined in: [preact-query/src/infiniteQueryOptions.ts:25](https://github.com/TanStack/query/blob/main/packages/preact-query/src/infiniteQueryOptions.ts#L25) +Defined in: [packages/preact-query/src/infiniteQueryOptions.ts:25](https://github.com/TanStack/query/blob/main/packages/preact-query/src/infiniteQueryOptions.ts#L25) The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set — `data` may be `undefined` while the query is `pending`. @@ -38,20 +38,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/preact/reference/type-aliases/UndefinedInitialDataOptions.md b/docs/framework/preact/reference/type-aliases/UndefinedInitialDataOptions.md index 42d8de427c8..8229e0450c6 100644 --- a/docs/framework/preact/reference/type-aliases/UndefinedInitialDataOptions.md +++ b/docs/framework/preact/reference/type-aliases/UndefinedInitialDataOptions.md @@ -7,7 +7,7 @@ title: UndefinedInitialDataOptions type UndefinedInitialDataOptions = UseQueryOptions & object; ``` -Defined in: [preact-query/src/queryOptions.ts:23](https://github.com/TanStack/query/blob/main/packages/preact-query/src/queryOptions.ts#L23) +Defined in: [packages/preact-query/src/queryOptions.ts:23](https://github.com/TanStack/query/blob/main/packages/preact-query/src/queryOptions.ts#L23) The options accepted by the `queryOptions` overload selected when no `initialData` is set — `data` may be `undefined` while the query is `pending`. @@ -38,7 +38,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -50,6 +50,6 @@ The type `data` ends up as after `select` runs. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/preact/reference/type-aliases/UnsetMarker.md b/docs/framework/preact/reference/type-aliases/UnsetMarker.md new file mode 100644 index 00000000000..8b9c14e1907 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/UnsetMarker.md @@ -0,0 +1,10 @@ +--- +id: UnsetMarker +title: UnsetMarker +--- + +```ts +type UnsetMarker = typeof unsetMarker; +``` + +Defined in: [packages/query-core/src/types.ts:66](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L66) diff --git a/docs/framework/preact/reference/type-aliases/UnusedSkipTokenInfiniteOptions.md b/docs/framework/preact/reference/type-aliases/UnusedSkipTokenInfiniteOptions.md index 67558527046..185d7926afc 100644 --- a/docs/framework/preact/reference/type-aliases/UnusedSkipTokenInfiniteOptions.md +++ b/docs/framework/preact/reference/type-aliases/UnusedSkipTokenInfiniteOptions.md @@ -7,7 +7,7 @@ title: UnusedSkipTokenInfiniteOptions type UnusedSkipTokenInfiniteOptions = OmitKeyof, "queryFn"> & object; ``` -Defined in: [preact-query/src/infiniteQueryOptions.ts:65](https://github.com/TanStack/query/blob/main/packages/preact-query/src/infiniteQueryOptions.ts#L65) +Defined in: [packages/preact-query/src/infiniteQueryOptions.ts:65](https://github.com/TanStack/query/blob/main/packages/preact-query/src/infiniteQueryOptions.ts#L65) The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set and `queryFn` is not `skipToken` — same as [UndefinedInitialDataInfiniteOptions](UndefinedInitialDataInfiniteOptions.md), but `queryFn` may not be @@ -36,20 +36,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/preact/reference/type-aliases/UnusedSkipTokenOptions.md b/docs/framework/preact/reference/type-aliases/UnusedSkipTokenOptions.md index a7348d4794b..889574a8381 100644 --- a/docs/framework/preact/reference/type-aliases/UnusedSkipTokenOptions.md +++ b/docs/framework/preact/reference/type-aliases/UnusedSkipTokenOptions.md @@ -7,7 +7,7 @@ title: UnusedSkipTokenOptions type UnusedSkipTokenOptions = OmitKeyof, "queryFn"> & object; ``` -Defined in: [preact-query/src/queryOptions.ts:51](https://github.com/TanStack/query/blob/main/packages/preact-query/src/queryOptions.ts#L51) +Defined in: [packages/preact-query/src/queryOptions.ts:51](https://github.com/TanStack/query/blob/main/packages/preact-query/src/queryOptions.ts#L51) The options accepted by the `queryOptions` overload selected when no `initialData` is set and `queryFn` is not `skipToken` — same as [UndefinedInitialDataOptions](UndefinedInitialDataOptions.md), but `queryFn` may not be `skipToken`. @@ -35,7 +35,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -47,6 +47,6 @@ The type `data` ends up as after `select` runs. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/preact/reference/type-aliases/Updater.md b/docs/framework/preact/reference/type-aliases/Updater.md new file mode 100644 index 00000000000..b6a29ccc5fc --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/Updater.md @@ -0,0 +1,35 @@ +--- +id: Updater +title: Updater +--- + +```ts +type Updater = TOutput | (input) => TOutput; +``` + +Defined in: [packages/query-core/src/utils.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L103) + +Either a plain value of type `TOutput`, or a function that receives `TInput` and returns `TOutput`. +Used for example by `setQueryData`-style updaters, which accept either the new data directly or a +function that computes it from the previous data. See functionalUpdate. + +## Type Parameters + +### TInput + +`TInput` + +### TOutput + +`TOutput` + +## Example + +```ts +queryClient.setQueryData(['posts'], newPosts) + +// Or, using an updater function that receives the current data: +queryClient.setQueryData(['posts'], (oldPosts) => + oldPosts ? [...oldPosts, newPost] : oldPosts, +) +``` diff --git a/docs/framework/preact/reference/type-aliases/UseBaseMutationResult.md b/docs/framework/preact/reference/type-aliases/UseBaseMutationResult.md index 26ff1767535..5a473c0895c 100644 --- a/docs/framework/preact/reference/type-aliases/UseBaseMutationResult.md +++ b/docs/framework/preact/reference/type-aliases/UseBaseMutationResult.md @@ -9,9 +9,9 @@ type UseBaseMutationResult = Overrid }> & object; ``` -Defined in: [preact-query/src/types.ts:470](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L470) +Defined in: [packages/preact-query/src/types.ts:470](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L470) -The result of `useMutation`. Same as MutationObserverResult from `@tanstack/query-core`, with +The result of `useMutation`. Same as [MutationObserverResult](MutationObserverResult.md) from `@tanstack/query-core`, with `mutate` narrowed to the fire-and-forget [UseMutateFunction](UseMutateFunction.md) signature, plus the added `mutateAsync`. ## Type Declaration @@ -34,7 +34,7 @@ The type your mutation function resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your mutation function may throw. diff --git a/docs/framework/preact/reference/type-aliases/UseBaseQueryResult.md b/docs/framework/preact/reference/type-aliases/UseBaseQueryResult.md index b0f507866a6..ea1c6c715f1 100644 --- a/docs/framework/preact/reference/type-aliases/UseBaseQueryResult.md +++ b/docs/framework/preact/reference/type-aliases/UseBaseQueryResult.md @@ -7,10 +7,10 @@ title: UseBaseQueryResult type UseBaseQueryResult = QueryObserverResult; ``` -Defined in: [preact-query/src/types.ts:313](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L313) +Defined in: [packages/preact-query/src/types.ts:313](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L313) The result of `useQuery` when `initialData` isn't set — `data` may be `undefined` while the query is -`pending`. Re-exports QueryObserverResult from `@tanstack/query-core`. `useInfiniteQuery` returns +`pending`. Re-exports [QueryObserverResult](QueryObserverResult.md) from `@tanstack/query-core`. `useInfiniteQuery` returns [UseInfiniteQueryResult](UseInfiniteQueryResult.md) instead. ## Type Parameters @@ -23,6 +23,6 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. diff --git a/docs/framework/preact/reference/type-aliases/UseInfiniteQueryResult.md b/docs/framework/preact/reference/type-aliases/UseInfiniteQueryResult.md index 54dbc0e5546..5440118cb12 100644 --- a/docs/framework/preact/reference/type-aliases/UseInfiniteQueryResult.md +++ b/docs/framework/preact/reference/type-aliases/UseInfiniteQueryResult.md @@ -7,10 +7,10 @@ title: UseInfiniteQueryResult type UseInfiniteQueryResult = InfiniteQueryObserverResult; ``` -Defined in: [preact-query/src/types.ts:364](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L364) +Defined in: [packages/preact-query/src/types.ts:364](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L364) The result of `useInfiniteQuery` when `initialData` isn't set — `data` may be `undefined` while the query is -`pending`. Re-exports InfiniteQueryObserverResult from `@tanstack/query-core`. +`pending`. Re-exports [InfiniteQueryObserverResult](InfiniteQueryObserverResult.md) from `@tanstack/query-core`. ## Type Parameters @@ -22,6 +22,6 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. diff --git a/docs/framework/preact/reference/type-aliases/UseMutateAsyncFunction.md b/docs/framework/preact/reference/type-aliases/UseMutateAsyncFunction.md index 5bb4bd25bd8..edcdd01ae2e 100644 --- a/docs/framework/preact/reference/type-aliases/UseMutateAsyncFunction.md +++ b/docs/framework/preact/reference/type-aliases/UseMutateAsyncFunction.md @@ -7,7 +7,7 @@ title: UseMutateAsyncFunction type UseMutateAsyncFunction = MutateFunction; ``` -Defined in: [preact-query/src/types.ts:453](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L453) +Defined in: [packages/preact-query/src/types.ts:453](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L453) The type of `mutateAsync`, as returned by `useMutation`. Similar to [UseMutateFunction](UseMutateFunction.md), but returns a promise which can be awaited. @@ -22,7 +22,7 @@ The type your mutation function resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your mutation function may throw. diff --git a/docs/framework/preact/reference/type-aliases/UseMutateFunction.md b/docs/framework/preact/reference/type-aliases/UseMutateFunction.md index 9037b6fe893..3cadb2b52de 100644 --- a/docs/framework/preact/reference/type-aliases/UseMutateFunction.md +++ b/docs/framework/preact/reference/type-aliases/UseMutateFunction.md @@ -7,7 +7,7 @@ title: UseMutateFunction type UseMutateFunction = (...args) => void; ``` -Defined in: [preact-query/src/types.ts:432](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L432) +Defined in: [packages/preact-query/src/types.ts:432](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L432) The type of `mutate`, as returned by `useMutation`. Forwards the variables (and an optional per-call `onSuccess`/`onError`/`onSettled`) to the underlying `mutate` call. Fire-and-forget — errors are surfaced @@ -23,7 +23,7 @@ The type your mutation function resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your mutation function may throw. @@ -44,7 +44,7 @@ their `onMutateResult` parameter — useful for optimistic-update rollback data. ### args -...`Parameters`\<`MutateFunction`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> +...`Parameters`\<[`MutateFunction`](MutateFunction.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> ## Returns diff --git a/docs/framework/preact/reference/type-aliases/UseMutationResult.md b/docs/framework/preact/reference/type-aliases/UseMutationResult.md index 4c188cdab72..1e0a4631542 100644 --- a/docs/framework/preact/reference/type-aliases/UseMutationResult.md +++ b/docs/framework/preact/reference/type-aliases/UseMutationResult.md @@ -7,7 +7,7 @@ title: UseMutationResult type UseMutationResult = UseBaseMutationResult; ``` -Defined in: [preact-query/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L499) +Defined in: [packages/preact-query/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L499) The result of `useMutation`. Same as [UseBaseMutationResult](UseBaseMutationResult.md). @@ -21,7 +21,7 @@ The type your mutation function resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your mutation function may throw. diff --git a/docs/framework/preact/reference/type-aliases/UsePrefetchInfiniteQueryOptions.md b/docs/framework/preact/reference/type-aliases/UsePrefetchInfiniteQueryOptions.md index a8e1d3d7814..cd947efe149 100644 --- a/docs/framework/preact/reference/type-aliases/UsePrefetchInfiniteQueryOptions.md +++ b/docs/framework/preact/reference/type-aliases/UsePrefetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: UsePrefetchInfiniteQueryOptions type UsePrefetchInfiniteQueryOptions = DistributiveOmit, "queryFn"> & object; ``` -Defined in: [preact-query/src/types.ts:117](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L117) +Defined in: [packages/preact-query/src/types.ts:117](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L117) The options accepted by `usePrefetchInfiniteQuery` — everything you can pass to `queryClient.infiniteQuery`, except `queryFn` is required unless a default query function has been defined. @@ -33,7 +33,7 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -47,7 +47,7 @@ elsewhere with `select` applied. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/preact/reference/type-aliases/UsePrefetchQueryOptions.md b/docs/framework/preact/reference/type-aliases/UsePrefetchQueryOptions.md index 43af626af99..205248982af 100644 --- a/docs/framework/preact/reference/type-aliases/UsePrefetchQueryOptions.md +++ b/docs/framework/preact/reference/type-aliases/UsePrefetchQueryOptions.md @@ -7,7 +7,7 @@ title: UsePrefetchQueryOptions type UsePrefetchQueryOptions = DistributiveOmit, "queryFn"> & object; ``` -Defined in: [preact-query/src/types.ts:79](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L79) +Defined in: [packages/preact-query/src/types.ts:79](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L79) The options accepted by `usePrefetchQuery` — everything you can pass to `queryClient.query`, except `queryFn` is required unless a default query function has been defined. @@ -33,7 +33,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -53,6 +53,6 @@ The type of the data actually held in the query cache — the input to `select` ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/preact/reference/type-aliases/UseQueryResult.md b/docs/framework/preact/reference/type-aliases/UseQueryResult.md index bea7c541fa0..0efa733923e 100644 --- a/docs/framework/preact/reference/type-aliases/UseQueryResult.md +++ b/docs/framework/preact/reference/type-aliases/UseQueryResult.md @@ -7,7 +7,7 @@ title: UseQueryResult type UseQueryResult = UseBaseQueryResult; ``` -Defined in: [preact-query/src/types.ts:324](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L324) +Defined in: [packages/preact-query/src/types.ts:324](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L324) The result of `useQuery`. Same as [UseBaseQueryResult](UseBaseQueryResult.md). @@ -21,6 +21,6 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. diff --git a/docs/framework/preact/reference/type-aliases/UseSuspenseInfiniteQueryResult.md b/docs/framework/preact/reference/type-aliases/UseSuspenseInfiniteQueryResult.md index 15c418f8526..038e3614cc9 100644 --- a/docs/framework/preact/reference/type-aliases/UseSuspenseInfiniteQueryResult.md +++ b/docs/framework/preact/reference/type-aliases/UseSuspenseInfiniteQueryResult.md @@ -7,7 +7,7 @@ title: UseSuspenseInfiniteQueryResult type UseSuspenseInfiniteQueryResult = OmitKeyof, "isPlaceholderData">; ``` -Defined in: [preact-query/src/types.ts:388](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L388) +Defined in: [packages/preact-query/src/types.ts:388](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L388) The result of `useSuspenseInfiniteQuery`. Same as [DefinedUseInfiniteQueryResult](DefinedUseInfiniteQueryResult.md), minus `isPlaceholderData` — Suspense hooks never render placeholder data. @@ -22,6 +22,6 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. diff --git a/docs/framework/preact/reference/type-aliases/UseSuspenseQueryResult.md b/docs/framework/preact/reference/type-aliases/UseSuspenseQueryResult.md index a013593070d..697bff07606 100644 --- a/docs/framework/preact/reference/type-aliases/UseSuspenseQueryResult.md +++ b/docs/framework/preact/reference/type-aliases/UseSuspenseQueryResult.md @@ -7,7 +7,7 @@ title: UseSuspenseQueryResult type UseSuspenseQueryResult = DistributiveOmit, "isPlaceholderData">; ``` -Defined in: [preact-query/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L336) +Defined in: [packages/preact-query/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/preact-query/src/types.ts#L336) The result of `useSuspenseQuery`. Same as [DefinedUseQueryResult](DefinedUseQueryResult.md), minus `isPlaceholderData` — always `false` on that type, so this drops the dead field rather than an active state. @@ -22,6 +22,6 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. diff --git a/docs/framework/preact/reference/type-aliases/WithRequired.md b/docs/framework/preact/reference/type-aliases/WithRequired.md new file mode 100644 index 00000000000..c8ef831db3c --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/WithRequired.md @@ -0,0 +1,20 @@ +--- +id: WithRequired +title: WithRequired +--- + +```ts +type WithRequired = TTarget & { [_ in TKey]: {} }; +``` + +Defined in: [packages/query-core/src/types.ts:505](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L505) + +## Type Parameters + +### TTarget + +`TTarget` + +### TKey + +`TKey` *extends* keyof `TTarget` diff --git a/docs/framework/preact/reference/type-aliases/dataTagErrorSymbol.md b/docs/framework/preact/reference/type-aliases/dataTagErrorSymbol.md new file mode 100644 index 00000000000..26148a94d6e --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/dataTagErrorSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagErrorSymbol +title: dataTagErrorSymbol +--- + +```ts +type dataTagErrorSymbol = typeof dataTagErrorSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:63](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L63) diff --git a/docs/framework/preact/reference/type-aliases/dataTagSymbol.md b/docs/framework/preact/reference/type-aliases/dataTagSymbol.md new file mode 100644 index 00000000000..0012c108cc5 --- /dev/null +++ b/docs/framework/preact/reference/type-aliases/dataTagSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagSymbol +title: dataTagSymbol +--- + +```ts +type dataTagSymbol = typeof dataTagSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L61) diff --git a/docs/framework/preact/reference/variables/IsRestoringProvider.md b/docs/framework/preact/reference/variables/IsRestoringProvider.md index 42069e45fc2..bc8bb54d50a 100644 --- a/docs/framework/preact/reference/variables/IsRestoringProvider.md +++ b/docs/framework/preact/reference/variables/IsRestoringProvider.md @@ -7,7 +7,7 @@ title: IsRestoringProvider const IsRestoringProvider: Provider = IsRestoringContext.Provider; ``` -Defined in: [preact-query/src/IsRestoringProvider.ts:19](https://github.com/TanStack/query/blob/main/packages/preact-query/src/IsRestoringProvider.ts#L19) +Defined in: [packages/preact-query/src/IsRestoringProvider.ts:19](https://github.com/TanStack/query/blob/main/packages/preact-query/src/IsRestoringProvider.ts#L19) The Provider that `PersistQueryClientProvider` uses to signal whether a persisted client is currently being restored, read by `useIsRestoring`. diff --git a/docs/framework/preact/reference/variables/QueryClientContext.md b/docs/framework/preact/reference/variables/QueryClientContext.md index fa7a465d171..44ef915c669 100644 --- a/docs/framework/preact/reference/variables/QueryClientContext.md +++ b/docs/framework/preact/reference/variables/QueryClientContext.md @@ -7,6 +7,6 @@ title: QueryClientContext const QueryClientContext: Context; ``` -Defined in: [preact-query/src/QueryClientProvider.tsx:9](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryClientProvider.tsx#L9) +Defined in: [packages/preact-query/src/QueryClientProvider.tsx:9](https://github.com/TanStack/query/blob/main/packages/preact-query/src/QueryClientProvider.tsx#L9) The context that `useQueryClient` reads from. `QueryClientProvider` is the normal way to set it. diff --git a/docs/framework/preact/reference/variables/dataTagErrorSymbol.md b/docs/framework/preact/reference/variables/dataTagErrorSymbol.md new file mode 100644 index 00000000000..20bab62fb01 --- /dev/null +++ b/docs/framework/preact/reference/variables/dataTagErrorSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagErrorSymbol +title: dataTagErrorSymbol +--- + +```ts +const dataTagErrorSymbol: typeof dataTagErrorSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:63](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L63) diff --git a/docs/framework/preact/reference/variables/dataTagSymbol.md b/docs/framework/preact/reference/variables/dataTagSymbol.md new file mode 100644 index 00000000000..83dd68a56e9 --- /dev/null +++ b/docs/framework/preact/reference/variables/dataTagSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagSymbol +title: dataTagSymbol +--- + +```ts +const dataTagSymbol: typeof dataTagSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L61) diff --git a/docs/framework/preact/reference/variables/defaultScheduler.md b/docs/framework/preact/reference/variables/defaultScheduler.md new file mode 100644 index 00000000000..70e14d3f846 --- /dev/null +++ b/docs/framework/preact/reference/variables/defaultScheduler.md @@ -0,0 +1,13 @@ +--- +id: defaultScheduler +title: defaultScheduler +--- + +```ts +const defaultScheduler: ScheduleFunction = systemSetTimeoutZero; +``` + +Defined in: [packages/query-core/src/notifyManager.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L19) + +Default scheduling function used by the notify manager. +Schedules the callback with the system's `setTimeout(callback, 0)`. diff --git a/docs/framework/preact/reference/variables/environmentManager.md b/docs/framework/preact/reference/variables/environmentManager.md new file mode 100644 index 00000000000..caa1d70b2b6 --- /dev/null +++ b/docs/framework/preact/reference/variables/environmentManager.md @@ -0,0 +1,44 @@ +--- +id: environmentManager +title: environmentManager +--- + +```ts +const environmentManager: object; +``` + +Defined in: [packages/query-core/src/environmentManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L15) + +Manages environment detection used by TanStack Query internals. + +## Type Declaration + +### isServer() + +```ts +isServer: () => boolean; +``` + +Returns whether the current runtime should be treated as a server environment. + +#### Returns + +`boolean` + +### setIsServer() + +```ts +setIsServer(isServerValue): void; +``` + +Overrides the server check globally. + +#### Parameters + +##### isServerValue + +`IsServerValue` + +#### Returns + +`void` diff --git a/docs/framework/preact/reference/variables/focusManager.md b/docs/framework/preact/reference/variables/focusManager.md new file mode 100644 index 00000000000..cbf7fcb4a17 --- /dev/null +++ b/docs/framework/preact/reference/variables/focusManager.md @@ -0,0 +1,12 @@ +--- +id: focusManager +title: focusManager +--- + +```ts +const focusManager: FocusManager; +``` + +Defined in: [packages/query-core/src/focusManager.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L142) + +Singleton instance of FocusManager, used to manage and observe the focus state within TanStack Query. diff --git a/docs/framework/preact/reference/variables/isServer.md b/docs/framework/preact/reference/variables/isServer.md new file mode 100644 index 00000000000..28956d55cbf --- /dev/null +++ b/docs/framework/preact/reference/variables/isServer.md @@ -0,0 +1,14 @@ +--- +id: isServer +title: isServer +--- + +```ts +const isServer: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L112) + +## Deprecated + +use `environmentManager.isServer()` instead. diff --git a/docs/framework/preact/reference/variables/notifyManager.md b/docs/framework/preact/reference/variables/notifyManager.md new file mode 100644 index 00000000000..e5ecca8df60 --- /dev/null +++ b/docs/framework/preact/reference/variables/notifyManager.md @@ -0,0 +1,156 @@ +--- +id: notifyManager +title: notifyManager +--- + +```ts +const notifyManager: object; +``` + +Defined in: [packages/query-core/src/notifyManager.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L135) + +Handles scheduling and batching callbacks in TanStack Query. + +## Type Declaration + +### batch() + +```ts +readonly batch: (callback) => T; +``` + +Batches all updates scheduled inside the passed callback. +This is mainly used internally to optimize query client updating. +Batches can be nested; the queue is only flushed once the outermost `batch` call finishes. +The return value of `callback` is passed through. + +#### Type Parameters + +##### T + +`T` + +#### Parameters + +##### callback + +() => `T` + +#### Returns + +`T` + +### batchCalls() + +```ts +readonly batchCalls: (callback) => BatchCallsCallback; +``` + +All calls to the wrapped function will be batched. + +#### Type Parameters + +##### T + +`T` *extends* `unknown`[] + +#### Parameters + +##### callback + +`BatchCallsCallback`\<`T`\> + +#### Returns + +`BatchCallsCallback`\<`T`\> + +### schedule() + +```ts +schedule: (callback) => void; +``` + +Schedules a function to be run on the next batch. +By default, the batch is run with a `setTimeout`, but this can be configured via `setScheduler`. + +#### Parameters + +##### callback + +`NotifyCallback` + +#### Returns + +`void` + +### setBatchNotifyFunction() + +```ts +readonly setBatchNotifyFunction: (fn) => void; +``` + +Use this method to set a custom function to batch notifications together into a single tick. +By default React Query will use the batch function provided by ReactDOM or React Native. + +#### Parameters + +##### fn + +`BatchNotifyFunction` + +#### Returns + +`void` + +### setNotifyFunction() + +```ts +readonly setNotifyFunction: (fn) => void; +``` + +Use this method to set a custom notify function. +This can be used to for example wrap notifications with `React.act` while running tests. + +#### Parameters + +##### fn + +`NotifyFunction` + +#### Returns + +`void` + +### setScheduler() + +```ts +readonly setScheduler: (fn) => void; +``` + +Configures a custom callback that schedules when the next batch runs. +The default behavior is `setTimeout(callback, 0)`. + +#### Parameters + +##### fn + +`ScheduleFunction` + +#### Returns + +`void` + +#### Example + +```ts +import { notifyManager } from '@tanstack/query-core' + +// Schedule batches in the next microtask +notifyManager.setScheduler(queueMicrotask) + +// Schedule batches before the next frame is rendered +notifyManager.setScheduler(requestAnimationFrame) + +// Schedule batches some time in the future +notifyManager.setScheduler((cb) => setTimeout(cb, 10)) +``` diff --git a/docs/framework/preact/reference/variables/onlineManager.md b/docs/framework/preact/reference/variables/onlineManager.md new file mode 100644 index 00000000000..4ae083f245b --- /dev/null +++ b/docs/framework/preact/reference/variables/onlineManager.md @@ -0,0 +1,12 @@ +--- +id: onlineManager +title: onlineManager +--- + +```ts +const onlineManager: OnlineManager; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L117) + +Singleton instance of OnlineManager, used to manage and observe the online state within TanStack Query. diff --git a/docs/framework/preact/reference/variables/skipToken.md b/docs/framework/preact/reference/variables/skipToken.md new file mode 100644 index 00000000000..3163e91c1c2 --- /dev/null +++ b/docs/framework/preact/reference/variables/skipToken.md @@ -0,0 +1,23 @@ +--- +id: skipToken +title: skipToken +--- + +```ts +const skipToken: typeof skipToken; +``` + +Defined in: [packages/query-core/src/utils.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L520) + +Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent +to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`, +a query disabled via `skipToken` cannot be triggered with `refetch`. + +## Example + +```ts +new QueryObserver(queryClient, { + queryKey: ['post', postId], + queryFn: postId != null ? () => fetchPost(postId) : skipToken, +}) +``` diff --git a/docs/framework/preact/reference/variables/timeoutManager.md b/docs/framework/preact/reference/variables/timeoutManager.md new file mode 100644 index 00000000000..2dcfa29b55a --- /dev/null +++ b/docs/framework/preact/reference/variables/timeoutManager.md @@ -0,0 +1,12 @@ +--- +id: timeoutManager +title: timeoutManager +--- + +```ts +const timeoutManager: TimeoutManager; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:226](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L226) + +Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/preact/reference/variables/unsetMarker.md b/docs/framework/preact/reference/variables/unsetMarker.md new file mode 100644 index 00000000000..d19ee65b38e --- /dev/null +++ b/docs/framework/preact/reference/variables/unsetMarker.md @@ -0,0 +1,10 @@ +--- +id: unsetMarker +title: unsetMarker +--- + +```ts +const unsetMarker: typeof unsetMarker; +``` + +Defined in: [packages/query-core/src/types.ts:65](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L65) diff --git a/docs/framework/react/reference/classes/CancelledError.md b/docs/framework/react/reference/classes/CancelledError.md new file mode 100644 index 00000000000..7fded5da20f --- /dev/null +++ b/docs/framework/react/reference/classes/CancelledError.md @@ -0,0 +1,273 @@ +--- +id: CancelledError +title: CancelledError +--- + +Defined in: [packages/query-core/src/retryer.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L77) + +The error thrown by a `Retryer` (and surfaced to `query.promise`/`mutation`) when a fetch is cancelled, e.g. via +`query.cancel()`. `revert`, if `true`, tells the caller to restore the state the query was in before the fetch +started instead of surfacing the error. `silent`, if `true`, tells the caller to suppress this error and instead +resolve with the promise of the fetch that triggered the cancellation. + +## Example + +```ts +query.cancel() + +try { + await query.promise +} catch (error) { + if (error instanceof CancelledError) { + // the fetch was cancelled, e.g. via `query.cancel()` + } +} +``` + +## Extends + +- `Error` + +## Constructors + +### Constructor + +```ts +new CancelledError(options?): CancelledError; +``` + +Defined in: [packages/query-core/src/retryer.ts:80](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L80) + +#### Parameters + +##### options? + +[`CancelOptions`](../interfaces/CancelOptions.md) + +#### Returns + +`CancelledError` + +#### Overrides + +```ts +Error.constructor +``` + +## Properties + +### cause? + +```ts +optional cause: unknown; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24 + +#### Inherited from + +```ts +Error.cause +``` + +*** + +### message + +```ts +message: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 + +#### Inherited from + +```ts +Error.message +``` + +*** + +### name + +```ts +name: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 + +#### Inherited from + +```ts +Error.name +``` + +*** + +### revert? + +```ts +optional revert: boolean; +``` + +Defined in: [packages/query-core/src/retryer.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L78) + +*** + +### silent? + +```ts +optional silent: boolean; +``` + +Defined in: [packages/query-core/src/retryer.ts:79](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L79) + +*** + +### stack? + +```ts +optional stack: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 + +#### Inherited from + +```ts +Error.stack +``` + +*** + +### stackTraceLimit + +```ts +static stackTraceLimit: number; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:68 + +The `Error.stackTraceLimit` property specifies the number of stack frames +collected by a stack trace (whether generated by `new Error().stack` or +`Error.captureStackTrace(obj)`). + +The default value is `10` but may be set to any valid JavaScript number. Changes +will affect any stack trace captured _after_ the value has been changed. + +If set to a non-number value, or set to a negative number, stack traces will +not capture any frames. + +#### Inherited from + +```ts +Error.stackTraceLimit +``` + +## Methods + +### captureStackTrace() + +```ts +static captureStackTrace(targetObject, constructorOpt?): void; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:52 + +Creates a `.stack` property on `targetObject`, which when accessed returns +a string representing the location in the code at which +`Error.captureStackTrace()` was called. + +```js +const myObject = {}; +Error.captureStackTrace(myObject); +myObject.stack; // Similar to `new Error().stack` +``` + +The first line of the trace will be prefixed with +`${myObject.name}: ${myObject.message}`. + +The optional `constructorOpt` argument accepts a function. If given, all frames +above `constructorOpt`, including `constructorOpt`, will be omitted from the +generated stack trace. + +The `constructorOpt` argument is useful for hiding implementation +details of error generation from the user. For instance: + +```js +function a() { + b(); +} + +function b() { + c(); +} + +function c() { + // Create an error without stack trace to avoid calculating the stack trace twice. + const { stackTraceLimit } = Error; + Error.stackTraceLimit = 0; + const error = new Error(); + Error.stackTraceLimit = stackTraceLimit; + + // Capture the stack trace above function b + Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace + throw error; +} + +a(); +``` + +#### Parameters + +##### targetObject + +`object` + +##### constructorOpt? + +`Function` + +#### Returns + +`void` + +#### Inherited from + +```ts +Error.captureStackTrace +``` + +*** + +### prepareStackTrace() + +```ts +static prepareStackTrace(err, stackTraces): any; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:56 + +#### Parameters + +##### err + +`Error` + +##### stackTraces + +`CallSite`[] + +#### Returns + +`any` + +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +```ts +Error.prepareStackTrace +``` diff --git a/docs/framework/react/reference/classes/InfiniteQueryObserver.md b/docs/framework/react/reference/classes/InfiniteQueryObserver.md new file mode 100644 index 00000000000..af43087a3ad --- /dev/null +++ b/docs/framework/react/reference/classes/InfiniteQueryObserver.md @@ -0,0 +1,665 @@ +--- +id: InfiniteQueryObserver +title: InfiniteQueryObserver +--- + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L41) + +An `InfiniteQueryObserver` extends `QueryObserver` to observe and switch +between infinite queries. It augments the base `QueryObserverResult` with +infinite-query-specific fields and methods, such as `hasNextPage` and +`fetchNextPage`, and is the primitive that framework adapters (e.g. +`useInfiniteQuery`) build their hooks on top of. + +## Example + +```ts +const observer = new InfiniteQueryObserver(queryClient, { + queryKey: ['projects'], + queryFn: ({ pageParam }) => fetchProjects(pageParam), + initialPageParam: 0, + getNextPageParam: (lastPage) => lastPage.nextCursor, +}) + +const unsubscribe = observer.subscribe((result) => console.log(result)) +``` + +## Extends + +- [`QueryObserver`](QueryObserver.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Constructors + +### Constructor + +```ts +new InfiniteQueryObserver(client, options): InfiniteQueryObserver; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L83) + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`InfiniteQueryObserver`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`constructor`](QueryObserver.md#constructor) + +## Properties + +### fetch + +```ts +protected fetch: ReplaceReturnType<(fetchOptions) => Promise>, Promise>>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:72](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L72) + +#### Overrides + +```ts +QueryObserver.fetch +``` + +*** + +### getCurrentResult + +```ts +getCurrentResult: ReplaceReturnType<() => QueryObserverResult, InfiniteQueryObserverResult>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L60) + +Returns the most recently computed `QueryObserverResult` for the +observed query. This is a point-in-time read; to be notified of updates +as they happen, subscribe to the observer instead (its inherited +`subscribe` method). + +#### Example + +```ts +const result = observer.getCurrentResult() +console.log(result.status, result.data) +``` + +#### Overrides + +```ts +QueryObserver.getCurrentResult +``` + +*** + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`listeners`](QueryObserver.md#listeners) + +*** + +### options + +```ts +options: QueryObserverOptions, TQueryKey>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L89) + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`options`](QueryObserver.md#options) + +*** + +### subscribe() + +```ts +subscribe: (listener) => () => void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L55) + +#### Parameters + +##### listener + +`InfiniteQueryObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Overrides + +```ts +QueryObserver.subscribe +``` + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L96) + +#### Returns + +`void` + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`bindMethods`](QueryObserver.md#bindmethods) + +*** + +### createResult() + +```ts +protected createResult(query, options): InfiniteQueryObserverResult; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:201](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L201) + +#### Parameters + +##### query + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`createResult`](QueryObserver.md#createresult) + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L161) + +Stops observing the current query: clears all listeners, cancels the +stale and refetch-interval timers, and removes this observer from the +query it was observing. + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`destroy`](QueryObserver.md#destroy) + +*** + +### fetchNextPage() + +```ts +fetchNextPage(options?): Promise>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L161) + +Fetches the next page of the infinite query and returns a promise that +resolves with the resulting `InfiniteQueryObserverResult`. The page +param used for the fetch is determined by `getNextPageParam`, which +receives the current pages/page params and whose result also determines +`hasNextPage`. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](../interfaces/FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const { hasNextPage } = observer.getCurrentResult() + +if (hasNextPage) { + await observer.fetchNextPage() +} +``` + +#### See + +[InfiniteQueryObserver#fetchPreviousPage](#fetchpreviouspage) + +*** + +### fetchOptimistic() + +```ts +fetchOptimistic(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:395](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L395) + +Fetches a query defined by the given options without affecting this +observer's own tracked query or result, and returns a promise that +resolves with the `QueryObserverResult` for that fetch. This is useful +for prefetching data that another observer (e.g. a query about to be +navigated to) will need, ahead of time. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.fetchOptimistic({ + queryKey: ['posts', 2], + queryFn: () => fetchPost(2), +}) +console.log(result.data) +``` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`fetchOptimistic`](QueryObserver.md#fetchoptimistic) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage(options?): Promise>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:190](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L190) + +Fetches the previous page of the infinite query and returns a promise +that resolves with the resulting `InfiniteQueryObserverResult`. The page +param used for the fetch is determined by `getPreviousPageParam`, which +receives the current pages/page params and whose result also determines +`hasPreviousPage`. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](../interfaces/FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const { hasPreviousPage } = observer.getCurrentResult() + +if (hasPreviousPage) { + await observer.fetchPreviousPage() +} +``` + +#### See + +[InfiniteQueryObserver#fetchNextPage](#fetchnextpage) + +*** + +### getCurrentQuery() + +```ts +getCurrentQuery(): Query, TQueryKey>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:357](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L357) + +Returns the `Query` instance this observer is currently observing. + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`getCurrentQuery`](QueryObserver.md#getcurrentquery) + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(options): InfiniteQueryObserverResult; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L127) + +The infinite-query counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult), marking the +options as an infinite query before delegating to it. Called by framework adapters (e.g. +`useInfiniteQuery`) ahead of subscribing, to compute the current `InfiniteQueryObserverResult` +synchronously. + +#### Parameters + +##### options + +[`DefaultedInfiniteQueryObserverOptions`](../type-aliases/DefaultedInfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`getOptimisticResult`](QueryObserver.md#getoptimisticresult) + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`hasListeners`](QueryObserver.md#haslisteners) + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L110) + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`onSubscribe`](QueryObserver.md#onsubscribe) + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L124) + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`onUnsubscribe`](QueryObserver.md#onunsubscribe) + +*** + +### refetch() + +```ts +refetch(__namedParameters): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L371) + +Refetches the observed query and returns a promise that resolves with +the resulting `QueryObserverResult`. + +#### Parameters + +##### \_\_namedParameters + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.refetch({ cancelRefetch: false }) +console.log(result.data) +``` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`refetch`](QueryObserver.md#refetch) + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:108](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L108) + +Updates the observer's options. Behaves the same as +`QueryObserver.setOptions`, additionally marking the options as +belonging to an infinite query before delegating to the base +implementation. + +#### Parameters + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`void` + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`setOptions`](QueryObserver.md#setoptions) + +*** + +### shouldFetchOnReconnect() + +```ts +shouldFetchOnReconnect(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L135) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnReconnect` option) to refetch when the network +reconnects. + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`shouldFetchOnReconnect`](QueryObserver.md#shouldfetchonreconnect) + +*** + +### shouldFetchOnWindowFocus() + +```ts +shouldFetchOnWindowFocus(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L148) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnWindowFocus` option) to refetch when the window +regains focus. + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`shouldFetchOnWindowFocus`](QueryObserver.md#shouldfetchonwindowfocus) + +*** + +### trackProp() + +```ts +trackProp(key): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:350](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L350) + +Records that the given `QueryObserverResult` property was read, so a subsequent update only +notifies this observer if a tracked property actually changed. Normally called indirectly via +[QueryObserver#trackResult](QueryObserver.md#trackresult)'s proxy; exposed directly for adapters that track property +access themselves (e.g. through their own reactivity system) instead of via the proxy. + +#### Parameters + +##### key + +`"error"` | `"data"` | `"isError"` | `"isPending"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isSuccess"` | `"isPlaceholderData"` | `"status"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`trackProp`](QueryObserver.md#trackprop) + +*** + +### trackResult() + +```ts +trackResult(result, onPropTracked?): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:331](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L331) + +Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via +[QueryObserver#trackProp](QueryObserver.md#trackprop) (and an optional `onPropTracked` callback). Used by framework +adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on +properties you actually read" behavior. + +#### Parameters + +##### result + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +##### onPropTracked? + +(`key`) => `void` + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`trackResult`](QueryObserver.md#trackresult) + +*** + +### updateResult() + +```ts +updateResult(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L735) + +Recomputes and stores the current result from the current query/options, notifying listeners +if it changed. Framework adapters call this right after subscribing to make sure no query +update was missed in the gap between creating the observer and subscribing to it. + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`updateResult`](QueryObserver.md#updateresult) diff --git a/docs/framework/react/reference/classes/Mutation.md b/docs/framework/react/reference/classes/Mutation.md new file mode 100644 index 00000000000..4e85a5b2d4c --- /dev/null +++ b/docs/framework/react/reference/classes/Mutation.md @@ -0,0 +1,329 @@ +--- +id: Mutation +title: Mutation +--- + +Defined in: [packages/query-core/src/mutation.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L135) + +Represents a single mutation attempt. A `Mutation` holds the mutation's +options, state (data/error/status), and the `MutationObserver`s currently +subscribed to it. + +Instances are created and managed internally by `MutationCache`; application +code typically interacts with mutations indirectly through `QueryClient` or +a framework hook like `useMutation`. Direct access to a `Mutation` instance +is possible via `mutationCache.find()`/`getAll()` for inspecting cache state. + +## Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +``` + +## Extends + +- `Removable` + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Constructors + +### Constructor + +```ts +new Mutation(config): Mutation; +``` + +Defined in: [packages/query-core/src/mutation.ts:152](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L152) + +#### Parameters + +##### config + +`MutationConfig`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`Mutation`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Overrides + +```ts +Removable.constructor +``` + +## Properties + +### gcTime + +```ts +gcTime: number; +``` + +Defined in: [packages/query-core/src/removable.ts:7](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L7) + +#### Inherited from + +```ts +Removable.gcTime +``` + +*** + +### mutationId + +```ts +readonly mutationId: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:143](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L143) + +*** + +### options + +```ts +options: MutationOptions; +``` + +Defined in: [packages/query-core/src/mutation.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L142) + +*** + +### state + +```ts +state: MutationState; +``` + +Defined in: [packages/query-core/src/mutation.ts:141](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L141) + +## Accessors + +### meta + +#### Get Signature + +```ts +get meta(): Record | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:179](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L179) + +The `meta` object passed in the mutation's options, if any. + +##### Returns + +`Record`\<`string`, `unknown`\> \| `undefined` + +## Methods + +### clearGcTimeout() + +```ts +protected clearGcTimeout(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L32) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.clearGcTimeout +``` + +*** + +### continue() + +```ts +continue(): Promise; +``` + +Defined in: [packages/query-core/src/mutation.ts:243](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L243) + +Resumes a mutation that is currently paused or was restored from a +dehydrated, still-`pending` state. + +- If this mutation has an active retryer (it paused mid-attempt, e.g. due + to the network mode or scope-based queuing), its retryer is resumed. +- Otherwise, if the mutation's status is still `pending` (e.g. it was + dehydrated while an attempt was in flight and never got a retryer in + this instance), `execute` is called again with the last known variables. +- Otherwise the mutation has already settled and this resolves immediately + without running anything again. + +#### Returns + +`Promise`\<`unknown`\> + +#### Example + +```ts +// typically driven by reconnect handling, e.g. queryClient.resumePausedMutations() +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +await mutation?.continue() +``` + +#### See + +[Mutation#execute](#execute) + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:10](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L10) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.destroy +``` + +*** + +### execute() + +```ts +execute(variables): Promise; +``` + +Defined in: [packages/query-core/src/mutation.ts:283](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L283) + +Runs the mutation function for the given variables through a retryer, and +drives the mutation's state and lifecycle callbacks through to settlement. + +If this mutation's state is already `pending` when `execute` is called +(i.e. it was restored, still in-flight, from a dehydrated state), the +`onMutate` step is skipped and a `continue` action is dispatched to +unpause it; otherwise a `pending` action is dispatched first, then the +mutation cache's `onMutate` and the mutation's own `onMutate` option are +awaited in that order, and the resulting context is stored. + +The mutation function is then run (subject to `retry`/`retryDelay`/ +`networkMode`, and to the mutation cache's scope-based serialization). +On success, the cache's `onSuccess`/`onSettled` callbacks run before the +mutation's own `onSuccess`/`onSettled` options, a `success` action is +dispatched, and the resolved data is returned. On failure, the same +cache-then-option ordering is used for `onError`/`onSettled`, but each of +those four callbacks is individually caught so that a throwing callback +cannot mask the original error; an `error` action is then dispatched and +the original error is re-thrown. + +#### Parameters + +##### variables + +`TVariables` + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +// typically invoked by MutationObserver.mutate, not called directly +const data = await mutation.execute(variables) +``` + +#### See + +[Mutation#continue](#continue) + +*** + +### optionalRemove() + +```ts +protected optionalRemove(): void; +``` + +Defined in: [packages/query-core/src/mutation.ts:212](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L212) + +#### Returns + +`void` + +#### Overrides + +```ts +Removable.optionalRemove +``` + +*** + +### scheduleGc() + +```ts +protected scheduleGc(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L14) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.scheduleGc +``` + +*** + +### updateGcTime() + +```ts +protected updateGcTime(newGcTime): void; +``` + +Defined in: [packages/query-core/src/removable.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L24) + +#### Parameters + +##### newGcTime + +`number` | `undefined` + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.updateGcTime +``` diff --git a/docs/framework/react/reference/classes/MutationCache.md b/docs/framework/react/reference/classes/MutationCache.md new file mode 100644 index 00000000000..f79919b1c4b --- /dev/null +++ b/docs/framework/react/reference/classes/MutationCache.md @@ -0,0 +1,308 @@ +--- +id: MutationCache +title: MutationCache +--- + +Defined in: [packages/query-core/src/mutationCache.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L117) + +The `MutationCache` is the storage for mutations. + +Normally, you will not interact with the `MutationCache` directly and instead use a +`QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of +safe/known updates to the cache, such as mutations being added, removed, or updated. + +## Extends + +- `Subscribable`\<`MutationCacheListener`\> + +## Constructors + +### Constructor + +```ts +new MutationCache(config): MutationCache; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) + +#### Parameters + +##### config + +[`MutationCacheConfig`](../interfaces/MutationCacheConfig.md) = `{}` + +#### Returns + +`MutationCache` + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### config + +```ts +config: MutationCacheConfig = {}; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) + +*** + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:229](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L229) + +Removes all mutations from the cache. + +#### Returns + +`void` + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +mutationCache.clear() +``` + +*** + +### find() + +```ts +find(filters): + | Mutation + | undefined; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L271) + +A slightly more advanced method that can be used to get an existing mutation instance from +the cache. If the mutation does not exist, `undefined` is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about a mutation in rare scenarios. + +#### Type Parameters + +##### TData + +`TData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TVariables + +`TVariables` = `any` + +##### TOnMutateResult + +`TOnMutateResult` = `unknown` + +#### Parameters + +##### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) + +#### Returns + + \| [`Mutation`](Mutation.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + \| `undefined` + +#### See + +[MutationCache#findAll](#findall) + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +``` + +*** + +### findAll() + +```ts +findAll(filters): Mutation[]; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:301](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L301) + +An even more advanced method that can be used to get existing mutation instances from the +cache that match the given filters. If no mutations match, an empty array is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about mutations in rare scenarios. + +#### Parameters + +##### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) = `{}` + +#### Returns + +[`Mutation`](Mutation.md)\<`unknown`, `Error`, `unknown`, `unknown`\>[] + +#### See + +[MutationCache#find](#find) + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutations = mutationCache.findAll({ mutationKey: ['addPost'] }) +``` + +*** + +### getAll() + +```ts +getAll(): Mutation[]; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:252](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L252) + +Returns all mutations within the cache. + +This is not typically needed for most applications, but can come in handy when needing more +information about a mutation in rare scenarios. + +#### Returns + +[`Mutation`](Mutation.md)\<`unknown`, `Error`, `unknown`, `unknown`\>[] + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutations = mutationCache.getAll() +``` + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L23) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L27) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`MutationCacheListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/react/reference/classes/MutationObserver.md b/docs/framework/react/reference/classes/MutationObserver.md new file mode 100644 index 00000000000..a121c67b0e8 --- /dev/null +++ b/docs/framework/react/reference/classes/MutationObserver.md @@ -0,0 +1,335 @@ +--- +id: MutationObserver +title: MutationObserver +--- + +Defined in: [packages/query-core/src/mutationObserver.ts:38](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L38) + +Observes a single mutation and derives a `MutationObserverResult` from it. +A framework hook like `useMutation` creates one `MutationObserver` per hook +call, keeps it stable across re-renders, calls `setOptions` when the options +passed to the hook change, subscribes to it to re-render on updates, and +reads `getCurrentResult()` for the value to return. Calling `mutate()` +builds a new underlying `Mutation` in the `MutationCache` and executes it. + +## Example + +```ts +const observer = new MutationObserver(queryClient, { + mutationFn: (variables: { title: string }) => addPost(variables), +}) +``` + +## Extends + +- `Subscribable`\<`MutationObserverListener`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Constructors + +### Constructor + +```ts +new MutationObserver(client, options): MutationObserver; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:58](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L58) + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`MutationObserver`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Overrides + +```ts +Subscribable< + MutationObserverListener +>.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +*** + +### options + +```ts +options: MutationObserverOptions; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:46](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L46) + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L75) + +#### Returns + +`void` + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): MutationObserverResult; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:155](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L155) + +Returns the observer's current result, derived from the observed +mutation's state (or the default, `idle` state if no mutation has been +built yet, e.g. before the first `mutate()` call or after `reset()`). + +#### Returns + +[`MutationObserverResult`](../type-aliases/MutationObserverResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### mutate() + +```ts +mutate(variables, options?): Promise; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:207](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L207) + +Builds a new `Mutation` in the `MutationCache` using the observer's +current options, detaches this observer from any previously observed +mutation, attaches it to the new one, and executes it with the given +variables. + +The optional per-call `options` (`onSuccess`/`onError`/`onSettled`) are +invoked once the mutation settles, in addition to any callbacks defined +on the observer's own options. + +#### Parameters + +##### variables + +`TVariables` + +##### options? + +[`MutateOptions`](../interfaces/MutateOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +await observer.mutate( + { title: 'New post' }, + { onSuccess: (data) => console.log(data) }, +) +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L127) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L135) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### reset() + +```ts +reset(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L180) + +Detaches the observer from the mutation it is currently observing (if +any) and resets the observed result back to its default, `idle` state. + +This does not cancel an in-flight mutation; the mutation itself keeps +running to completion and its own callbacks still fire, but this +observer stops reflecting its state and a subsequent `mutate()` call +will build a brand new mutation. + +#### Returns + +`void` + +#### Example + +```ts +observer.reset() +``` + +#### See + +[MutationObserver#mutate](#mutate) + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L96) + +Updates the observer's options. + +If the new `mutationKey` differs from the previous one (and both were +defined), the observer is reset, detaching it from the mutation it was +observing. Otherwise, if the currently observed mutation is still +`pending`, its options are updated in place as well. + +#### Parameters + +##### options + +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setOptions({ + mutationFn: (variables: { title: string }) => addPost(variables), + onSuccess: (data) => console.log(data), +}) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`MutationObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/react/reference/classes/QueriesObserver.md b/docs/framework/react/reference/classes/QueriesObserver.md new file mode 100644 index 00000000000..a40f2d2bef6 --- /dev/null +++ b/docs/framework/react/reference/classes/QueriesObserver.md @@ -0,0 +1,325 @@ +--- +id: QueriesObserver +title: QueriesObserver +--- + +Defined in: [packages/query-core/src/queriesObserver.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L54) + +A `QueriesObserver` watches an array of queries at once, exposing them as +a single array of `QueryObserverResult`s (or, when a `combine` option is +given, as a combined value derived from that array). It manages one +internal `QueryObserver` per query, and is the primitive that framework +adapters (e.g. `useQueries`) build their hooks on top of. + +## Example + +```ts +const observer = new QueriesObserver(queryClient, [ + { queryKey: ['post', 1], queryFn: fetchPost }, + { queryKey: ['post', 2], queryFn: fetchPost }, +]) + +const unsubscribe = observer.subscribe((result) => { + console.log(result) +}) +``` + +## Extends + +- `Subscribable`\<`QueriesObserverListener`\> + +## Type Parameters + +### TCombinedResult + +`TCombinedResult` = [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +## Constructors + +### Constructor + +```ts +new QueriesObserver( + client, + queries, +options?): QueriesObserver; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L68) + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`any`, `any`, `any`, `any`, `any`, `never`\>[] + +##### options? + +[`QueriesObserverOptions`](../interfaces/QueriesObserverOptions.md)\<`TCombinedResult`\> + +#### Returns + +`QueriesObserver`\<`TCombinedResult`\> + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L104) + +Stops observing all queries: clears all listeners and destroys every +underlying `QueryObserver` this observer manages. + +#### Returns + +`void` + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): QueryObserverResult[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L208) + +Returns the most recently computed array of `QueryObserverResult`s, one +per observed query, in the same order as the queries passed to the +constructor or `setQueries`. + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +#### Example + +```ts +const results = observer.getCurrentResult() +const data = results.map((result) => result.data) +``` + +*** + +### getObservers() + +```ts +getObservers(): QueryObserver[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L225) + +Returns the underlying `QueryObserver` instances this observer manages, +in the same order as the queries passed to the constructor or +`setQueries`. + +#### Returns + +[`QueryObserver`](QueryObserver.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[]\>[] + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(queries, combine): [QueryObserverResult[], (r?) => TCombinedResult, () => QueryObserverResult[]]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L236) + +The `QueriesObserver` counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult) — computes +the result for the given (already-defaulted) queries right now, synchronously. Called by +framework adapters (e.g. `useQueries`) ahead of subscribing, returning a tuple of the raw +per-query results, a function to compute the combined result from them, and a function to +wrap the results for property-access tracking. + +#### Parameters + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[], `never`\>[] + +##### combine + +`CombineFn`\<`TCombinedResult`\> | `undefined` + +#### Returns + +\[[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[], (`r?`) => `TCombinedResult`, () => [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[]\] + +*** + +### getQueries() + +```ts +getQueries(): Query[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:216](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L216) + +Returns the underlying `Query` instances currently being observed, in +the same order as the queries passed to the constructor or `setQueries`. + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L84) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L94) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setQueries() + +```ts +setQueries(queries, options?): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:125](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L125) + +Replaces the set of queries being observed. Existing `QueryObserver`s +are reused for queries that match an already-observed query hash; +observers for queries that are no longer present are destroyed, and new +observers are created and subscribed to for newly added queries. + +#### Parameters + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[], `never`\>[] + +##### options? + +[`QueriesObserverOptions`](../interfaces/QueriesObserverOptions.md)\<`TCombinedResult`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setQueries([ + { queryKey: ['post', 1], queryFn: fetchPost }, + { queryKey: ['post', 3], queryFn: fetchPost }, +]) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueriesObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/react/reference/classes/Query.md b/docs/framework/react/reference/classes/Query.md new file mode 100644 index 00000000000..bc15461e541 --- /dev/null +++ b/docs/framework/react/reference/classes/Query.md @@ -0,0 +1,585 @@ +--- +id: Query +title: Query +--- + +Defined in: [packages/query-core/src/query.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L225) + +Represents a single cached query. A `Query` holds the query's key, options, +state (data/error/status), and the observers currently subscribed to it. + +Instances are created and managed internally by `QueryCache`; application +code typically interacts with queries indirectly through `QueryClient` or +a framework hook like `useQuery`. Direct access to a `Query` instance is +possible via `queryCache.find()`/`findAll()` for inspecting cache state. + +## Example + +```ts +const queryCache = queryClient.getQueryCache() +const query = queryCache.find({ queryKey: ['posts'] }) + +if (query) { + console.log(query.state.dataUpdatedAt) +} +``` + +## Extends + +- `Removable` + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Constructors + +### Constructor + +```ts +new Query(config): Query; +``` + +Defined in: [packages/query-core/src/query.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L246) + +#### Parameters + +##### config + +`QueryConfig`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Query`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Overrides + +```ts +Removable.constructor +``` + +## Properties + +### gcTime + +```ts +gcTime: number; +``` + +Defined in: [packages/query-core/src/removable.ts:7](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L7) + +#### Inherited from + +```ts +Removable.gcTime +``` + +*** + +### observers + +```ts +observers: QueryObserver[]; +``` + +Defined in: [packages/query-core/src/query.ts:242](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L242) + +*** + +### options + +```ts +options: QueryOptions; +``` + +Defined in: [packages/query-core/src/query.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L233) + +*** + +### queryHash + +```ts +queryHash: string; +``` + +Defined in: [packages/query-core/src/query.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L232) + +*** + +### queryKey + +```ts +queryKey: TQueryKey; +``` + +Defined in: [packages/query-core/src/query.ts:231](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L231) + +*** + +### state + +```ts +state: QueryState; +``` + +Defined in: [packages/query-core/src/query.ts:234](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L234) + +## Accessors + +### meta + +#### Get Signature + +```ts +get meta(): Record | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L264) + +The `meta` object passed in the query's options, if any. + +##### Returns + +`Record`\<`string`, `unknown`\> \| `undefined` + +*** + +### promise + +#### Get Signature + +```ts +get promise(): Promise | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L277) + +The promise for the currently in-flight fetch, if the query is fetching. +`undefined` when the query is not fetching. + +##### Returns + +`Promise`\<`TData`\> \| `undefined` + +## Methods + +### cancel() + +```ts +cancel(options?): Promise; +``` + +Defined in: [packages/query-core/src/query.ts:348](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L348) + +Cancels the query's currently in-flight fetch, if any. +- Returns a promise that resolves once the cancellation has settled. +- If no fetch is in progress, resolves immediately. + +#### Parameters + +##### options? + +[`CancelOptions`](../interfaces/CancelOptions.md) + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await query.cancel() +``` + +*** + +### clearGcTimeout() + +```ts +protected clearGcTimeout(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L32) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.clearGcTimeout +``` + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/query.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L361) + +Clears the query's garbage collection timeout and silently cancels any +in-flight fetch. Called by `QueryCache` when the query is removed from +the cache. + +#### Returns + +`void` + +#### See + +[Query#cancel](#cancel) + +#### Overrides + +```ts +Removable.destroy +``` + +*** + +### fetch() + +```ts +fetch(options?, fetchOptions?): Promise; +``` + +Defined in: [packages/query-core/src/query.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L590) + +Fetches the query, i.e. runs its `queryFn` (through any configured +retryer/behavior) and updates the query's state with the result. +- If a fetch is already in flight, returns its promise instead of + starting a new one, unless `fetchOptions.cancelRefetch` is set and the + query already has data, in which case the current fetch is silently + cancelled first. +- If `options` is passed, it replaces the query's current options + before fetching. + +#### Parameters + +##### options? + +[`QueryOptions`](../interfaces/QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\> + +##### fetchOptions? + +`FetchOptions`\<`TQueryFnData`\> + +#### Returns + +`Promise`\<`TData`\> + +*** + +### getObserversCount() + +```ts +getObserversCount(): number; +``` + +Defined in: [packages/query-core/src/query.ts:560](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L560) + +Returns the number of observers currently subscribed to this query. + +#### Returns + +`number` + +#### Example + +```ts +if (query.getObserversCount() === 0) { + // no component is currently watching this query +} +``` + +*** + +### invalidate() + +```ts +invalidate(): void; +``` + +Defined in: [packages/query-core/src/query.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L574) + +Marks the query as invalidated, unless it is already invalidated. This +updates `state.isInvalidated` and notifies observers, but does not by +itself trigger a refetch. + +#### Returns + +`void` + +#### Example + +```ts +query.invalidate() +``` + +*** + +### isActive() + +```ts +isActive(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:386](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L386) + +Returns `true` if the query has at least one observer for which `enabled` +does not resolve to `false`. + +#### Returns + +`boolean` + +*** + +### isDisabled() + +```ts +isDisabled(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:400](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L400) + +Returns `true` if the query is disabled, meaning it will not fetch +automatically. +- If the query has observers, it is disabled when none of them are active + (see `isActive`). +- If the query has no observers, it is disabled when its `queryFn` is + `skipToken` or it has never been fetched. + +#### Returns + +`boolean` + +*** + +### isFetched() + +```ts +isFetched(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:412](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L412) + +Returns `true` if the query has been fetched, i.e. it has resolved with +either data or an error at least once. + +#### Returns + +`boolean` + +*** + +### isStale() + +```ts +isStale(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:447](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L447) + +Returns `true` if the query is stale. +- If the query has observers, defers to whether any observer's current + result reports `isStale` (which accounts for each observer's own + `staleTime` and `enabled` state). +- If the query has no observers, it is considered stale when it has no + data or has been invalidated. + +#### Returns + +`boolean` + +#### See + +[Query#isStaleByTime](#isstalebytime) + +#### Example + +```ts +if (query.isStale()) { + // refetch or otherwise treat the cached data as outdated +} +``` + +*** + +### isStaleByTime() + +```ts +isStaleByTime(staleTime): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:473](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L473) + +Returns `true` if the query's data is stale relative to the given +`staleTime` (defaults to `0`). +- A query with no data is always stale. +- `staleTime: 'static'` is never stale. +- An invalidated query is always stale. +- Otherwise, staleness is based on elapsed time since `dataUpdatedAt`. + +#### Parameters + +##### staleTime + +[`StaleTime`](../type-aliases/StaleTime.md) = `0` + +#### Returns + +`boolean` + +#### See + +[Query#isStale](#isstale) + +#### Example + +```ts +const isStale = query.isStaleByTime(1000 * 60) +``` + +*** + +### isStatic() + +```ts +isStatic(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:420](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L420) + +Returns `true` if the query has at least one observer configured with +`staleTime: 'static'`, meaning it is treated as never stale. + +#### Returns + +`boolean` + +*** + +### optionalRemove() + +```ts +protected optionalRemove(): void; +``` + +Defined in: [packages/query-core/src/query.ts:305](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L305) + +#### Returns + +`void` + +#### Overrides + +```ts +Removable.optionalRemove +``` + +*** + +### reset() + +```ts +reset(): void; +``` + +Defined in: [packages/query-core/src/query.ts:377](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L377) + +Resets the query back to its initial state (the state it had when it was +first created, e.g. any `initialData`), destroying it first to cancel any +in-flight fetch. + +#### Returns + +`void` + +*** + +### scheduleGc() + +```ts +protected scheduleGc(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L14) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.scheduleGc +``` + +*** + +### setState() + +```ts +setState(state): void; +``` + +Defined in: [packages/query-core/src/query.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L334) + +Merges the given partial state directly into this query's state, notifying observers. Used +by persistence and broadcast plugins to restore a state snapshot, and by devtools to let a +user manually trigger a loading/error state or edit the cached data. + +#### Parameters + +##### state + +`Partial`\<[`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\>\> + +#### Returns + +`void` + +*** + +### updateGcTime() + +```ts +protected updateGcTime(newGcTime): void; +``` + +Defined in: [packages/query-core/src/removable.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L24) + +#### Parameters + +##### newGcTime + +`number` | `undefined` + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.updateGcTime +``` diff --git a/docs/framework/react/reference/classes/QueryCache.md b/docs/framework/react/reference/classes/QueryCache.md new file mode 100644 index 00000000000..8e435445b2c --- /dev/null +++ b/docs/framework/react/reference/classes/QueryCache.md @@ -0,0 +1,461 @@ +--- +id: QueryCache +title: QueryCache +--- + +Defined in: [packages/query-core/src/queryCache.ts:113](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L113) + +The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta +information, and state of the queries it contains. + +Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient` +for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of +safe/known updates to the cache, such as queries being added, removed, or updated. + +## Extends + +- `Subscribable`\<`QueryCacheListener`\> + +## Constructors + +### Constructor + +```ts +new QueryCache(config): QueryCache; +``` + +Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) + +#### Parameters + +##### config + +[`QueryCacheConfig`](../interfaces/QueryCacheConfig.md) = `{}` + +#### Returns + +`QueryCache` + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### config + +```ts +config: QueryCacheConfig = {}; +``` + +Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) + +*** + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### build() + +```ts +build( + client, + options, +state?): Query; +``` + +Defined in: [packages/query-core/src/queryCache.ts:137](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L137) + +Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or +builds and adds a new one to the cache if none exists yet. Used by framework adapters and +plugins (e.g. broadcast/persistence) that need to get-or-create a `Query` directly, bypassing +the reactive `QueryObserver` machinery. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](../interfaces/QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\>, `"queryKey"`\> + +##### state? + +[`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\> + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const query = queryCache.build(queryClient, { + queryKey: ['posts'], + queryFn: fetchPosts, +}) +``` + +*** + +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:222](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L222) + +Removes all queries from the cache. + +#### Returns + +`void` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +queryCache.clear() +``` + +*** + +### find() + +```ts +find(filters): + | Query + | undefined; +``` + +Defined in: [packages/query-core/src/queryCache.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L289) + +A slightly more advanced method that can be used to get an existing query instance from the +cache. This instance not only contains all the state for the query, but all of the instances, +and underlying guts of the query as well. If the query does not exist, `undefined` is +returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about a query in rare scenarios (e.g. looking at `query.state.dataUpdatedAt` to +decide whether a query is fresh enough to be used as an initial value). + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +#### Parameters + +##### filters + +[`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryFilters`](../interfaces/QueryFilters.md)\, `"queryKey"`\> + +#### Returns + + \| [`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, readonly `unknown`[]\> + \| `undefined` + +#### See + +[QueryCache#findAll](#findall) + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const query = queryCache.find({ queryKey: ['posts'] }) +``` + +*** + +### findAll() + +```ts +findAll(filters): Query[]; +``` + +Defined in: [packages/query-core/src/queryCache.ts:314](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L314) + +An even more advanced method that can be used to get existing query instances from the cache +that partially match a query key. If no queries match, an empty array is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about queries in rare scenarios. + +#### Parameters + +##### filters + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = `{}` + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +#### See + +[QueryCache#find](#find) + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const queries = queryCache.findAll({ queryKey: ['posts'] }) +``` + +*** + +### get() + +```ts +get(queryHash): + | Query + | undefined; +``` + +Defined in: [packages/query-core/src/queryCache.ts:244](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L244) + +Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none +exists. Unlike [QueryCache#find](#find), this looks up by the already-computed hash rather +than by `QueryFilters`. Used by plugins (e.g. broadcast/hydration) that already have a hash +to look up directly. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### queryHash + +`string` + +#### Returns + + \| [`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + \| `undefined` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() +const queryHash = hashKey(['posts']) + +const query = queryCache.get(queryHash) +``` + +*** + +### getAll() + +```ts +getAll(): Query[]; +``` + +Defined in: [packages/query-core/src/queryCache.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L267) + +Returns all queries within the cache. + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const queries = queryCache.getAll() +``` + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L23) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L27) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### remove() + +```ts +remove(query): void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:198](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L198) + +Destroys the given `Query` and removes it from the cache, notifying subscribers with a +`'removed'` event. A no-op if the query is no longer the one currently stored under its hash +(e.g. it was already replaced). Used by plugins (e.g. the broadcast client) that mirror +removals across `QueryCache` instances. + +#### Parameters + +##### query + +[`Query`](Query.md)\<`any`, `any`, `any`, `any`\> + +#### Returns + +`void` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() +const query = queryCache.find({ queryKey: ['posts'] }) + +if (query) { + queryCache.remove(query) +} +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueryCacheListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/react/reference/classes/QueryClient.md b/docs/framework/react/reference/classes/QueryClient.md new file mode 100644 index 00000000000..03250c00243 --- /dev/null +++ b/docs/framework/react/reference/classes/QueryClient.md @@ -0,0 +1,1455 @@ +--- +id: QueryClient +title: QueryClient +--- + +Defined in: [packages/query-core/src/queryClient.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L78) + +`QueryClient` is used to interact with a cache of queries and mutations. It owns a +`QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds +the default options that are applied to queries and mutations created through it. + +```ts +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + staleTime: Infinity, + }, + }, +}) + +await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts }) +``` + +## Constructors + +### Constructor + +```ts +new QueryClient(config): QueryClient; +``` + +Defined in: [packages/query-core/src/queryClient.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L88) + +#### Parameters + +##### config + +[`QueryClientConfig`](../interfaces/QueryClientConfig.md) = `{}` + +#### Returns + +`QueryClient` + +## Methods + +### cancelQueries() + +```ts +cancelQueries(filters?, cancelOptions?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L425) + +Cancels outgoing fetches for queries matching the given filters. Most useful when performing +optimistic updates, since any outgoing refetch that resolves afterwards would otherwise +overwrite the optimistic update. By default (`revert: true`), a cancelled query's data is +reverted to its state before the outgoing fetch started. + +The returned promise never rejects, even if individual cancellations fail. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +##### cancelOptions? + +[`CancelOptions`](../interfaces/CancelOptions.md) = `{}` + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.cancelQueries({ queryKey: ['posts'], exact: true }) +``` + +*** + +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1073) + +Clears both the query cache and the mutation cache this client is connected to. + +#### Returns + +`void` + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +queryClient.clear() +``` + +*** + +### defaultMutationOptions() + +```ts +defaultMutationOptions(options?): T; +``` + +Defined in: [packages/query-core/src/queryClient.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1047) + +The mutation counterpart of [QueryClient#defaultQueryOptions](#defaultqueryoptions). Called by framework +adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the +given `mutationKey`, then the client's `defaultOptions.mutations`, then the caller's options +on top. A no-op if the options are already defaulted (`_defaulted: true`). + +#### Type Parameters + +##### T + +`T` *extends* [`MutationOptions`](../interfaces/MutationOptions.md)\<`any`, `any`, `any`, `any`\> + +#### Parameters + +##### options? + +`T` + +#### Returns + +`T` + +*** + +### defaultQueryOptions() + +```ts +defaultQueryOptions(options): DefaultedQueryObserverOptions; +``` + +Defined in: [packages/query-core/src/queryClient.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L960) + +Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the +caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the +given `queryKey`, then the client's own `defaultOptions.queries`, then the caller's options +on top. A no-op if the options are already defaulted (`_defaulted: true`). + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\> | [`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +*** + +### ~~ensureInfiniteQueryData()~~ + +```ts +ensureInfiniteQueryData(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryClient.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L725) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`EnsureInfiniteQueryDataOptions`](../type-aliases/EnsureInfiniteQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\> + +#### Deprecated + +Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version. + +*** + +### ~~ensureQueryData()~~ + +```ts +ensureQueryData(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L196) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### options + +[`EnsureQueryDataOptions`](../interfaces/EnsureQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Deprecated + +Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version. + +*** + +### ~~fetchInfiniteQuery()~~ + +```ts +fetchInfiniteQuery(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryClient.ts:682](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L682) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\> + +#### Deprecated + +Use queryClient.infiniteQuery(options) instead. This method will be removed in the next major version. + +*** + +### ~~fetchQuery()~~ + +```ts +fetchQuery(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L590) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Deprecated + +Use queryClient.query(options) instead. This method will be removed in the next major version. + +*** + +### getDefaultOptions() + +```ts +getDefaultOptions(): DefaultOptions; +``` + +Defined in: [packages/query-core/src/queryClient.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L808) + +Returns the default options that were set when creating the client, or via +[QueryClient#setDefaultOptions](#setdefaultoptions). + +#### Returns + +[`DefaultOptions`](../interfaces/DefaultOptions.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const defaultOptions = queryClient.getDefaultOptions() +``` + +*** + +### getMutationCache() + +```ts +getMutationCache(): MutationCache; +``` + +Defined in: [packages/query-core/src/queryClient.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L792) + +Returns the mutation cache this client is connected to. + +#### Returns + +[`MutationCache`](MutationCache.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const mutationCache = queryClient.getMutationCache() +const mutations = mutationCache.findAll({ status: 'pending' }) +``` + +*** + +### getMutationDefaults() + +```ts +getMutationDefaults(mutationKey): OmitKeyof, "mutationKey">; +``` + +Defined in: [packages/query-core/src/queryClient.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L935) + +Returns the default options registered for mutations whose mutation key partially matches +the given `mutationKey`, via [QueryClient#setMutationDefaults](#setmutationdefaults). If multiple registered +defaults match, they are merged together in registration order. + +#### Parameters + +##### mutationKey + +readonly `unknown`[] + +#### Returns + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`any`, `any`, `any`, `any`\>, `"mutationKey"`\> + +#### Example + +```ts +const defaultOptions = queryClient.getMutationDefaults(['addPost']) +``` + +*** + +### getQueriesData() + +```ts +getQueriesData(filters): [readonly unknown[], TQueryFnData | undefined][]; +``` + +Defined in: [packages/query-core/src/queryClient.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L233) + +Imperative (non-reactive) way to retrieve the cached data of multiple queries at once. +Only queries matching the given filters are returned; if none match, an empty array is +returned. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters + +`TQueryFilters` + +#### Returns + +\[readonly `unknown`[], `TQueryFnData` \| `undefined`\][] + +#### See + +[QueryClient#getQueryData](#getquerydata) + +#### Example + +```ts +const data = queryClient.getQueriesData({ queryKey: ['posts'] }) +``` + +*** + +### getQueryCache() + +```ts +getQueryCache(): QueryCache; +``` + +Defined in: [packages/query-core/src/queryClient.ts:776](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L776) + +Returns the query cache this client is connected to. + +#### Returns + +[`QueryCache`](QueryCache.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const queryCache = queryClient.getQueryCache() +const queries = queryCache.findAll({ queryKey: ['posts'] }) +``` + +*** + +### getQueryData() + +```ts +getQueryData(queryKey): TInferredQueryFnData | undefined; +``` + +Defined in: [packages/query-core/src/queryClient.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L182) + +Imperative (non-reactive) way to retrieve data for a QueryKey. +Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. + +Hint: Do not use this function inside a component, because it won't receive updates. +Use `useQuery` to create a `QueryObserver` that subscribes to changes. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +#### Returns + +`TInferredQueryFnData` \| `undefined` + +#### See + +[QueryClient#getQueriesData](#getqueriesdata) + +*** + +### getQueryDefaults() + +```ts +getQueryDefaults(queryKey): OmitKeyof, "queryKey">; +``` + +Defined in: [packages/query-core/src/queryClient.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L878) + +Returns the default options registered for queries whose query key partially matches the +given `queryKey`, via [QueryClient#setQueryDefaults](#setquerydefaults). If multiple registered defaults +match, they are merged together in registration order. + +#### Parameters + +##### queryKey + +readonly `unknown`[] + +#### Returns + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`any`, `any`, `any`, `any`, `any`\>, `"queryKey"`\> + +#### Example + +```ts +const defaultOptions = queryClient.getQueryDefaults(['posts']) +``` + +*** + +### getQueryState() + +```ts +getQueryState(queryKey): + | QueryState + | undefined; +``` + +Defined in: [packages/query-core/src/queryClient.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L343) + +Imperative (non-reactive) way to retrieve an existing query's state. If the query does not +exist, `undefined` is returned. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +##### TInferredError + +`TInferredError` = [`InferErrorFromTag`](../type-aliases/InferErrorFromTag.md)\<`TError`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +#### Returns + + \| [`QueryState`](../interfaces/QueryState.md)\<`TInferredQueryFnData`, `TInferredError`\> + \| `undefined` + +#### Example + +```ts +const state = queryClient.getQueryState(['posts']) +console.log(state?.dataUpdatedAt) +``` + +*** + +### infiniteQuery() + +```ts +infiniteQuery(options): Promise[] ? InfiniteData : TData>; +``` + +Defined in: [packages/query-core/src/queryClient.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L656) + +Asynchronous method to fetch and cache an infinite query, resolving with an +[InfiniteData](../interfaces/InfiniteData.md) object or throwing with the error. + +Behaves like [QueryClient#query](#query), accepting the same options (minus +`initialPageParam`), plus the required `initialPageParam`, and an optional `pages` / +`getNextPageParam` pair used to refetch a fixed number of pages from the start. + +This method replaces the deprecated `fetchInfiniteQuery`, and — combined with +`{ staleTime: 'static' }` — the deprecated `ensureInfiniteQueryData`. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`InfiniteQueryExecuteOptions`](../type-aliases/InfiniteQueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`[] *extends* [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>[] ? [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\> : `TData`\> + +#### Example + +```ts +try { + const data = await queryClient.infiniteQuery({ queryKey, queryFn, initialPageParam: 0 }) + console.log(data.pages) +} catch (error) { + console.log(error) +} +``` + +*** + +### invalidateQueries() + +```ts +invalidateQueries(filters?, options?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:453](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L453) + +Marks queries matching the given filters as invalidated. Unlike +[QueryClient#removeQueries](#removequeries), invalidated queries stay in the cache. + +Unless `filters.refetchType` is `'none'`, matching queries are then refetched via +[QueryClient#refetchQueries](#refetchqueries), using `filters.refetchType` if set, otherwise +`filters.type`, otherwise `'active'`. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`InvalidateQueryFilters`](../interfaces/InvalidateQueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`InvalidateOptions`](../interfaces/InvalidateOptions.md) = `{}` + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' }) +``` + +*** + +### isFetching() + +```ts +isFetching(filters?): number; +``` + +Defined in: [packages/query-core/src/queryClient.ts:149](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L149) + +Returns the number of queries in the cache that are currently fetching, optionally +matching a set of filters. This includes background-fetching, loading new pages, and +loading more infinite query results. + +#### Type Parameters + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters? + +`TQueryFilters` + +#### Returns + +`number` + +#### Example + +```ts +if (queryClient.isFetching()) { + console.log('At least one query is fetching!') +} +``` + +*** + +### isMutating() + +```ts +isMutating(filters?): number; +``` + +Defined in: [packages/query-core/src/queryClient.ts:167](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L167) + +Returns the number of mutations in the cache that are currently pending, optionally +matching a set of filters. + +#### Type Parameters + +##### TMutationFilters + +`TMutationFilters` *extends* [`MutationFilters`](../interfaces/MutationFilters.md)\<`any`, `any`, `unknown`, `unknown`\> = [`MutationFilters`](../interfaces/MutationFilters.md)\<`unknown`, `Error`, `unknown`, `unknown`\> + +#### Parameters + +##### filters? + +`TMutationFilters` + +#### Returns + +`number` + +#### Example + +```ts +if (queryClient.isMutating()) { + console.log('At least one mutation is pending!') +} +``` + +*** + +### mount() + +```ts +mount(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L103) + +Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start +listening for focus/online events and resume paused mutations. Ref-counted via an internal +mount count, so nested or multiple providers sharing the same `QueryClient` don't tear down +the shared listeners until the last one unmounts. + +#### Returns + +`void` + +*** + +### ~~prefetchInfiniteQuery()~~ + +```ts +prefetchInfiniteQuery(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L704) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`void`\> + +#### Deprecated + +Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version. + +*** + +### ~~prefetchQuery()~~ + +```ts +prefetchQuery(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:624](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L624) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### options + +[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Promise`\<`void`\> + +#### Deprecated + +Use queryClient.query(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version. + +*** + +### query() + +```ts +query(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:544](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L544) + +Asynchronous method to fetch and cache a query, resolving with the data or throwing with +the error. + +If the query already exists in the cache and its data is not stale (per the given +`staleTime`), the cached data is returned without fetching. Otherwise, the query is fetched +and the promise resolves once the fetch settles. If a `select` function is provided, it is +applied to the data in both cases (cached or freshly fetched) before it is returned. + +Unlike `useQuery`, retries are disabled by default here (`retry: false`) unless explicitly +configured, since there is no component to catch a thrown error and retry through re-render. + +The accepted options are a subset of `useQuery`'s options: fields that only make sense for a +reactive observer (e.g. `enabled`, `refetchInterval`, `refetchOnWindowFocus`, `notifyOnChangeProps`, +`throwOnError`, `suspense`, `placeholderData`) are not part of this method's options. + +This method replaces the deprecated `fetchQuery`, and — combined with +`{ staleTime: 'static' }` — the deprecated `ensureQueryData`. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`QueryExecuteOptions`](../interfaces/QueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +try { + const data = await queryClient.query({ queryKey, queryFn, staleTime: 10000 }) +} catch (error) { + console.log(error) +} +``` + +*** + +### refetchQueries() + +```ts +refetchQueries(filters?, options?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:490](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L490) + +Refetches queries matching the given filters, regardless of whether they are stale. Without +filters, every query in the cache is refetched. Queries that are disabled, or static (only +have observers with a static `staleTime`), are never refetched. + +By default (`cancelRefetch: true`), a currently running fetch is cancelled before the new +one starts. The returned promise resolves once all matching queries have settled; it does +not reject on individual query failures unless `throwOnError` is set. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`RefetchQueryFilters`](../interfaces/RefetchQueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +// refetch all active queries partially matching a query key: +await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' }) +``` + +*** + +### removeQueries() + +```ts +removeQueries(filters?): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:369](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L369) + +Removes queries from the cache that match the given filters. Unlike +[QueryClient#invalidateQueries](#invalidatequeries) or [QueryClient#refetchQueries](#refetchqueries), this removes +matching queries from the cache instead of refetching them. Without filters, every query in +the cache is removed. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +#### Returns + +`void` + +#### Example + +```ts +queryClient.removeQueries({ queryKey: ['posts'], exact: true }) +``` + +*** + +### resetQueries() + +```ts +resetQueries(filters?, options?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L390) + +Resets queries matching the given filters back to their initial state (e.g. any +`initialData`), notifying subscribers rather than removing them. Active queries among the +matched set are then refetched, and the returned promise resolves once that refetch settles. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`ResetOptions`](../interfaces/ResetOptions.md) + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.resetQueries({ queryKey: ['posts'], exact: true }) +``` + +*** + +### resumePausedMutations() + +```ts +resumePausedMutations(): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:757](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L757) + +Resumes mutations that were paused because there was no network connection. Does nothing +(resolving immediately) if the client is currently offline. + +#### Returns + +`Promise`\<`unknown`\> + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +await queryClient.resumePausedMutations() +``` + +*** + +### setDefaultOptions() + +```ts +setDefaultOptions(options): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L829) + +Dynamically sets the default options for this client, overwriting any previously defined +default options. + +#### Parameters + +##### options + +[`DefaultOptions`](../interfaces/DefaultOptions.md) + +#### Returns + +`void` + +#### See + +[QueryClient#getDefaultOptions](#getdefaultoptions) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +queryClient.setDefaultOptions({ + queries: { + staleTime: Infinity, + }, +}) +``` + +*** + +### setMutationDefaults() + +```ts +setMutationDefaults(mutationKey, options): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L907) + +Sets default options for mutations whose mutation key partially matches the given +`mutationKey`. As with [QueryClient#setQueryDefaults](#setquerydefaults), the order of registration +matters when several registered defaults match the same mutation key. + +#### Type Parameters + +##### TData + +`TData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TVariables + +`TVariables` = `void` + +##### TOnMutateResult + +`TOnMutateResult` = `unknown` + +#### Parameters + +##### mutationKey + +readonly `unknown`[] + +##### options + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> + +#### Returns + +`void` + +#### See + +[QueryClient#getMutationDefaults](#getmutationdefaults) + +#### Example + +```ts +queryClient.setMutationDefaults(['addPost'], { mutationFn: addPost }) +``` + +*** + +### setQueriesData() + +```ts +setQueriesData( + filters, + updater, + options?): [readonly unknown[], TQueryFnData | undefined][]; +``` + +Defined in: [packages/query-core/src/queryClient.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L312) + +Synchronous way to immediately update the cached data of multiple queries at once, using +filters or partial query key matching. Only queries that already exist and match the given +filters are updated; no new cache entries are created. Internally this calls +[QueryClient#setQueryData](#setquerydata) for each matching query. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters + +`TQueryFilters` + +##### updater + +[`Updater`](../type-aliases/Updater.md)\<`NoInfer`\<`TQueryFnData`\> \| `undefined`, `NoInfer`\<`TQueryFnData`\> \| `undefined`\> + +##### options? + +[`SetDataOptions`](../interfaces/SetDataOptions.md) + +#### Returns + +\[readonly `unknown`[], `TQueryFnData` \| `undefined`\][] + +#### Example + +```ts +queryClient.setQueriesData({ queryKey: ['posts'] }, (oldPosts) => + oldPosts ? oldPosts.filter((post) => post.id !== deletedId) : oldPosts, +) +``` + +*** + +### setQueryData() + +```ts +setQueryData( + queryKey, + updater, + options?): NoInfer | undefined; +``` + +Defined in: [packages/query-core/src/queryClient.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L264) + +Synchronous way to immediately update a query's cached data. If the updater (or the value +passed) resolves to `undefined`, the cache is left untouched and no query is created; +otherwise, if the query does not exist yet, it will be created. To update multiple queries +at once by partially matching query keys, use [QueryClient#setQueriesData](#setqueriesdata) instead. + +Updates must be performed immutably: do not mutate `oldData`, or data previously retrieved +via [QueryClient#getQueryData](#getquerydata), in place. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +The query key to set data for. + +##### updater + +[`Updater`](../type-aliases/Updater.md)\<`NoInfer`\<`TInferredQueryFnData`\> \| `undefined`, `NoInfer`\<`TInferredQueryFnData`\> \| `undefined`\> + +Either the new data, or a function that receives the current data (which +may be `undefined`) and returns the new data. + +##### options? + +[`SetDataOptions`](../interfaces/SetDataOptions.md) + +#### Returns + +`NoInfer`\<`TInferredQueryFnData`\> \| `undefined` + +#### Example + +```ts +queryClient.setQueryData(['posts'], newPosts) + +// Or, using an updater function that receives the current data: +queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost]) +``` + +*** + +### setQueryDefaults() + +```ts +setQueryDefaults(queryKey, options): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L848) + +Sets default options for queries whose query key partially matches the given `queryKey`. + +If several registered query defaults match a given query key, they are merged together in +registration order by [QueryClient#getQueryDefaults](#getquerydefaults), so register defaults from the +most generic key to the least generic one — more specific defaults should be registered +after more generic ones so they take precedence. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +#### Parameters + +##### queryKey + +readonly `unknown`[] + +##### options + +`Partial`\<[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`\>, `"queryKey"`\>\> + +#### Returns + +`void` + +#### Example + +```ts +queryClient.setQueryDefaults(['posts'], { queryFn: fetchPosts }) + +await queryClient.query({ queryKey: ['posts'] }) +``` + +*** + +### unmount() + +```ts +unmount(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L126) + +The inverse of [QueryClient#mount](#mount) — called by a framework adapter's +`QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online +listeners once the mount count returns to `0`. + +#### Returns + +`void` diff --git a/docs/framework/react/reference/classes/QueryObserver.md b/docs/framework/react/reference/classes/QueryObserver.md new file mode 100644 index 00000000000..51ff16910df --- /dev/null +++ b/docs/framework/react/reference/classes/QueryObserver.md @@ -0,0 +1,555 @@ +--- +id: QueryObserver +title: QueryObserver +--- + +Defined in: [packages/query-core/src/queryObserver.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L57) + +A `QueryObserver` watches a single query in the `QueryCache` and computes a +`QueryObserverResult` from its state, recomputing and notifying subscribers +whenever the underlying query (or the observer's options) changes. It is +the primitive that framework adapters (e.g. `useQuery`) build their hooks +on top of, but it can also be used directly to observe and switch between +queries outside of any framework. + +## Example + +```ts +const observer = new QueryObserver(queryClient, { + queryKey: ['posts'], + queryFn: fetchPosts, +}) + +const unsubscribe = observer.subscribe((result) => { + console.log(result.data) +}) +``` + +## Extends + +- `Subscribable`\<`QueryObserverListener`\<`TData`, `TError`\>\> + +## Extended by + +- [`InfiniteQueryObserver`](InfiniteQueryObserver.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Constructors + +### Constructor + +```ts +new QueryObserver(client, options): QueryObserver; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L87) + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`QueryObserver`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Overrides + +```ts +Subscribable>.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +*** + +### options + +```ts +options: QueryObserverOptions; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L89) + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L106) + +#### Returns + +`void` + +*** + +### createResult() + +```ts +protected createResult(query, options): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:559](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L559) + +#### Parameters + +##### query + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L161) + +Stops observing the current query: clears all listeners, cancels the +stale and refetch-interval timers, and removes this observer from the +query it was observing. + +#### Returns + +`void` + +*** + +### fetch() + +```ts +protected fetch(fetchOptions): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L448) + +#### Parameters + +##### fetchOptions + +`ObserverFetchOptions` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchOptimistic() + +```ts +fetchOptimistic(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:395](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L395) + +Fetches a query defined by the given options without affecting this +observer's own tracked query or result, and returns a promise that +resolves with the `QueryObserverResult` for that fetch. This is useful +for prefetching data that another observer (e.g. a query about to be +navigated to) will need, ahead of time. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.fetchOptimistic({ + queryKey: ['posts', 2], + queryFn: () => fetchPost(2), +}) +console.log(result.data) +``` + +*** + +### getCurrentQuery() + +```ts +getCurrentQuery(): Query; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:357](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L357) + +Returns the `Query` instance this observer is currently observing. + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L321) + +Returns the most recently computed `QueryObserverResult` for the +observed query. This is a point-in-time read; to be notified of updates +as they happen, subscribe to the observer instead (its inherited +`subscribe` method). + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +#### Example + +```ts +const result = observer.getCurrentResult() +console.log(result.status, result.data) +``` + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(options): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L272) + +Computes the result the observer would produce for the given (already-defaulted) options +right now, building the underlying `Query` if it doesn't exist yet, without waiting for a +subscription callback. Called by framework adapters on every render (e.g. `useQuery`) so the +returned value is available synchronously, ahead of `setOptions` triggering an actual fetch. + +#### Parameters + +##### options + +[`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L110) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L124) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### refetch() + +```ts +refetch(__namedParameters): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L371) + +Refetches the observed query and returns a promise that resolves with +the resulting `QueryObserverResult`. + +#### Parameters + +##### \_\_namedParameters + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.refetch({ cancelRefetch: false }) +console.log(result.data) +``` + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L182) + +Updates the observer's options. This will re-resolve the query being +observed (switching to a different query if the `queryKey` changed), +trigger a fetch if the new options require one and the observer has +subscribers, recompute the current result, and reschedule the stale and +refetch-interval timers as needed. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setOptions({ queryKey: ['posts', 1], queryFn: () => fetchPost(1) }) +// later: switch to a different query, reusing the same observer +observer.setOptions({ queryKey: ['posts', 2], queryFn: () => fetchPost(2) }) +``` + +*** + +### shouldFetchOnReconnect() + +```ts +shouldFetchOnReconnect(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L135) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnReconnect` option) to refetch when the network +reconnects. + +#### Returns + +`boolean` + +*** + +### shouldFetchOnWindowFocus() + +```ts +shouldFetchOnWindowFocus(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L148) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnWindowFocus` option) to refetch when the window +regains focus. + +#### Returns + +`boolean` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueryObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` + +*** + +### trackProp() + +```ts +trackProp(key): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:350](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L350) + +Records that the given `QueryObserverResult` property was read, so a subsequent update only +notifies this observer if a tracked property actually changed. Normally called indirectly via +[QueryObserver#trackResult](#trackresult)'s proxy; exposed directly for adapters that track property +access themselves (e.g. through their own reactivity system) instead of via the proxy. + +#### Parameters + +##### key + +`"error"` | `"data"` | `"isError"` | `"isPending"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isSuccess"` | `"isPlaceholderData"` | `"status"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` + +#### Returns + +`void` + +*** + +### trackResult() + +```ts +trackResult(result, onPropTracked?): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:331](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L331) + +Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via +[QueryObserver#trackProp](#trackprop) (and an optional `onPropTracked` callback). Used by framework +adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on +properties you actually read" behavior. + +#### Parameters + +##### result + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +##### onPropTracked? + +(`key`) => `void` + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### updateResult() + +```ts +updateResult(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L735) + +Recomputes and stores the current result from the current query/options, notifying listeners +if it changed. Framework adapters call this right after subscribing to make sure no query +update was missed in the gap between creating the observer and subscribing to it. + +#### Returns + +`void` diff --git a/docs/framework/react/reference/functions/HydrationBoundary.md b/docs/framework/react/reference/functions/HydrationBoundary.md index e00f10b5ba1..43ceb13dde8 100644 --- a/docs/framework/react/reference/functions/HydrationBoundary.md +++ b/docs/framework/react/reference/functions/HydrationBoundary.md @@ -7,7 +7,7 @@ title: HydrationBoundary function HydrationBoundary(__namedParameters): ReactElement>; ``` -Defined in: [react-query/src/HydrationBoundary.tsx:86](https://github.com/TanStack/query/blob/main/packages/react-query/src/HydrationBoundary.tsx#L86) +Defined in: [packages/react-query/src/HydrationBoundary.tsx:86](https://github.com/TanStack/query/blob/main/packages/react-query/src/HydrationBoundary.tsx#L86) `HydrationBoundary` adds a previously dehydrated state into the `queryClient` that would be returned by `useQueryClient()`. If the client already contains data, the new queries will be intelligently merged based on diff --git a/docs/framework/react/reference/functions/QueryClientProvider.md b/docs/framework/react/reference/functions/QueryClientProvider.md index b0bf08337d6..364425d3134 100644 --- a/docs/framework/react/reference/functions/QueryClientProvider.md +++ b/docs/framework/react/reference/functions/QueryClientProvider.md @@ -9,7 +9,7 @@ redirect_from: function QueryClientProvider(__namedParameters): Element; ``` -Defined in: [react-query/src/QueryClientProvider.tsx:70](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryClientProvider.tsx#L70) +Defined in: [packages/react-query/src/QueryClientProvider.tsx:70](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryClientProvider.tsx#L70) Use the `QueryClientProvider` component to connect and provide a `QueryClient` to your application. Also calls `client.mount()`/`client.unmount()` as this component mounts/unmounts, which subscribes the client to diff --git a/docs/framework/react/reference/functions/QueryErrorResetBoundary.md b/docs/framework/react/reference/functions/QueryErrorResetBoundary.md index 463925af015..4d9db5e94fb 100644 --- a/docs/framework/react/reference/functions/QueryErrorResetBoundary.md +++ b/docs/framework/react/reference/functions/QueryErrorResetBoundary.md @@ -9,7 +9,7 @@ redirect_from: function QueryErrorResetBoundary(__namedParameters): Element; ``` -Defined in: [react-query/src/QueryErrorResetBoundary.tsx:136](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L136) +Defined in: [packages/react-query/src/QueryErrorResetBoundary.tsx:136](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L136) When using `suspense` or `throwOnError` in your queries, you need a way to let queries know that you want to try again when re-rendering after some error occurred. With the `QueryErrorResetBoundary` component you can diff --git a/docs/framework/react/reference/functions/defaultShouldDehydrateMutation.md b/docs/framework/react/reference/functions/defaultShouldDehydrateMutation.md new file mode 100644 index 00000000000..095ccf36e7c --- /dev/null +++ b/docs/framework/react/reference/functions/defaultShouldDehydrateMutation.md @@ -0,0 +1,23 @@ +--- +id: defaultShouldDehydrateMutation +title: defaultShouldDehydrateMutation +--- + +```ts +function defaultShouldDehydrateMutation(mutation): boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L180) + +The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are +currently paused (e.g. paused by `networkMode` while offline). + +## Parameters + +### mutation + +[`Mutation`](../classes/Mutation.md) + +## Returns + +`boolean` diff --git a/docs/framework/react/reference/functions/defaultShouldDehydrateQuery.md b/docs/framework/react/reference/functions/defaultShouldDehydrateQuery.md new file mode 100644 index 00000000000..06afc29d670 --- /dev/null +++ b/docs/framework/react/reference/functions/defaultShouldDehydrateQuery.md @@ -0,0 +1,23 @@ +--- +id: defaultShouldDehydrateQuery +title: defaultShouldDehydrateQuery +--- + +```ts +function defaultShouldDehydrateQuery(query): boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:188](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L188) + +The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is +`'success'`. + +## Parameters + +### query + +[`Query`](../classes/Query.md) + +## Returns + +`boolean` diff --git a/docs/framework/react/reference/functions/dehydrate.md b/docs/framework/react/reference/functions/dehydrate.md new file mode 100644 index 00000000000..b7334de7729 --- /dev/null +++ b/docs/framework/react/reference/functions/dehydrate.md @@ -0,0 +1,43 @@ +--- +id: dehydrate +title: dehydrate +--- + +```ts +function dehydrate(client, options): DehydratedState; +``` + +Defined in: [packages/query-core/src/hydration.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L210) + +Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`, +typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`. +Which queries/mutations are included, and how their data/errors are transformed, is controlled by `options`, +falling back to the client's `dehydrate` default options, and finally to `defaultShouldDehydrateQuery` / +`defaultShouldDehydrateMutation`. + +## Parameters + +### client + +[`QueryClient`](../classes/QueryClient.md) + +### options + +[`DehydrateOptions`](../interfaces/DehydrateOptions.md) = `{}` + +## Returns + +[`DehydratedState`](../interfaces/DehydratedState.md) + +## Example + +```ts +const queryClient = new QueryClient() + +await queryClient.prefetchQuery({ + queryKey: ['posts'], + queryFn: getPosts, +}) + +const dehydratedState = dehydrate(queryClient) +``` diff --git a/docs/framework/react/reference/functions/dehydrateQuery.md b/docs/framework/react/reference/functions/dehydrateQuery.md new file mode 100644 index 00000000000..2827d2ebb45 --- /dev/null +++ b/docs/framework/react/reference/functions/dehydrateQuery.md @@ -0,0 +1,43 @@ +--- +id: dehydrateQuery +title: dehydrateQuery +--- + +```ts +function dehydrateQuery( + query, + serializeData?, + shouldRedactErrors?): DehydratedQuery; +``` + +Defined in: [packages/query-core/src/hydration.ts:151](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L151) + +Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g. +`queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the +de/rehydrated data, typically with `useQuery` on the client. If the query is still `pending`, its in-flight +promise is dehydrated too so it can be resumed on the other side instead of re-fetched. + +## Parameters + +### query + +[`Query`](../classes/Query.md) + +The query to dehydrate. + +### serializeData? + +`TransformerFn` + +Optional transform applied to `query.state.data` before it is included in the snapshot. + +### shouldRedactErrors? + +(`error`) => `boolean` + +Optional predicate; if it returns `false` for the promise's rejection error, that +error is kept as-is instead of being redacted. + +## Returns + +`DehydratedQuery` diff --git a/docs/framework/react/reference/functions/experimental_streamedQuery.md b/docs/framework/react/reference/functions/experimental_streamedQuery.md new file mode 100644 index 00000000000..afd44df7c5f --- /dev/null +++ b/docs/framework/react/reference/functions/experimental_streamedQuery.md @@ -0,0 +1,52 @@ +--- +id: experimental_streamedQuery +title: experimental_streamedQuery +--- + +```ts +function experimental_streamedQuery(queryFn): QueryFunction; +``` + +Defined in: [packages/query-core/src/streamedQuery.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L60) + +This is a helper function to create a query function that streams data from an AsyncIterable. +Data will be an Array of all the chunks received. +The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. +The query will stay in fetchStatus 'fetching' until the stream ends. + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TData + +`TData` = `TQueryFnData`[] + +### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +## Parameters + +### queryFn + +`StreamedQueryParams`\<`TQueryFnData`, `TData`, `TQueryKey`\> + +The function that returns an AsyncIterable to stream data from. + +## Returns + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TData`, `TQueryKey`\> + +## Example + +```ts +await queryClient.query({ + queryKey: ['data'], + queryFn: streamedQuery({ + streamFn: fetchDataInChunks, + }), +}) +``` diff --git a/docs/framework/react/reference/functions/hashKey.md b/docs/framework/react/reference/functions/hashKey.md new file mode 100644 index 00000000000..9e7844aa09d --- /dev/null +++ b/docs/framework/react/reference/functions/hashKey.md @@ -0,0 +1,30 @@ +--- +id: hashKey +title: hashKey +--- + +```ts +function hashKey(queryKey): string; +``` + +Defined in: [packages/query-core/src/utils.ts:282](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L282) + +Default query & mutation keys hash function. +Hashes the value into a stable hash. + +## Parameters + +### queryKey + +readonly `unknown`[] + +## Returns + +`string` + +## Example + +```ts +// Object keys are sorted, so key order doesn't affect the hash: +hashKey(['todos', { page: 1, filter: 'done' }]) // === '["todos",{"filter":"done","page":1}]' +``` diff --git a/docs/framework/react/reference/functions/hydrate.md b/docs/framework/react/reference/functions/hydrate.md new file mode 100644 index 00000000000..dc55e38bf64 --- /dev/null +++ b/docs/framework/react/reference/functions/hydrate.md @@ -0,0 +1,49 @@ +--- +id: hydrate +title: hydrate +--- + +```ts +function hydrate( + client, + dehydratedState, + options?): void; +``` + +Defined in: [packages/query-core/src/hydration.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L267) + +Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the +client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`. +Queries not yet in the cache are built from the dehydrated snapshot; queries that already exist are only updated +when the dehydrated data is newer than what's already cached. Newly built queries have their `fetchStatus` reset +to `'idle'` so they don't hydrate stuck in a fetching state. If a dehydrated query still had an in-flight +promise, it is resumed via `query.fetch()` (reusing that promise as `initialPromise`) rather than re-invoking +`queryFn`. + +## Parameters + +### client + +[`QueryClient`](../classes/QueryClient.md) + +### dehydratedState + +`Partial`\<[`DehydratedState`](../interfaces/DehydratedState.md)\> + +### options? + +[`HydrateOptions`](../interfaces/HydrateOptions.md) + +## Returns + +`void` + +## Example + +```ts +// dehydratedState was produced by `dehydrate` on the server +// and sent to the client, e.g. embedded in server-rendered markup. +const queryClient = new QueryClient() + +hydrate(queryClient, dehydratedState) +``` diff --git a/docs/framework/react/reference/functions/infiniteQueryOptions.md b/docs/framework/react/reference/functions/infiniteQueryOptions.md index acd4d4b585a..38532ef5496 100644 --- a/docs/framework/react/reference/functions/infiniteQueryOptions.md +++ b/docs/framework/react/reference/functions/infiniteQueryOptions.md @@ -11,7 +11,7 @@ redirect_from: function infiniteQueryOptions(options): UseInfiniteQueryOptions & object & QueryKeyWithDataTag, TError>; ``` -Defined in: [react-query/src/infiniteQueryOptions.ts:170](https://github.com/TanStack/query/blob/main/packages/react-query/src/infiniteQueryOptions.ts#L170) +Defined in: [packages/react-query/src/infiniteQueryOptions.ts:170](https://github.com/TanStack/query/blob/main/packages/react-query/src/infiniteQueryOptions.ts#L170) You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`. @@ -31,7 +31,7 @@ This overload is selected when `initialData` is set. #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -97,7 +97,7 @@ function Projects() { function infiniteQueryOptions(options): OmitKeyof, "queryFn"> & object & QueryKeyWithDataTag, TError>; ``` -Defined in: [react-query/src/infiniteQueryOptions.ts:232](https://github.com/TanStack/query/blob/main/packages/react-query/src/infiniteQueryOptions.ts#L232) +Defined in: [packages/react-query/src/infiniteQueryOptions.ts:232](https://github.com/TanStack/query/blob/main/packages/react-query/src/infiniteQueryOptions.ts#L232) You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`. @@ -115,7 +115,7 @@ These options can be shared across hooks and imperative APIs such as `queryClien #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -180,7 +180,7 @@ function Comments({ postId }: { postId: string }) { function infiniteQueryOptions(options): UseInfiniteQueryOptions & object & QueryKeyWithDataTag, TError>; ``` -Defined in: [react-query/src/infiniteQueryOptions.ts:294](https://github.com/TanStack/query/blob/main/packages/react-query/src/infiniteQueryOptions.ts#L294) +Defined in: [packages/react-query/src/infiniteQueryOptions.ts:294](https://github.com/TanStack/query/blob/main/packages/react-query/src/infiniteQueryOptions.ts#L294) You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`. @@ -198,7 +198,7 @@ These options can be shared across hooks and imperative APIs such as `queryClien #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey diff --git a/docs/framework/react/reference/functions/isCancelledError.md b/docs/framework/react/reference/functions/isCancelledError.md new file mode 100644 index 00000000000..c8f57c4b94d --- /dev/null +++ b/docs/framework/react/reference/functions/isCancelledError.md @@ -0,0 +1,24 @@ +--- +id: isCancelledError +title: isCancelledError +--- + +```ts +function isCancelledError(value): value is CancelledError; +``` + +Defined in: [packages/query-core/src/retryer.ts:90](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L90) + +## Parameters + +### value + +`any` + +## Returns + +`value is CancelledError` + +## Deprecated + +Use instanceof `CancelledError` instead. diff --git a/docs/framework/react/reference/functions/keepPreviousData.md b/docs/framework/react/reference/functions/keepPreviousData.md new file mode 100644 index 00000000000..d41c7d7c726 --- /dev/null +++ b/docs/framework/react/reference/functions/keepPreviousData.md @@ -0,0 +1,40 @@ +--- +id: keepPreviousData +title: keepPreviousData +--- + +```ts +function keepPreviousData(previousData): T | undefined; +``` + +Defined in: [packages/query-core/src/utils.ts:491](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L491) + +Intended to be passed as a query's `placeholderData` option, for example +`placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new +query key is fetching, it keeps displaying the previously fetched data until the new data arrives. + +## Type Parameters + +### T + +`T` + +## Parameters + +### previousData + +`T` | `undefined` + +## Returns + +`T` \| `undefined` + +## Example + +```ts +new QueryObserver(queryClient, { + queryKey: ['posts', page], + queryFn: () => fetchPosts(page), + placeholderData: keepPreviousData, +}) +``` diff --git a/docs/framework/react/reference/functions/matchMutation.md b/docs/framework/react/reference/functions/matchMutation.md new file mode 100644 index 00000000000..79468dcfad9 --- /dev/null +++ b/docs/framework/react/reference/functions/matchMutation.md @@ -0,0 +1,38 @@ +--- +id: matchMutation +title: matchMutation +--- + +```ts +function matchMutation(filters, mutation): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:235](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L235) + +Checks whether a mutation matches the given [MutationFilters](../interfaces/MutationFilters.md). +Every filter that is specified must match; filters that are left unspecified are ignored. +If a `mutationKey` filter is provided but the mutation has no `mutationKey` of its own, it does not match. + +## Parameters + +### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) + +### mutation + +[`Mutation`](../classes/Mutation.md)\<`any`, `any`\> + +## Returns + +`boolean` + +## Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const matchingMutations = mutationCache + .getAll() + .filter((mutation) => matchMutation({ mutationKey: ['addPost'] }, mutation)) +``` diff --git a/docs/framework/react/reference/functions/matchQuery.md b/docs/framework/react/reference/functions/matchQuery.md new file mode 100644 index 00000000000..f98fe5f3537 --- /dev/null +++ b/docs/framework/react/reference/functions/matchQuery.md @@ -0,0 +1,37 @@ +--- +id: matchQuery +title: matchQuery +--- + +```ts +function matchQuery(filters, query): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L173) + +Checks whether a query matches the given [QueryFilters](../interfaces/QueryFilters.md). +Every filter that is specified must match; filters that are left unspecified are ignored. + +## Parameters + +### filters + +[`QueryFilters`](../interfaces/QueryFilters.md) + +### query + +[`Query`](../classes/Query.md)\<`any`, `any`, `any`, `any`\> + +## Returns + +`boolean` + +## Example + +```ts +const queryCache = queryClient.getQueryCache() + +const matchingQueries = queryCache + .getAll() + .filter((query) => matchQuery({ queryKey: ['posts'] }, query)) +``` diff --git a/docs/framework/react/reference/functions/mutationOptions.md b/docs/framework/react/reference/functions/mutationOptions.md index 6b8908eda41..f9ecd3c747a 100644 --- a/docs/framework/react/reference/functions/mutationOptions.md +++ b/docs/framework/react/reference/functions/mutationOptions.md @@ -11,7 +11,7 @@ redirect_from: function mutationOptions(options): WithRequired, "mutationKey">; ``` -Defined in: [react-query/src/mutationOptions.ts:33](https://github.com/TanStack/query/blob/main/packages/react-query/src/mutationOptions.ts#L33) +Defined in: [packages/react-query/src/mutationOptions.ts:33](https://github.com/TanStack/query/blob/main/packages/react-query/src/mutationOptions.ts#L33) You can generally pass everything to `mutationOptions` that you can also pass to `useMutation`. A `mutationKey` is required on this overload so the mutation can be looked up later, e.g. with @@ -39,14 +39,14 @@ You can generally pass everything to `mutationOptions` that you can also pass to #### options -`WithRequired`\<[`UseMutationOptions`](../interfaces/UseMutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> +[`WithRequired`](../type-aliases/WithRequired.md)\<[`UseMutationOptions`](../interfaces/UseMutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> The mutation options to use, identical to what you'd pass to `useMutation`, with a required `mutationKey`. ### Returns -`WithRequired`\<[`UseMutationOptions`](../interfaces/UseMutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> +[`WithRequired`](../type-aliases/WithRequired.md)\<[`UseMutationOptions`](../interfaces/UseMutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> The same options object, unchanged. @@ -80,7 +80,7 @@ function SavingIndicator() { function mutationOptions(options): Omit, "mutationKey">; ``` -Defined in: [react-query/src/mutationOptions.ts:73](https://github.com/TanStack/query/blob/main/packages/react-query/src/mutationOptions.ts#L73) +Defined in: [packages/react-query/src/mutationOptions.ts:73](https://github.com/TanStack/query/blob/main/packages/react-query/src/mutationOptions.ts#L73) You can generally pass everything to `mutationOptions` that you can also pass to `useMutation`. No `mutationKey` is required on this overload — use this when you don't need to target the mutation via a diff --git a/docs/framework/react/reference/functions/noop.md b/docs/framework/react/reference/functions/noop.md new file mode 100644 index 00000000000..fd1b8dc2ad0 --- /dev/null +++ b/docs/framework/react/reference/functions/noop.md @@ -0,0 +1,32 @@ +--- +id: noop +title: noop +--- + +## Call Signature + +```ts +function noop(): void; +``` + +Defined in: [packages/query-core/src/utils.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L117) + +A function that does nothing. + +### Returns + +`void` + +## Call Signature + +```ts +function noop(): undefined; +``` + +Defined in: [packages/query-core/src/utils.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L118) + +A function that does nothing. + +### Returns + +`undefined` diff --git a/docs/framework/react/reference/functions/partialMatchKey.md b/docs/framework/react/reference/functions/partialMatchKey.md new file mode 100644 index 00000000000..3795de85b95 --- /dev/null +++ b/docs/framework/react/reference/functions/partialMatchKey.md @@ -0,0 +1,26 @@ +--- +id: partialMatchKey +title: partialMatchKey +--- + +```ts +function partialMatchKey(a, b): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L298) + +Checks if key `b` partially matches with key `a`. + +## Parameters + +### a + +readonly `unknown`[] + +### b + +readonly `unknown`[] + +## Returns + +`boolean` diff --git a/docs/framework/react/reference/functions/queryOptions.md b/docs/framework/react/reference/functions/queryOptions.md index 85cd7896c40..ee56b2e62c3 100644 --- a/docs/framework/react/reference/functions/queryOptions.md +++ b/docs/framework/react/reference/functions/queryOptions.md @@ -11,7 +11,7 @@ redirect_from: function queryOptions(options): Omit, "queryFn"> & object & QueryKeyWithDataTag; ``` -Defined in: [react-query/src/queryOptions.ts:142](https://github.com/TanStack/query/blob/main/packages/react-query/src/queryOptions.ts#L142) +Defined in: [packages/react-query/src/queryOptions.ts:142](https://github.com/TanStack/query/blob/main/packages/react-query/src/queryOptions.ts#L142) You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and @@ -87,7 +87,7 @@ function Posts() { function queryOptions(options): OmitKeyof, "queryFn"> & object & QueryKeyWithDataTag; ``` -Defined in: [react-query/src/queryOptions.ts:183](https://github.com/TanStack/query/blob/main/packages/react-query/src/queryOptions.ts#L183) +Defined in: [packages/react-query/src/queryOptions.ts:183](https://github.com/TanStack/query/blob/main/packages/react-query/src/queryOptions.ts#L183) You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and @@ -156,7 +156,7 @@ function Post({ id }: { id: string }) { function queryOptions(options): UseQueryOptions & object & QueryKeyWithDataTag; ``` -Defined in: [react-query/src/queryOptions.ts:247](https://github.com/TanStack/query/blob/main/packages/react-query/src/queryOptions.ts#L247) +Defined in: [packages/react-query/src/queryOptions.ts:247](https://github.com/TanStack/query/blob/main/packages/react-query/src/queryOptions.ts#L247) You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and diff --git a/docs/framework/react/reference/functions/replaceEqualDeep.md b/docs/framework/react/reference/functions/replaceEqualDeep.md new file mode 100644 index 00000000000..77a393196ef --- /dev/null +++ b/docs/framework/react/reference/functions/replaceEqualDeep.md @@ -0,0 +1,41 @@ +--- +id: replaceEqualDeep +title: replaceEqualDeep +--- + +```ts +function replaceEqualDeep( + a, + b, + depth?): T; +``` + +Defined in: [packages/query-core/src/utils.ts:337](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L337) + +This function returns `a` if `b` is deeply equal. +If not, it will replace any deeply equal children of `b` with those of `a`. +This can be used for structural sharing between JSON values for example. + +## Type Parameters + +### T + +`T` + +## Parameters + +### a + +`unknown` + +### b + +`T` + +### depth? + +`number` + +## Returns + +`T` diff --git a/docs/framework/react/reference/functions/shouldThrowError.md b/docs/framework/react/reference/functions/shouldThrowError.md new file mode 100644 index 00000000000..3146617391e --- /dev/null +++ b/docs/framework/react/reference/functions/shouldThrowError.md @@ -0,0 +1,45 @@ +--- +id: shouldThrowError +title: shouldThrowError +--- + +```ts +function shouldThrowError(throwOnError, params): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L574) + +Resolves a `throwOnError` option to a boolean. +If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller, +additional context such as the query or mutation) and its result is returned, allowing the throwing +behavior to be decided per error. Otherwise, `throwOnError` itself is coerced to a boolean (`undefined` +resolves to `false`). + +## Type Parameters + +### T + +`T` *extends* (...`args`) => `boolean` + +## Parameters + +### throwOnError + +`boolean` | `T` | `undefined` + +### params + +`Parameters`\<`T`\> + +## Returns + +`boolean` + +## Example + +```ts +const throwOnError = + query.state.error && typeof options.throwOnError === 'function' + ? shouldThrowError(options.throwOnError, [query.state.error, query]) + : options.throwOnError +``` diff --git a/docs/framework/react/reference/functions/useInfiniteQuery.md b/docs/framework/react/reference/functions/useInfiniteQuery.md index 7d414644e55..ecddf154e80 100644 --- a/docs/framework/react/reference/functions/useInfiniteQuery.md +++ b/docs/framework/react/reference/functions/useInfiniteQuery.md @@ -11,7 +11,7 @@ redirect_from: function useInfiniteQuery(options, queryClient?): DefinedUseInfiniteQueryResult; ``` -Defined in: [react-query/src/useInfiniteQuery.ts:65](https://github.com/TanStack/query/blob/main/packages/react-query/src/useInfiniteQuery.ts#L65) +Defined in: [packages/react-query/src/useInfiniteQuery.ts:65](https://github.com/TanStack/query/blob/main/packages/react-query/src/useInfiniteQuery.ts#L65) The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`. @@ -30,7 +30,7 @@ This overload is selected when `initialData` is set. #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -50,7 +50,7 @@ The [DefinedInitialDataInfiniteOptions](../type-aliases/DefinedInitialDataInfini #### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. @@ -107,7 +107,7 @@ function Projects() { function useInfiniteQuery(options, queryClient?): UseInfiniteQueryResult; ``` -Defined in: [react-query/src/useInfiniteQuery.ts:191](https://github.com/TanStack/query/blob/main/packages/react-query/src/useInfiniteQuery.ts#L191) +Defined in: [packages/react-query/src/useInfiniteQuery.ts:191](https://github.com/TanStack/query/blob/main/packages/react-query/src/useInfiniteQuery.ts#L191) The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`. @@ -124,7 +124,7 @@ The options for `useInfiniteQuery` are identical to `useQuery`, with the additio #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -144,7 +144,7 @@ The [UndefinedInitialDataInfiniteOptions](../type-aliases/UndefinedInitialDataIn #### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. @@ -267,7 +267,7 @@ function Projects() { function useInfiniteQuery(options, queryClient?): UseInfiniteQueryResult; ``` -Defined in: [react-query/src/useInfiniteQuery.ts:347](https://github.com/TanStack/query/blob/main/packages/react-query/src/useInfiniteQuery.ts#L347) +Defined in: [packages/react-query/src/useInfiniteQuery.ts:347](https://github.com/TanStack/query/blob/main/packages/react-query/src/useInfiniteQuery.ts#L347) The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`. @@ -284,7 +284,7 @@ The options for `useInfiniteQuery` are identical to `useQuery`, with the additio #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -304,7 +304,7 @@ The [UseInfiniteQueryOptions](../interfaces/UseInfiniteQueryOptions.md) to use #### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/react/reference/functions/useIsFetching.md b/docs/framework/react/reference/functions/useIsFetching.md index a272b61e149..6d403597121 100644 --- a/docs/framework/react/reference/functions/useIsFetching.md +++ b/docs/framework/react/reference/functions/useIsFetching.md @@ -9,7 +9,7 @@ redirect_from: function useIsFetching(filters?, queryClient?): number; ``` -Defined in: [react-query/src/useIsFetching.ts:44](https://github.com/TanStack/query/blob/main/packages/react-query/src/useIsFetching.ts#L44) +Defined in: [packages/react-query/src/useIsFetching.ts:44](https://github.com/TanStack/query/blob/main/packages/react-query/src/useIsFetching.ts#L44) The `useIsFetching` hook returns the `number` of the queries that your application is loading or fetching in the background (useful for app-wide loading indicators). @@ -18,13 +18,13 @@ the background (useful for app-wide loading indicators). ### filters? -`QueryFilters`\ +[`QueryFilters`](../interfaces/QueryFilters.md)\ -The QueryFilters to narrow down the matched queries. +The [QueryFilters](../interfaces/QueryFilters.md) to narrow down the matched queries. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/react/reference/functions/useIsMutating.md b/docs/framework/react/reference/functions/useIsMutating.md index 5d45b46b693..a143d32db0a 100644 --- a/docs/framework/react/reference/functions/useIsMutating.md +++ b/docs/framework/react/reference/functions/useIsMutating.md @@ -9,7 +9,7 @@ redirect_from: function useIsMutating(filters?, queryClient?): number; ``` -Defined in: [react-query/src/useMutationState.ts:35](https://github.com/TanStack/query/blob/main/packages/react-query/src/useMutationState.ts#L35) +Defined in: [packages/react-query/src/useMutationState.ts:35](https://github.com/TanStack/query/blob/main/packages/react-query/src/useMutationState.ts#L35) The `useIsMutating` hook returns the `number` of mutations that your application currently has `pending` (useful for app-wide loading indicators). @@ -18,13 +18,13 @@ The `useIsMutating` hook returns the `number` of mutations that your application ### filters? -`MutationFilters`\<`unknown`, `Error`, `unknown`, `unknown`\> +[`MutationFilters`](../interfaces/MutationFilters.md)\<`unknown`, `Error`, `unknown`, `unknown`\> -The MutationFilters to narrow down the matched mutations. +The [MutationFilters](../interfaces/MutationFilters.md) to narrow down the matched mutations. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/react/reference/functions/useIsRestoring.md b/docs/framework/react/reference/functions/useIsRestoring.md index 4d55af9fd93..d2e0c293e45 100644 --- a/docs/framework/react/reference/functions/useIsRestoring.md +++ b/docs/framework/react/reference/functions/useIsRestoring.md @@ -7,7 +7,7 @@ title: useIsRestoring function useIsRestoring(): boolean; ``` -Defined in: [react-query/src/IsRestoringProvider.ts:13](https://github.com/TanStack/query/blob/main/packages/react-query/src/IsRestoringProvider.ts#L13) +Defined in: [packages/react-query/src/IsRestoringProvider.ts:13](https://github.com/TanStack/query/blob/main/packages/react-query/src/IsRestoringProvider.ts#L13) If you are using `PersistQueryClientProvider`, you can also use the `useIsRestoring` hook alongside it to check if a restore is currently in progress. `useQuery` and friends also check this internally to avoid diff --git a/docs/framework/react/reference/functions/useMutation.md b/docs/framework/react/reference/functions/useMutation.md index 8850b296418..4630aa1557e 100644 --- a/docs/framework/react/reference/functions/useMutation.md +++ b/docs/framework/react/reference/functions/useMutation.md @@ -9,7 +9,7 @@ redirect_from: function useMutation(options, queryClient?): UseMutationResult; ``` -Defined in: [react-query/src/useMutation.ts:191](https://github.com/TanStack/query/blob/main/packages/react-query/src/useMutation.ts#L191) +Defined in: [packages/react-query/src/useMutation.ts:191](https://github.com/TanStack/query/blob/main/packages/react-query/src/useMutation.ts#L191) Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects. `useMutation` is the hook for that. @@ -42,7 +42,7 @@ The [UseMutationOptions](../interfaces/UseMutationOptions.md) to use — everyth ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/react/reference/functions/useMutationState.md b/docs/framework/react/reference/functions/useMutationState.md index 7e5325c86e6..377c24f5e45 100644 --- a/docs/framework/react/reference/functions/useMutationState.md +++ b/docs/framework/react/reference/functions/useMutationState.md @@ -9,21 +9,21 @@ redirect_from: function useMutationState(options, queryClient?): TResult[]; ``` -Defined in: [react-query/src/useMutationState.ts:157](https://github.com/TanStack/query/blob/main/packages/react-query/src/useMutationState.ts#L157) +Defined in: [packages/react-query/src/useMutationState.ts:157](https://github.com/TanStack/query/blob/main/packages/react-query/src/useMutationState.ts#L157) `useMutationState` is a hook that gives you access to all mutations in the `MutationCache`. You can pass -`filters` (MutationFilters) to narrow down your mutations, and `select` to transform the mutation +`filters` ([MutationFilters](../interfaces/MutationFilters.md)) to narrow down your mutations, and `select` to transform the mutation state. ## Type Parameters ### TResult -`TResult` = `MutationState`\<`unknown`, `Error`, `unknown`, `unknown`\> +`TResult` = [`MutationState`](../interfaces/MutationState.md)\<`unknown`, `Error`, `unknown`, `unknown`\> ### TMutation -`TMutation` *extends* `Mutation`\<`any`, `any`, `any`, `any`\> = `MutationTypeFromResult`\<`TResult`\> +`TMutation` *extends* [`Mutation`](../classes/Mutation.md)\<`any`, `any`, `any`, `any`\> = `MutationTypeFromResult`\<`TResult`\> ## Parameters @@ -36,7 +36,7 @@ mutation state. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/react/reference/functions/usePrefetchInfiniteQuery.md b/docs/framework/react/reference/functions/usePrefetchInfiniteQuery.md index 179f2ab61d1..7bb628ad2c6 100644 --- a/docs/framework/react/reference/functions/usePrefetchInfiniteQuery.md +++ b/docs/framework/react/reference/functions/usePrefetchInfiniteQuery.md @@ -9,7 +9,7 @@ redirect_from: function usePrefetchInfiniteQuery(options, queryClient?): void; ``` -Defined in: [react-query/src/usePrefetchInfiniteQuery.tsx:56](https://github.com/TanStack/query/blob/main/packages/react-query/src/usePrefetchInfiniteQuery.tsx#L56) +Defined in: [packages/react-query/src/usePrefetchInfiniteQuery.tsx:56](https://github.com/TanStack/query/blob/main/packages/react-query/src/usePrefetchInfiniteQuery.tsx#L56) `usePrefetchInfiniteQuery` does not return anything, it should be used just to fire a prefetch during render, before a suspense boundary that wraps a component that uses `useSuspenseInfiniteQuery`. You can pass @@ -37,7 +37,7 @@ already there or already in flight. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> ### TQueryKey @@ -57,7 +57,7 @@ The [UsePrefetchInfiniteQueryOptions](../type-aliases/UsePrefetchInfiniteQueryOp ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/react/reference/functions/usePrefetchQuery.md b/docs/framework/react/reference/functions/usePrefetchQuery.md index e8aa516f8ab..48994793786 100644 --- a/docs/framework/react/reference/functions/usePrefetchQuery.md +++ b/docs/framework/react/reference/functions/usePrefetchQuery.md @@ -9,7 +9,7 @@ redirect_from: function usePrefetchQuery(options, queryClient?): void; ``` -Defined in: [react-query/src/usePrefetchQuery.tsx:42](https://github.com/TanStack/query/blob/main/packages/react-query/src/usePrefetchQuery.tsx#L42) +Defined in: [packages/react-query/src/usePrefetchQuery.tsx:42](https://github.com/TanStack/query/blob/main/packages/react-query/src/usePrefetchQuery.tsx#L42) `usePrefetchQuery` does not return anything, it should be used just to fire a prefetch during render, before a suspense boundary that wraps a component that uses `useSuspenseQuery`. You can pass everything to @@ -52,7 +52,7 @@ The [UsePrefetchQueryOptions](../type-aliases/UsePrefetchQueryOptions.md) to use ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/react/reference/functions/useQueries.md b/docs/framework/react/reference/functions/useQueries.md index c026f3f0683..3cca2e98031 100644 --- a/docs/framework/react/reference/functions/useQueries.md +++ b/docs/framework/react/reference/functions/useQueries.md @@ -9,7 +9,7 @@ redirect_from: function useQueries(__namedParameters, queryClient?): TCombinedResult; ``` -Defined in: [react-query/src/useQueries.ts:355](https://github.com/TanStack/query/blob/main/packages/react-query/src/useQueries.ts#L355) +Defined in: [packages/react-query/src/useQueries.ts:355](https://github.com/TanStack/query/blob/main/packages/react-query/src/useQueries.ts#L355) The `useQueries` hook can be used to fetch a variable number of queries. @@ -52,7 +52,7 @@ shared to be as referentially stable as possible. An array with query option objects, mostly identical to `useQuery` — except that `queryClient` and `subscribed` aren't accepted per-query (`subscribed` is a top-level option here instead), and -`placeholderData` accepts a QueriesPlaceholderDataFunction, which is called with `previousData` +`placeholderData` accepts a [QueriesPlaceholderDataFunction](../type-aliases/QueriesPlaceholderDataFunction.md), which is called with `previousData` and `previousQuery` always `undefined`, rather than `useQuery`'s placeholder function. #### subscribed? @@ -69,7 +69,7 @@ true ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to provide a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/react/reference/functions/useQuery.md b/docs/framework/react/reference/functions/useQuery.md index 010680f644a..d0d3b478b1d 100644 --- a/docs/framework/react/reference/functions/useQuery.md +++ b/docs/framework/react/reference/functions/useQuery.md @@ -11,7 +11,7 @@ redirect_from: function useQuery(options, queryClient?): DefinedUseQueryResult; ``` -Defined in: [react-query/src/useQuery.ts:50](https://github.com/TanStack/query/blob/main/packages/react-query/src/useQuery.ts#L50) +Defined in: [packages/react-query/src/useQuery.ts:50](https://github.com/TanStack/query/blob/main/packages/react-query/src/useQuery.ts#L50) This overload is selected when `initialData` is set, so the resulting `data` is never `undefined`. @@ -43,7 +43,7 @@ The [DefinedInitialDataOptions](../type-aliases/DefinedInitialDataOptions.md) to #### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. @@ -91,7 +91,7 @@ function Posts() { function useQuery(options, queryClient?): UseQueryResult; ``` -Defined in: [react-query/src/useQuery.ts:117](https://github.com/TanStack/query/blob/main/packages/react-query/src/useQuery.ts#L117) +Defined in: [packages/react-query/src/useQuery.ts:117](https://github.com/TanStack/query/blob/main/packages/react-query/src/useQuery.ts#L117) ### Type Parameters @@ -121,7 +121,7 @@ The [UndefinedInitialDataOptions](../type-aliases/UndefinedInitialDataOptions.md #### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. @@ -192,7 +192,7 @@ function Posts() { function useQuery(options, queryClient?): UseQueryResult; ``` -Defined in: [react-query/src/useQuery.ts:281](https://github.com/TanStack/query/blob/main/packages/react-query/src/useQuery.ts#L281) +Defined in: [packages/react-query/src/useQuery.ts:281](https://github.com/TanStack/query/blob/main/packages/react-query/src/useQuery.ts#L281) ### Type Parameters @@ -222,7 +222,7 @@ The [UseQueryOptions](../interfaces/UseQueryOptions.md) to use — everything yo #### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/react/reference/functions/useQueryClient.md b/docs/framework/react/reference/functions/useQueryClient.md index 77368631356..4b60a8ed443 100644 --- a/docs/framework/react/reference/functions/useQueryClient.md +++ b/docs/framework/react/reference/functions/useQueryClient.md @@ -9,7 +9,7 @@ redirect_from: function useQueryClient(queryClient?): QueryClient; ``` -Defined in: [react-query/src/QueryClientProvider.tsx:21](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryClientProvider.tsx#L21) +Defined in: [packages/react-query/src/QueryClientProvider.tsx:21](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryClientProvider.tsx#L21) The `useQueryClient` hook returns the current `QueryClient` instance. @@ -17,14 +17,14 @@ The `useQueryClient` hook returns the current `QueryClient` instance. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. ## Returns -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) The current `QueryClient` instance. diff --git a/docs/framework/react/reference/functions/useQueryErrorResetBoundary.md b/docs/framework/react/reference/functions/useQueryErrorResetBoundary.md index 76510277d67..09d1ae66adc 100644 --- a/docs/framework/react/reference/functions/useQueryErrorResetBoundary.md +++ b/docs/framework/react/reference/functions/useQueryErrorResetBoundary.md @@ -9,7 +9,7 @@ redirect_from: function useQueryErrorResetBoundary(): QueryErrorResetBoundaryValue; ``` -Defined in: [react-query/src/QueryErrorResetBoundary.tsx:76](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L76) +Defined in: [packages/react-query/src/QueryErrorResetBoundary.tsx:76](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L76) This hook will reset any query errors within the closest `QueryErrorResetBoundary`. If there is no boundary defined it will reset them globally. diff --git a/docs/framework/react/reference/functions/useSuspenseInfiniteQuery.md b/docs/framework/react/reference/functions/useSuspenseInfiniteQuery.md index 7fc7483c0e6..956ff2f6d83 100644 --- a/docs/framework/react/reference/functions/useSuspenseInfiniteQuery.md +++ b/docs/framework/react/reference/functions/useSuspenseInfiniteQuery.md @@ -9,7 +9,7 @@ redirect_from: function useSuspenseInfiniteQuery(options, queryClient?): UseSuspenseInfiniteQueryResult; ``` -Defined in: [react-query/src/useSuspenseInfiniteQuery.ts:104](https://github.com/TanStack/query/blob/main/packages/react-query/src/useSuspenseInfiniteQuery.ts#L104) +Defined in: [packages/react-query/src/useSuspenseInfiniteQuery.ts:104](https://github.com/TanStack/query/blob/main/packages/react-query/src/useSuspenseInfiniteQuery.ts#L104) The options for `useSuspenseInfiniteQuery` are the same as for `useInfiniteQuery`, except for `throwOnError`, `enabled`, and `placeholderData`. @@ -28,7 +28,7 @@ Caveat: cancellation does not work. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> ### TQueryKey @@ -48,7 +48,7 @@ The [UseSuspenseInfiniteQueryOptions](../interfaces/UseSuspenseInfiniteQueryOpti ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/react/reference/functions/useSuspenseQueries.md b/docs/framework/react/reference/functions/useSuspenseQueries.md index 6f58ae559e2..5b185da050b 100644 --- a/docs/framework/react/reference/functions/useSuspenseQueries.md +++ b/docs/framework/react/reference/functions/useSuspenseQueries.md @@ -11,7 +11,7 @@ redirect_from: function useSuspenseQueries(options, queryClient?): TCombinedResult; ``` -Defined in: [react-query/src/useSuspenseQueries.ts:349](https://github.com/TanStack/query/blob/main/packages/react-query/src/useSuspenseQueries.ts#L349) +Defined in: [packages/react-query/src/useSuspenseQueries.ts:349](https://github.com/TanStack/query/blob/main/packages/react-query/src/useSuspenseQueries.ts#L349) The options for `useSuspenseQueries` are the same as for `useQueries`, except that the top-level `subscribed` option isn't supported, and each `query` can't have `throwOnError`, `enabled`, or `placeholderData`. @@ -48,7 +48,7 @@ An array with query option objects identical to `useSuspenseQuery`. #### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to provide a custom `QueryClient`. Otherwise, the one from the nearest context will be used. @@ -221,7 +221,7 @@ function App() { function useSuspenseQueries(options, queryClient?): TCombinedResult; ``` -Defined in: [react-query/src/useSuspenseQueries.ts:489](https://github.com/TanStack/query/blob/main/packages/react-query/src/useSuspenseQueries.ts#L489) +Defined in: [packages/react-query/src/useSuspenseQueries.ts:489](https://github.com/TanStack/query/blob/main/packages/react-query/src/useSuspenseQueries.ts#L489) The options for `useSuspenseQueries` are the same as for `useQueries`, except that the top-level `subscribed` option isn't supported, and each `query` can't have `throwOnError`, `enabled`, or `placeholderData`. @@ -257,7 +257,7 @@ An array with query option objects identical to `useSuspenseQuery`. #### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to provide a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/react/reference/functions/useSuspenseQuery.md b/docs/framework/react/reference/functions/useSuspenseQuery.md index 1e4c9debb8e..afa0ba0d6bc 100644 --- a/docs/framework/react/reference/functions/useSuspenseQuery.md +++ b/docs/framework/react/reference/functions/useSuspenseQuery.md @@ -9,7 +9,7 @@ redirect_from: function useSuspenseQuery(options, queryClient?): UseSuspenseQueryResult; ``` -Defined in: [react-query/src/useSuspenseQuery.ts:75](https://github.com/TanStack/query/blob/main/packages/react-query/src/useSuspenseQuery.ts#L75) +Defined in: [packages/react-query/src/useSuspenseQuery.ts:75](https://github.com/TanStack/query/blob/main/packages/react-query/src/useSuspenseQuery.ts#L75) The options for `useSuspenseQuery` are the same as for `useQuery`, except for `throwOnError`, `enabled`, and `placeholderData` — and `queryFn` may not be `skipToken`, since Suspense hooks can't render a "disabled" state. @@ -44,7 +44,7 @@ The [UseSuspenseQueryOptions](../interfaces/UseSuspenseQueryOptions.md) to use ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/react/reference/index.md b/docs/framework/react/reference/index.md index 29afd251300..823c518e2e7 100644 --- a/docs/framework/react/reference/index.md +++ b/docs/framework/react/reference/index.md @@ -3,10 +3,78 @@ id: "@tanstack/react-query" title: "@tanstack/react-query" --- +## Classes + +- [CancelledError](classes/CancelledError.md) +- [InfiniteQueryObserver](classes/InfiniteQueryObserver.md) +- [Mutation](classes/Mutation.md) +- [MutationCache](classes/MutationCache.md) +- [MutationObserver](classes/MutationObserver.md) +- [QueriesObserver](classes/QueriesObserver.md) +- [Query](classes/Query.md) +- [QueryCache](classes/QueryCache.md) +- [QueryClient](classes/QueryClient.md) +- [QueryObserver](classes/QueryObserver.md) + ## Interfaces +- [CancelOptions](interfaces/CancelOptions.md) +- [DefaultOptions](interfaces/DefaultOptions.md) +- [DehydratedState](interfaces/DehydratedState.md) +- [DehydrateOptions](interfaces/DehydrateOptions.md) +- [~~EnsureQueryDataOptions~~](interfaces/EnsureQueryDataOptions.md) +- [FetchNextPageOptions](interfaces/FetchNextPageOptions.md) +- [FetchPreviousPageOptions](interfaces/FetchPreviousPageOptions.md) +- [~~FetchQueryOptions~~](interfaces/FetchQueryOptions.md) +- [HydrateOptions](interfaces/HydrateOptions.md) - [HydrationBoundaryProps](interfaces/HydrationBoundaryProps.md) +- [InfiniteData](interfaces/InfiniteData.md) +- [InfiniteQueryObserverBaseResult](interfaces/InfiniteQueryObserverBaseResult.md) +- [InfiniteQueryObserverLoadingErrorResult](interfaces/InfiniteQueryObserverLoadingErrorResult.md) +- [InfiniteQueryObserverLoadingResult](interfaces/InfiniteQueryObserverLoadingResult.md) +- [InfiniteQueryObserverOptions](interfaces/InfiniteQueryObserverOptions.md) +- [InfiniteQueryObserverPendingResult](interfaces/InfiniteQueryObserverPendingResult.md) +- [InfiniteQueryObserverPlaceholderResult](interfaces/InfiniteQueryObserverPlaceholderResult.md) +- [InfiniteQueryObserverRefetchErrorResult](interfaces/InfiniteQueryObserverRefetchErrorResult.md) +- [InfiniteQueryObserverSuccessResult](interfaces/InfiniteQueryObserverSuccessResult.md) +- [InfiniteQueryPageParamsOptions](interfaces/InfiniteQueryPageParamsOptions.md) +- [InitialPageParam](interfaces/InitialPageParam.md) +- [InvalidateOptions](interfaces/InvalidateOptions.md) +- [InvalidateQueryFilters](interfaces/InvalidateQueryFilters.md) +- [MutateOptions](interfaces/MutateOptions.md) +- [MutationCacheConfig](interfaces/MutationCacheConfig.md) +- [MutationFilters](interfaces/MutationFilters.md) +- [MutationObserverBaseResult](interfaces/MutationObserverBaseResult.md) +- [MutationObserverErrorResult](interfaces/MutationObserverErrorResult.md) +- [MutationObserverIdleResult](interfaces/MutationObserverIdleResult.md) +- [MutationObserverLoadingResult](interfaces/MutationObserverLoadingResult.md) +- [MutationObserverOptions](interfaces/MutationObserverOptions.md) +- [MutationObserverSuccessResult](interfaces/MutationObserverSuccessResult.md) +- [MutationOptions](interfaces/MutationOptions.md) +- [MutationState](interfaces/MutationState.md) +- [NotifyEvent](interfaces/NotifyEvent.md) +- [QueriesObserverOptions](interfaces/QueriesObserverOptions.md) +- [QueryCacheConfig](interfaces/QueryCacheConfig.md) +- [QueryClientConfig](interfaces/QueryClientConfig.md) - [QueryErrorResetBoundaryProps](interfaces/QueryErrorResetBoundaryProps.md) +- [QueryExecuteOptions](interfaces/QueryExecuteOptions.md) +- [QueryFilters](interfaces/QueryFilters.md) +- [QueryObserverBaseResult](interfaces/QueryObserverBaseResult.md) +- [QueryObserverLoadingErrorResult](interfaces/QueryObserverLoadingErrorResult.md) +- [QueryObserverLoadingResult](interfaces/QueryObserverLoadingResult.md) +- [QueryObserverOptions](interfaces/QueryObserverOptions.md) +- [QueryObserverPendingResult](interfaces/QueryObserverPendingResult.md) +- [QueryObserverPlaceholderResult](interfaces/QueryObserverPlaceholderResult.md) +- [QueryObserverRefetchErrorResult](interfaces/QueryObserverRefetchErrorResult.md) +- [QueryObserverSuccessResult](interfaces/QueryObserverSuccessResult.md) +- [QueryOptions](interfaces/QueryOptions.md) +- [QueryState](interfaces/QueryState.md) +- [RefetchOptions](interfaces/RefetchOptions.md) +- [RefetchQueryFilters](interfaces/RefetchQueryFilters.md) +- [Register](interfaces/Register.md) +- [ResetOptions](interfaces/ResetOptions.md) +- [ResultOptions](interfaces/ResultOptions.md) +- [SetDataOptions](interfaces/SetDataOptions.md) - [UseBaseQueryOptions](interfaces/UseBaseQueryOptions.md) - [UseInfiniteQueryOptions](interfaces/UseInfiniteQueryOptions.md) - [UseMutationOptions](interfaces/UseMutationOptions.md) @@ -16,29 +84,87 @@ title: "@tanstack/react-query" ## Type Aliases +- [AnyDataTag](type-aliases/AnyDataTag.md) - [AnyUseBaseQueryOptions](type-aliases/AnyUseBaseQueryOptions.md) - [AnyUseInfiniteQueryOptions](type-aliases/AnyUseInfiniteQueryOptions.md) - [AnyUseMutationOptions](type-aliases/AnyUseMutationOptions.md) - [AnyUseQueryOptions](type-aliases/AnyUseQueryOptions.md) - [AnyUseSuspenseInfiniteQueryOptions](type-aliases/AnyUseSuspenseInfiniteQueryOptions.md) - [AnyUseSuspenseQueryOptions](type-aliases/AnyUseSuspenseQueryOptions.md) +- [DataTag](type-aliases/DataTag.md) +- [dataTagErrorSymbol](type-aliases/dataTagErrorSymbol.md) +- [dataTagSymbol](type-aliases/dataTagSymbol.md) +- [DefaultedInfiniteQueryObserverOptions](type-aliases/DefaultedInfiniteQueryObserverOptions.md) +- [DefaultedQueryObserverOptions](type-aliases/DefaultedQueryObserverOptions.md) +- [DefaultError](type-aliases/DefaultError.md) +- [DefinedInfiniteQueryObserverResult](type-aliases/DefinedInfiniteQueryObserverResult.md) - [DefinedInitialDataInfiniteOptions](type-aliases/DefinedInitialDataInfiniteOptions.md) - [DefinedInitialDataOptions](type-aliases/DefinedInitialDataOptions.md) +- [DefinedQueryObserverResult](type-aliases/DefinedQueryObserverResult.md) - [DefinedUseInfiniteQueryResult](type-aliases/DefinedUseInfiniteQueryResult.md) - [DefinedUseQueryResult](type-aliases/DefinedUseQueryResult.md) +- [DistributiveOmit](type-aliases/DistributiveOmit.md) +- [~~EnsureInfiniteQueryDataOptions~~](type-aliases/EnsureInfiniteQueryDataOptions.md) +- [~~FetchInfiniteQueryOptions~~](type-aliases/FetchInfiniteQueryOptions.md) +- [FetchStatus](type-aliases/FetchStatus.md) +- [GetNextPageParamFunction](type-aliases/GetNextPageParamFunction.md) +- [GetPreviousPageParamFunction](type-aliases/GetPreviousPageParamFunction.md) +- [InferDataFromTag](type-aliases/InferDataFromTag.md) +- [InferErrorFromTag](type-aliases/InferErrorFromTag.md) +- [InfiniteQueryExecuteOptions](type-aliases/InfiniteQueryExecuteOptions.md) +- [InfiniteQueryObserverResult](type-aliases/InfiniteQueryObserverResult.md) +- [InitialDataFunction](type-aliases/InitialDataFunction.md) +- [ManagedTimerId](type-aliases/ManagedTimerId.md) +- [MutateFunction](type-aliases/MutateFunction.md) +- [MutateFunctionRest](type-aliases/MutateFunctionRest.md) +- [MutationCacheNotifyEvent](type-aliases/MutationCacheNotifyEvent.md) +- [MutationFunction](type-aliases/MutationFunction.md) +- [MutationFunctionContext](type-aliases/MutationFunctionContext.md) +- [MutationKey](type-aliases/MutationKey.md) +- [MutationMeta](type-aliases/MutationMeta.md) +- [MutationObserverResult](type-aliases/MutationObserverResult.md) +- [MutationScope](type-aliases/MutationScope.md) +- [MutationStatus](type-aliases/MutationStatus.md) +- [NetworkMode](type-aliases/NetworkMode.md) +- [NonUndefinedGuard](type-aliases/NonUndefinedGuard.md) +- [NotifyEventType](type-aliases/NotifyEventType.md) +- [NotifyOnChangeProps](type-aliases/NotifyOnChangeProps.md) +- [OmitKeyof](type-aliases/OmitKeyof.md) +- [Override](type-aliases/Override.md) +- [PlaceholderDataFunction](type-aliases/PlaceholderDataFunction.md) - [QueriesOptions](type-aliases/QueriesOptions.md) +- [QueriesPlaceholderDataFunction](type-aliases/QueriesPlaceholderDataFunction.md) - [QueriesResults](type-aliases/QueriesResults.md) +- [QueryBooleanOption](type-aliases/QueryBooleanOption.md) +- [QueryCacheNotifyEvent](type-aliases/QueryCacheNotifyEvent.md) - [QueryClientProviderProps](type-aliases/QueryClientProviderProps.md) - [QueryErrorClearResetFunction](type-aliases/QueryErrorClearResetFunction.md) - [QueryErrorIsResetFunction](type-aliases/QueryErrorIsResetFunction.md) - [QueryErrorResetBoundaryFunction](type-aliases/QueryErrorResetBoundaryFunction.md) - [QueryErrorResetFunction](type-aliases/QueryErrorResetFunction.md) +- [QueryFunction](type-aliases/QueryFunction.md) +- [QueryFunctionContext](type-aliases/QueryFunctionContext.md) +- [QueryKey](type-aliases/QueryKey.md) +- [QueryKeyHashFunction](type-aliases/QueryKeyHashFunction.md) +- [QueryKeyWithDataTag](type-aliases/QueryKeyWithDataTag.md) +- [QueryMeta](type-aliases/QueryMeta.md) +- [QueryObserverResult](type-aliases/QueryObserverResult.md) +- [QueryPersister](type-aliases/QueryPersister.md) +- [QueryStatus](type-aliases/QueryStatus.md) +- [SkipToken](type-aliases/SkipToken.md) +- [StaleTime](type-aliases/StaleTime.md) +- [StaleTimeFunction](type-aliases/StaleTimeFunction.md) - [SuspenseQueriesOptions](type-aliases/SuspenseQueriesOptions.md) - [SuspenseQueriesResults](type-aliases/SuspenseQueriesResults.md) +- [ThrowOnError](type-aliases/ThrowOnError.md) +- [TimeoutCallback](type-aliases/TimeoutCallback.md) +- [TimeoutProvider](type-aliases/TimeoutProvider.md) - [UndefinedInitialDataInfiniteOptions](type-aliases/UndefinedInitialDataInfiniteOptions.md) - [UndefinedInitialDataOptions](type-aliases/UndefinedInitialDataOptions.md) +- [UnsetMarker](type-aliases/UnsetMarker.md) - [UnusedSkipTokenInfiniteOptions](type-aliases/UnusedSkipTokenInfiniteOptions.md) - [UnusedSkipTokenOptions](type-aliases/UnusedSkipTokenOptions.md) +- [Updater](type-aliases/Updater.md) - [UseBaseMutationResult](type-aliases/UseBaseMutationResult.md) - [UseBaseQueryResult](type-aliases/UseBaseQueryResult.md) - [UseInfiniteQueryResult](type-aliases/UseInfiniteQueryResult.md) @@ -50,20 +176,47 @@ title: "@tanstack/react-query" - [UseQueryResult](type-aliases/UseQueryResult.md) - [UseSuspenseInfiniteQueryResult](type-aliases/UseSuspenseInfiniteQueryResult.md) - [UseSuspenseQueryResult](type-aliases/UseSuspenseQueryResult.md) +- [WithRequired](type-aliases/WithRequired.md) ## Variables +- [dataTagErrorSymbol](variables/dataTagErrorSymbol.md) +- [dataTagSymbol](variables/dataTagSymbol.md) +- [defaultScheduler](variables/defaultScheduler.md) +- [environmentManager](variables/environmentManager.md) +- [focusManager](variables/focusManager.md) - [IsRestoringProvider](variables/IsRestoringProvider.md) +- [~~isServer~~](variables/isServer.md) +- [notifyManager](variables/notifyManager.md) +- [onlineManager](variables/onlineManager.md) - [QueryClientContext](variables/QueryClientContext.md) +- [skipToken](variables/skipToken.md) +- [timeoutManager](variables/timeoutManager.md) +- [unsetMarker](variables/unsetMarker.md) ## Functions +- [defaultShouldDehydrateMutation](functions/defaultShouldDehydrateMutation.md) +- [defaultShouldDehydrateQuery](functions/defaultShouldDehydrateQuery.md) +- [dehydrate](functions/dehydrate.md) +- [dehydrateQuery](functions/dehydrateQuery.md) +- [experimental\_streamedQuery](functions/experimental_streamedQuery.md) +- [hashKey](functions/hashKey.md) +- [hydrate](functions/hydrate.md) - [HydrationBoundary](functions/HydrationBoundary.md) - [infiniteQueryOptions](functions/infiniteQueryOptions.md) +- [~~isCancelledError~~](functions/isCancelledError.md) +- [keepPreviousData](functions/keepPreviousData.md) +- [matchMutation](functions/matchMutation.md) +- [matchQuery](functions/matchQuery.md) - [mutationOptions](functions/mutationOptions.md) +- [noop](functions/noop.md) +- [partialMatchKey](functions/partialMatchKey.md) - [QueryClientProvider](functions/QueryClientProvider.md) - [QueryErrorResetBoundary](functions/QueryErrorResetBoundary.md) - [queryOptions](functions/queryOptions.md) +- [replaceEqualDeep](functions/replaceEqualDeep.md) +- [shouldThrowError](functions/shouldThrowError.md) - [useInfiniteQuery](functions/useInfiniteQuery.md) - [useIsFetching](functions/useIsFetching.md) - [useIsMutating](functions/useIsMutating.md) diff --git a/docs/framework/react/reference/interfaces/CancelOptions.md b/docs/framework/react/reference/interfaces/CancelOptions.md new file mode 100644 index 00000000000..2b9293712d2 --- /dev/null +++ b/docs/framework/react/reference/interfaces/CancelOptions.md @@ -0,0 +1,26 @@ +--- +id: CancelOptions +title: CancelOptions +--- + +Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) + +## Properties + +### revert? + +```ts +optional revert: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1444) + +*** + +### silent? + +```ts +optional silent: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1445](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1445) diff --git a/docs/framework/react/reference/interfaces/DefaultOptions.md b/docs/framework/react/reference/interfaces/DefaultOptions.md new file mode 100644 index 00000000000..149ef5b3444 --- /dev/null +++ b/docs/framework/react/reference/interfaces/DefaultOptions.md @@ -0,0 +1,76 @@ +--- +id: DefaultOptions +title: DefaultOptions +--- + +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) + +## Type Parameters + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### dehydrate? + +```ts +optional dehydrate: DehydrateOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) + +*** + +### hydrate? + +```ts +optional hydrate: object; +``` + +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) + +#### deserializeData? + +```ts +optional deserializeData: TransformerFn; +``` + +Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. + +#### mutations? + +```ts +optional mutations: MutationOptions; +``` + +Default options merged into every mutation restored from the dehydrated state. + +#### queries? + +```ts +optional queries: QueryOptions; +``` + +Default options merged into every query restored from the dehydrated state. + +*** + +### mutations? + +```ts +optional mutations: MutationObserverOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) + +*** + +### queries? + +```ts +optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; +``` + +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) diff --git a/docs/framework/react/reference/interfaces/DehydrateOptions.md b/docs/framework/react/reference/interfaces/DehydrateOptions.md new file mode 100644 index 00000000000..e862ae88b43 --- /dev/null +++ b/docs/framework/react/reference/interfaces/DehydrateOptions.md @@ -0,0 +1,89 @@ +--- +id: DehydrateOptions +title: DehydrateOptions +--- + +Defined in: [packages/query-core/src/hydration.ts:42](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L42) + +Options for `dehydrate`, controlling which queries/mutations are included in the resulting `DehydratedState` and +how their data/errors are transformed before being serialized (e.g. for embedding in server-rendered markup). + +## Properties + +### serializeData? + +```ts +optional serializeData: TransformerFn; +``` + +Defined in: [packages/query-core/src/hydration.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L44) + +Transforms a query's `data` before it is dehydrated. Useful for non-JSON-serializable data. + +*** + +### shouldDehydrateMutation()? + +```ts +optional shouldDehydrateMutation: (mutation) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:46](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L46) + +Predicate to decide whether a given `Mutation` should be dehydrated. Defaults to `defaultShouldDehydrateMutation`. + +#### Parameters + +##### mutation + +[`Mutation`](../classes/Mutation.md) + +#### Returns + +`boolean` + +*** + +### shouldDehydrateQuery()? + +```ts +optional shouldDehydrateQuery: (query) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:48](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L48) + +Predicate to decide whether a given `Query` should be dehydrated. Defaults to `defaultShouldDehydrateQuery`. + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +*** + +### shouldRedactErrors()? + +```ts +optional shouldRedactErrors: (error) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L54) + +Predicate to decide whether a query's error should be redacted before dehydration. Errors are redacted +(replaced with a generic `Error('redacted')`) unless this function is provided and returns `false` for the +given error, in which case the original error is kept. + +#### Parameters + +##### error + +`unknown` + +#### Returns + +`boolean` diff --git a/docs/framework/react/reference/interfaces/DehydratedState.md b/docs/framework/react/reference/interfaces/DehydratedState.md new file mode 100644 index 00000000000..7edce60a00d --- /dev/null +++ b/docs/framework/react/reference/interfaces/DehydratedState.md @@ -0,0 +1,30 @@ +--- +id: DehydratedState +title: DehydratedState +--- + +Defined in: [packages/query-core/src/hydration.ts:97](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L97) + +A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically +transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data +that has already been fetched, avoiding a redundant fetch on the client. + +## Properties + +### mutations + +```ts +mutations: DehydratedMutation[]; +``` + +Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L98) + +*** + +### queries + +```ts +queries: DehydratedQuery[]; +``` + +Defined in: [packages/query-core/src/hydration.ts:99](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L99) diff --git a/docs/framework/react/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/react/reference/interfaces/EnsureQueryDataOptions.md new file mode 100644 index 00000000000..d7b4751a9d3 --- /dev/null +++ b/docs/framework/react/reference/interfaces/EnsureQueryDataOptions.md @@ -0,0 +1,343 @@ +--- +id: EnsureQueryDataOptions +title: EnsureQueryDataOptions +--- + +Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) + +## Deprecated + +## Extends + +- [`FetchQueryOptions`](FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### ~~gcTime?~~ + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`gcTime`](FetchQueryOptions.md#gctime) + +*** + +### ~~initialData?~~ + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialData`](FetchQueryOptions.md#initialdata) + +*** + +### ~~initialDataUpdatedAt?~~ + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialDataUpdatedAt`](FetchQueryOptions.md#initialdataupdatedat) + +*** + +### ~~initialPageParam?~~ + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialPageParam`](FetchQueryOptions.md#initialpageparam) + +*** + +### ~~maxPages?~~ + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`maxPages`](FetchQueryOptions.md#maxpages) + +*** + +### ~~meta?~~ + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`meta`](FetchQueryOptions.md#meta) + +*** + +### ~~networkMode?~~ + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`networkMode`](FetchQueryOptions.md#networkmode) + +*** + +### ~~persister?~~ + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`persister`](FetchQueryOptions.md#persister) + +*** + +### ~~queryFn?~~ + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryFn`](FetchQueryOptions.md#queryfn) + +*** + +### ~~queryHash?~~ + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryHash`](FetchQueryOptions.md#queryhash) + +*** + +### ~~queryKey~~ + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryKey`](FetchQueryOptions.md#querykey) + +*** + +### ~~queryKeyHashFn?~~ + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryKeyHashFn`](FetchQueryOptions.md#querykeyhashfn) + +*** + +### ~~retry?~~ + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`retry`](FetchQueryOptions.md#retry) + +*** + +### ~~retryDelay?~~ + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`retryDelay`](FetchQueryOptions.md#retrydelay) + +*** + +### ~~revalidateIfStale?~~ + +```ts +optional revalidateIfStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L608) + +*** + +### ~~staleTime?~~ + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`staleTime`](FetchQueryOptions.md#staletime) + +*** + +### ~~structuralSharing?~~ + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`structuralSharing`](FetchQueryOptions.md#structuralsharing) diff --git a/docs/framework/react/reference/interfaces/FetchNextPageOptions.md b/docs/framework/react/reference/interfaces/FetchNextPageOptions.md new file mode 100644 index 00000000000..fefe7f30c13 --- /dev/null +++ b/docs/framework/react/reference/interfaces/FetchNextPageOptions.md @@ -0,0 +1,41 @@ +--- +id: FetchNextPageOptions +title: FetchNextPageOptions +--- + +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) + +If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, +whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + +If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/react/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/react/reference/interfaces/FetchPreviousPageOptions.md new file mode 100644 index 00000000000..ad3c3c736c9 --- /dev/null +++ b/docs/framework/react/reference/interfaces/FetchPreviousPageOptions.md @@ -0,0 +1,41 @@ +--- +id: FetchPreviousPageOptions +title: FetchPreviousPageOptions +--- + +Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) + +If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, +whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + +If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/react/reference/interfaces/FetchQueryOptions.md b/docs/framework/react/reference/interfaces/FetchQueryOptions.md new file mode 100644 index 00000000000..3b9347e06ea --- /dev/null +++ b/docs/framework/react/reference/interfaces/FetchQueryOptions.md @@ -0,0 +1,357 @@ +--- +id: FetchQueryOptions +title: FetchQueryOptions +--- + +Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L576) + +## Deprecated + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Extended by + +- [`EnsureQueryDataOptions`](EnsureQueryDataOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### ~~gcTime?~~ + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### ~~initialData?~~ + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### ~~initialDataUpdatedAt?~~ + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### ~~initialPageParam?~~ + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) + +*** + +### ~~maxPages?~~ + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### ~~meta?~~ + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### ~~networkMode?~~ + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### ~~persister?~~ + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### ~~queryFn?~~ + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### ~~queryHash?~~ + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### ~~queryKey~~ + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### ~~queryKeyHashFn?~~ + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### ~~retry?~~ + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### ~~retryDelay?~~ + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### ~~staleTime?~~ + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +*** + +### ~~structuralSharing?~~ + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` diff --git a/docs/framework/react/reference/interfaces/HydrateOptions.md b/docs/framework/react/reference/interfaces/HydrateOptions.md new file mode 100644 index 00000000000..fe8b92317e3 --- /dev/null +++ b/docs/framework/react/reference/interfaces/HydrateOptions.md @@ -0,0 +1,43 @@ +--- +id: HydrateOptions +title: HydrateOptions +--- + +Defined in: [packages/query-core/src/hydration.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L61) + +Options for `hydrate`, controlling the default options applied to queries/mutations restored from a +`DehydratedState`, and how to reverse any transformation applied by `DehydrateOptions.serializeData`. + +## Properties + +### defaultOptions? + +```ts +optional defaultOptions: object; +``` + +Defined in: [packages/query-core/src/hydration.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L62) + +#### deserializeData? + +```ts +optional deserializeData: TransformerFn; +``` + +Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. + +#### mutations? + +```ts +optional mutations: MutationOptions; +``` + +Default options merged into every mutation restored from the dehydrated state. + +#### queries? + +```ts +optional queries: QueryOptions; +``` + +Default options merged into every query restored from the dehydrated state. diff --git a/docs/framework/react/reference/interfaces/HydrationBoundaryProps.md b/docs/framework/react/reference/interfaces/HydrationBoundaryProps.md index 860db9e12fc..8728b02a751 100644 --- a/docs/framework/react/reference/interfaces/HydrationBoundaryProps.md +++ b/docs/framework/react/reference/interfaces/HydrationBoundaryProps.md @@ -3,7 +3,7 @@ id: HydrationBoundaryProps title: HydrationBoundaryProps --- -Defined in: [react-query/src/HydrationBoundary.tsx:16](https://github.com/TanStack/query/blob/main/packages/react-query/src/HydrationBoundary.tsx#L16) +Defined in: [packages/react-query/src/HydrationBoundary.tsx:16](https://github.com/TanStack/query/blob/main/packages/react-query/src/HydrationBoundary.tsx#L16) The props accepted by `HydrationBoundary`. @@ -15,7 +15,7 @@ The props accepted by `HydrationBoundary`. optional children: ReactNode; ``` -Defined in: [react-query/src/HydrationBoundary.tsx:36](https://github.com/TanStack/query/blob/main/packages/react-query/src/HydrationBoundary.tsx#L36) +Defined in: [packages/react-query/src/HydrationBoundary.tsx:36](https://github.com/TanStack/query/blob/main/packages/react-query/src/HydrationBoundary.tsx#L36) The components to render — always rendered unconditionally, not gated on hydration. New queries are hydrated into the cache during render; for queries that already exist in the cache, only newer dehydrated @@ -30,7 +30,7 @@ lands. optional options: OmitKeyof & object; ``` -Defined in: [react-query/src/HydrationBoundary.tsx:24](https://github.com/TanStack/query/blob/main/packages/react-query/src/HydrationBoundary.tsx#L24) +Defined in: [packages/react-query/src/HydrationBoundary.tsx:24](https://github.com/TanStack/query/blob/main/packages/react-query/src/HydrationBoundary.tsx#L24) Optional. Note: unlike `hydrate`, `mutations` cannot be set here. @@ -40,6 +40,9 @@ Optional. Note: unlike `hydrate`, `mutations` cannot be set here. ```ts optional defaultOptions: OmitKeyof<{ + deserializeData?: TransformerFn; + mutations?: MutationOptions; + queries?: QueryOptions; }, "mutations">; ``` @@ -51,7 +54,7 @@ optional defaultOptions: OmitKeyof<{ optional queryClient: QueryClient; ``` -Defined in: [react-query/src/HydrationBoundary.tsx:40](https://github.com/TanStack/query/blob/main/packages/react-query/src/HydrationBoundary.tsx#L40) +Defined in: [packages/react-query/src/HydrationBoundary.tsx:40](https://github.com/TanStack/query/blob/main/packages/react-query/src/HydrationBoundary.tsx#L40) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. @@ -63,6 +66,6 @@ Use this to use a custom `QueryClient`. Otherwise, the one from the nearest cont state: DehydratedState | null | undefined; ``` -Defined in: [react-query/src/HydrationBoundary.tsx:20](https://github.com/TanStack/query/blob/main/packages/react-query/src/HydrationBoundary.tsx#L20) +Defined in: [packages/react-query/src/HydrationBoundary.tsx:20](https://github.com/TanStack/query/blob/main/packages/react-query/src/HydrationBoundary.tsx#L20) The state to hydrate. diff --git a/docs/framework/react/reference/interfaces/InfiniteData.md b/docs/framework/react/reference/interfaces/InfiniteData.md new file mode 100644 index 00000000000..4d7ad595c2d --- /dev/null +++ b/docs/framework/react/reference/interfaces/InfiniteData.md @@ -0,0 +1,36 @@ +--- +id: InfiniteData +title: InfiniteData +--- + +Defined in: [packages/query-core/src/types.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L210) + +## Type Parameters + +### TData + +`TData` + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### pageParams + +```ts +pageParams: TPageParam[]; +``` + +Defined in: [packages/query-core/src/types.ts:212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L212) + +*** + +### pages + +```ts +pages: TData[]; +``` + +Defined in: [packages/query-core/src/types.ts:211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L211) diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverBaseResult.md new file mode 100644 index 00000000000..94347ea2e40 --- /dev/null +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -0,0 +1,577 @@ +--- +id: InfiniteQueryObserverBaseResult +title: InfiniteQueryObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Extended by + +- [`InfiniteQueryObserverPendingResult`](InfiniteQueryObserverPendingResult.md) +- [`InfiniteQueryObserverLoadingResult`](InfiniteQueryObserverLoadingResult.md) +- [`InfiniteQueryObserverLoadingErrorResult`](InfiniteQueryObserverLoadingErrorResult.md) +- [`InfiniteQueryObserverRefetchErrorResult`](InfiniteQueryObserverRefetchErrorResult.md) +- [`InfiniteQueryObserverSuccessResult`](InfiniteQueryObserverSuccessResult.md) +- [`InfiniteQueryObserverPlaceholderResult`](InfiniteQueryObserverPlaceholderResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) + +The last successfully resolved data for the query. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) + +Will be `true` if the query failed while fetching the next page. + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) + +Will be `true` if the query failed while fetching the previous page. + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) + +Will be `true` if the query failed while fetching for the first time. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) + +Will be `true` if the data shown is the placeholder data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) + +Will be `true` if the query failed while refetching. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md new file mode 100644 index 00000000000..3e0d3a79fa1 --- /dev/null +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverLoadingErrorResult +title: InfiniteQueryObserverLoadingErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult.md new file mode 100644 index 00000000000..f6400f44b52 --- /dev/null +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverLoadingResult +title: InfiniteQueryObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: true; +``` + +Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverOptions.md new file mode 100644 index 00000000000..db1ca7f18fe --- /dev/null +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverOptions.md @@ -0,0 +1,605 @@ +--- +id: InfiniteQueryObserverOptions +title: InfiniteQueryObserverOptions +--- + +Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) + +## Extends + +- [`QueryObserverOptions`](QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`, `TPageParam`\>.[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md)\<`TQueryFnData`, `TPageParam`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### enabled? + +```ts +optional enabled: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`enabled`](QueryObserverOptions.md#enabled) + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`gcTime`](QueryObserverOptions.md#gctime) + +*** + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`getNextPageParam`](InfiniteQueryPageParamsOptions.md#getnextpageparam) + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`getPreviousPageParam`](InfiniteQueryPageParamsOptions.md#getpreviouspageparam) + +*** + +### initialData? + +```ts +optional initialData: + | InfiniteData +| InitialDataFunction>; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialData`](QueryObserverOptions.md#initialdata) + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialDataUpdatedAt`](QueryObserverOptions.md#initialdataupdatedat) + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`initialPageParam`](InfiniteQueryPageParamsOptions.md#initialpageparam) + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`maxPages`](QueryObserverOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`meta`](QueryObserverOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`networkMode`](QueryObserverOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`persister`](QueryObserverOptions.md#persister) + +*** + +### placeholderData? + +```ts +optional placeholderData: + | InfiniteData +| PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`placeholderData`](QueryObserverOptions.md#placeholderdata) + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryFn`](QueryObserverOptions.md#queryfn) + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryHash`](QueryObserverOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKey`](QueryObserverOptions.md#querykey) + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKeyHashFn`](QueryObserverOptions.md#querykeyhashfn) + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchInterval`](QueryObserverOptions.md#refetchinterval) + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnMount`](QueryObserverOptions.md#refetchonmount) + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnReconnect`](QueryObserverOptions.md#refetchonreconnect) + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnWindowFocus`](QueryObserverOptions.md#refetchonwindowfocus) + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retry`](QueryObserverOptions.md#retry) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryOnMount`](QueryObserverOptions.md#retryonmount) + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +[`InfiniteData`](InfiniteData.md) + +#### Returns + +`TData` + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`select`](QueryObserverOptions.md#select) + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`staleTime`](QueryObserverOptions.md#staletime) + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`structuralSharing`](QueryObserverOptions.md#structuralsharing) + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`suspense`](QueryObserverOptions.md#suspense) + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`throwOnError`](QueryObserverOptions.md#throwonerror) diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverPendingResult.md new file mode 100644 index 00000000000..53d910f545d --- /dev/null +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverPendingResult +title: InfiniteQueryObserverPendingResult +--- + +Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1009) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1013](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1013) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1017](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1017) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1016](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1016) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1021](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1021) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1023](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1023) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md new file mode 100644 index 00000000000..5949179bc6f --- /dev/null +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverPlaceholderResult +title: InfiniteQueryObserverPlaceholderResult +--- + +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: true; +``` + +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md new file mode 100644 index 00000000000..e299e60ddc3 --- /dev/null +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverRefetchErrorResult +title: InfiniteQueryObserverRefetchErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) + +Will be `true` if the query failed while fetching the next page. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) + +Will be `true` if the query failed while fetching the previous page. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult.md new file mode 100644 index 00000000000..7b550e0a90b --- /dev/null +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverSuccessResult +title: InfiniteQueryObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/react/reference/interfaces/InfiniteQueryPageParamsOptions.md new file mode 100644 index 00000000000..bfab8bfc319 --- /dev/null +++ b/docs/framework/react/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -0,0 +1,64 @@ +--- +id: InfiniteQueryPageParamsOptions +title: InfiniteQueryPageParamsOptions +--- + +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) + +## Extends + +- [`InitialPageParam`](InitialPageParam.md)\<`TPageParam`\> + +## Extended by + +- [`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +[`InitialPageParam`](InitialPageParam.md).[`initialPageParam`](InitialPageParam.md#initialpageparam) diff --git a/docs/framework/react/reference/interfaces/InitialPageParam.md b/docs/framework/react/reference/interfaces/InitialPageParam.md new file mode 100644 index 00000000000..ffbf32ae0d6 --- /dev/null +++ b/docs/framework/react/reference/interfaces/InitialPageParam.md @@ -0,0 +1,26 @@ +--- +id: InitialPageParam +title: InitialPageParam +--- + +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) + +## Extended by + +- [`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md) + +## Type Parameters + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) diff --git a/docs/framework/react/reference/interfaces/InvalidateOptions.md b/docs/framework/react/reference/interfaces/InvalidateOptions.md new file mode 100644 index 00000000000..494afe1c465 --- /dev/null +++ b/docs/framework/react/reference/interfaces/InvalidateOptions.md @@ -0,0 +1,44 @@ +--- +id: InvalidateOptions +title: InvalidateOptions +--- + +Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L700) + +## Extends + +- [`RefetchOptions`](RefetchOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`cancelRefetch`](RefetchOptions.md#cancelrefetch) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`throwOnError`](RefetchOptions.md#throwonerror) diff --git a/docs/framework/react/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/react/reference/interfaces/InvalidateQueryFilters.md new file mode 100644 index 00000000000..4824d80d910 --- /dev/null +++ b/docs/framework/react/reference/interfaces/InvalidateQueryFilters.md @@ -0,0 +1,135 @@ +--- +id: InvalidateQueryFilters +title: InvalidateQueryFilters +--- + +Defined in: [packages/query-core/src/types.ts:690](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L690) + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extends + +- [`QueryFilters`](QueryFilters.md)\<`TQueryKey`\> + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`exact`](QueryFilters.md#exact) + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`fetchStatus`](QueryFilters.md#fetchstatus) + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`predicate`](QueryFilters.md#predicate) + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`queryKey`](QueryFilters.md#querykey) + +*** + +### refetchType? + +```ts +optional refetchType: QueryTypeFilter | "none"; +``` + +Defined in: [packages/query-core/src/types.ts:693](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L693) + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`stale`](QueryFilters.md#stale) + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/react/reference/interfaces/MutateOptions.md b/docs/framework/react/reference/interfaces/MutateOptions.md new file mode 100644 index 00000000000..a0af091a997 --- /dev/null +++ b/docs/framework/react/reference/interfaces/MutateOptions.md @@ -0,0 +1,124 @@ +--- +id: MutateOptions +title: MutateOptions +--- + +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1228) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1234) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1222](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1222) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` diff --git a/docs/framework/react/reference/interfaces/MutationCacheConfig.md b/docs/framework/react/reference/interfaces/MutationCacheConfig.md new file mode 100644 index 00000000000..c38d2dc26f4 --- /dev/null +++ b/docs/framework/react/reference/interfaces/MutationCacheConfig.md @@ -0,0 +1,161 @@ +--- +id: MutationCacheConfig +title: MutationCacheConfig +--- + +Defined in: [packages/query-core/src/mutationCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L26) + +Global callbacks that fire for every mutation handled by a `MutationCache`, regardless of which +component or observer triggered it. They differ from the `defaultOptions` provided to a +`QueryClient` in two ways: `defaultOptions` can be overridden by each mutation, while these +callbacks are always called, and `onMutate` here does not allow returning a result. + +If a callback returns a promise, it will be awaited before the mutation continues. + +## Properties + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L28) + +Called when any mutation in the cache encounters an error. + +#### Parameters + +##### error + +`Error` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L44) + +Called before any mutation in the cache executes. + +#### Parameters + +##### variables + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:50](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L50) + +Called when any mutation in the cache is settled, either successfully or with an error. + +#### Parameters + +##### data + +`unknown` + +##### error + +`Error` | `null` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:36](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L36) + +Called when any mutation in the cache is successful. + +#### Parameters + +##### data + +`unknown` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` diff --git a/docs/framework/react/reference/interfaces/MutationFilters.md b/docs/framework/react/reference/interfaces/MutationFilters.md new file mode 100644 index 00000000000..378a411bfe5 --- /dev/null +++ b/docs/framework/react/reference/interfaces/MutationFilters.md @@ -0,0 +1,85 @@ +--- +id: MutationFilters +title: MutationFilters +--- + +Defined in: [packages/query-core/src/utils.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L62) + +Filters used to select mutations, for example in `mutationCache.findAll` or `queryClient.isMutating`. +All provided filters must match; filters that are left unspecified are ignored. + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L71) + +Match mutation key exactly + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/utils.ts:81](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L81) + +Include mutations matching this mutation key + +*** + +### predicate()? + +```ts +optional predicate: (mutation) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L75) + +Include mutations matching this predicate function + +#### Parameters + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`boolean` + +*** + +### status? + +```ts +optional status: MutationStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L85) + +Filter by mutation status diff --git a/docs/framework/react/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/react/reference/interfaces/MutationObserverBaseResult.md new file mode 100644 index 00000000000..98810323966 --- /dev/null +++ b/docs/framework/react/reference/interfaces/MutationObserverBaseResult.md @@ -0,0 +1,291 @@ +--- +id: MutationObserverBaseResult +title: MutationObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationState`](MutationState.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Extended by + +- [`MutationObserverIdleResult`](MutationObserverIdleResult.md) +- [`MutationObserverLoadingResult`](MutationObserverLoadingResult.md) +- [`MutationObserverErrorResult`](MutationObserverErrorResult.md) +- [`MutationObserverSuccessResult`](MutationObserverSuccessResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationState`](MutationState.md).[`context`](MutationState.md#context) + +*** + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationState`](MutationState.md).[`data`](MutationState.md#data) + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:1285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1285) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationState`](MutationState.md).[`error`](MutationState.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationState`](MutationState.md).[`failureCount`](MutationState.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationState`](MutationState.md).[`failureReason`](MutationState.md#failurereason) + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +*** + +### isIdle + +```ts +isIdle: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1295) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationState`](MutationState.md).[`isPaused`](MutationState.md#ispaused) + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1300](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1300) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1305](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1305) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +*** + +### status + +```ts +status: MutationStatus; +``` + +Defined in: [packages/query-core/src/types.ts:1314](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1314) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationState`](MutationState.md).[`status`](MutationState.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationState`](MutationState.md).[`submittedAt`](MutationState.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationState`](MutationState.md).[`variables`](MutationState.md#variables) diff --git a/docs/framework/react/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/react/reference/interfaces/MutationObserverErrorResult.md new file mode 100644 index 00000000000..d61f244ced4 --- /dev/null +++ b/docs/framework/react/reference/interfaces/MutationObserverErrorResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverErrorResult +title: MutationObserverErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1374](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1374) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1385](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1385) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1386](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1386) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1388](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1388) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1389](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1389) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1390) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/react/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/react/reference/interfaces/MutationObserverIdleResult.md new file mode 100644 index 00000000000..93655da0aa5 --- /dev/null +++ b/docs/framework/react/reference/interfaces/MutationObserverIdleResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverIdleResult +title: MutationObserverIdleResult +--- + +Defined in: [packages/query-core/src/types.ts:1332](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1332) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1346](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1346) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: true; +``` + +Defined in: [packages/query-core/src/types.ts:1347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1347) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1349) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "idle"; +``` + +Defined in: [packages/query-core/src/types.ts:1350](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1350) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md new file mode 100644 index 00000000000..de146c45f5c --- /dev/null +++ b/docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverLoadingResult +title: MutationObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1364](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1364) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1367](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1367) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1369](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1369) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1370](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1370) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1371](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1371) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1365) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/react/reference/interfaces/MutationObserverOptions.md b/docs/framework/react/reference/interfaces/MutationObserverOptions.md new file mode 100644 index 00000000000..fe59cc7444d --- /dev/null +++ b/docs/framework/react/reference/interfaces/MutationObserverOptions.md @@ -0,0 +1,290 @@ +--- +id: MutationObserverOptions +title: MutationObserverOptions +--- + +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) + +## Extends + +- [`MutationOptions`](MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`gcTime`](MutationOptions.md#gctime) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`meta`](MutationOptions.md#meta) + +*** + +### mutationFn? + +```ts +optional mutationFn: MutationFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`mutationFn`](MutationOptions.md#mutationfn) + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`mutationKey`](MutationOptions.md#mutationkey) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`networkMode`](MutationOptions.md#networkmode) + +*** + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onError`](MutationOptions.md#onerror) + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, context) => TOnMutateResult | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) + +#### Parameters + +##### variables + +`TVariables` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`TOnMutateResult` \| `Promise`\<`TOnMutateResult`\> + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onMutate`](MutationOptions.md#onmutate) + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onSettled`](MutationOptions.md#onsettled) + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onSuccess`](MutationOptions.md#onsuccess) + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`retry`](MutationOptions.md#retry) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`retryDelay`](MutationOptions.md#retrydelay) + +*** + +### scope? + +```ts +optional scope: MutationScope; +``` + +Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`scope`](MutationOptions.md#scope) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean | (error) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) diff --git a/docs/framework/react/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/react/reference/interfaces/MutationObserverSuccessResult.md new file mode 100644 index 00000000000..b50ec4ab6f1 --- /dev/null +++ b/docs/framework/react/reference/interfaces/MutationObserverSuccessResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverSuccessResult +title: MutationObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1406](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1406) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1407) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1409) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1410](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1410) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/react/reference/interfaces/MutationOptions.md b/docs/framework/react/reference/interfaces/MutationOptions.md new file mode 100644 index 00000000000..f641d241142 --- /dev/null +++ b/docs/framework/react/reference/interfaces/MutationOptions.md @@ -0,0 +1,232 @@ +--- +id: MutationOptions +title: MutationOptions +--- + +Defined in: [packages/query-core/src/types.ts:1166](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1166) + +## Extended by + +- [`MutationObserverOptions`](MutationObserverOptions.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) + +*** + +### mutationFn? + +```ts +optional mutationFn: MutationFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) + +*** + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, context) => TOnMutateResult | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) + +#### Parameters + +##### variables + +`TVariables` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`TOnMutateResult` \| `Promise`\<`TOnMutateResult`\> + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) + +*** + +### scope? + +```ts +optional scope: MutationScope; +``` + +Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) diff --git a/docs/framework/react/reference/interfaces/MutationState.md b/docs/framework/react/reference/interfaces/MutationState.md new file mode 100644 index 00000000000..bec050ec1d3 --- /dev/null +++ b/docs/framework/react/reference/interfaces/MutationState.md @@ -0,0 +1,142 @@ +--- +id: MutationState +title: MutationState +--- + +Defined in: [packages/query-core/src/mutation.ts:30](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L30) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extended by + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +*** + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L44) + +The last successfully resolved data for the mutation. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L49) + +The error object for the mutation, if the last attempt resulted in an error. +- Defaults to `null`. + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +*** + +### status + +```ts +status: MutationStatus; +``` + +Defined in: [packages/query-core/src/mutation.ts:66](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L66) + +The status of the mutation. + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +*** + +### variables + +```ts +variables: TVariables | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L70) + +The variables the mutation was last called with. diff --git a/docs/framework/react/reference/interfaces/NotifyEvent.md b/docs/framework/react/reference/interfaces/NotifyEvent.md new file mode 100644 index 00000000000..1dc93464df1 --- /dev/null +++ b/docs/framework/react/reference/interfaces/NotifyEvent.md @@ -0,0 +1,16 @@ +--- +id: NotifyEvent +title: NotifyEvent +--- + +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) + +## Properties + +### type + +```ts +type: NotifyEventType; +``` + +Defined in: [packages/query-core/src/types.ts:1462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1462) diff --git a/docs/framework/react/reference/interfaces/QueriesObserverOptions.md b/docs/framework/react/reference/interfaces/QueriesObserverOptions.md new file mode 100644 index 00000000000..16035c45714 --- /dev/null +++ b/docs/framework/react/reference/interfaces/QueriesObserverOptions.md @@ -0,0 +1,27 @@ +--- +id: QueriesObserverOptions +title: QueriesObserverOptions +--- + +Defined in: [packages/query-core/src/queriesObserver.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L23) + +## Type Parameters + +### TCombinedResult + +`TCombinedResult` = [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +## Properties + +### combine? + +```ts +optional combine: CombineFn; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L32) + +A function that combines the array of `QueryObserverResult`s (one per +observed query) into a single value. The combined value is memoized and +only recomputed when one of the underlying results, the query hashes, or +the `combine` function itself changes. diff --git a/docs/framework/react/reference/interfaces/QueryCacheConfig.md b/docs/framework/react/reference/interfaces/QueryCacheConfig.md new file mode 100644 index 00000000000..69ea600366c --- /dev/null +++ b/docs/framework/react/reference/interfaces/QueryCacheConfig.md @@ -0,0 +1,92 @@ +--- +id: QueryCacheConfig +title: QueryCacheConfig +--- + +Defined in: [packages/query-core/src/queryCache.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L24) + +Global callbacks that fire for every query handled by a `QueryCache`, regardless of which +component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can +override, these callbacks are always called. + +## Properties + +### onError()? + +```ts +optional onError: (error, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L26) + +Called when any query in the cache encounters an error. + +#### Parameters + +##### error + +`Error` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L33) + +Called when any query in the cache is settled, either successfully or with an error. + +#### Parameters + +##### data + +`unknown` + +##### error + +`Error` | `null` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L31) + +Called when any query in the cache is successful. + +#### Parameters + +##### data + +`unknown` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` diff --git a/docs/framework/react/reference/interfaces/QueryClientConfig.md b/docs/framework/react/reference/interfaces/QueryClientConfig.md new file mode 100644 index 00000000000..7c9bc255b35 --- /dev/null +++ b/docs/framework/react/reference/interfaces/QueryClientConfig.md @@ -0,0 +1,36 @@ +--- +id: QueryClientConfig +title: QueryClientConfig +--- + +Defined in: [packages/query-core/src/types.ts:1427](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1427) + +## Properties + +### defaultOptions? + +```ts +optional defaultOptions: DefaultOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1430](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1430) + +*** + +### mutationCache? + +```ts +optional mutationCache: MutationCache; +``` + +Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) + +*** + +### queryCache? + +```ts +optional queryCache: QueryCache; +``` + +Defined in: [packages/query-core/src/types.ts:1428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1428) diff --git a/docs/framework/react/reference/interfaces/QueryErrorResetBoundaryProps.md b/docs/framework/react/reference/interfaces/QueryErrorResetBoundaryProps.md index 883b9c00a9f..7ef84ce8907 100644 --- a/docs/framework/react/reference/interfaces/QueryErrorResetBoundaryProps.md +++ b/docs/framework/react/reference/interfaces/QueryErrorResetBoundaryProps.md @@ -3,7 +3,7 @@ id: QueryErrorResetBoundaryProps title: QueryErrorResetBoundaryProps --- -Defined in: [react-query/src/QueryErrorResetBoundary.tsx:94](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L94) +Defined in: [packages/react-query/src/QueryErrorResetBoundary.tsx:94](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L94) The props accepted by `QueryErrorResetBoundary`. @@ -17,7 +17,7 @@ children: | QueryErrorResetBoundaryFunction; ``` -Defined in: [react-query/src/QueryErrorResetBoundary.tsx:99](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L99) +Defined in: [packages/react-query/src/QueryErrorResetBoundary.tsx:99](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L99) Either a plain node, or a function that receives the boundary's QueryErrorResetBoundaryValue and returns a node. diff --git a/docs/framework/react/reference/interfaces/QueryExecuteOptions.md b/docs/framework/react/reference/interfaces/QueryExecuteOptions.md new file mode 100644 index 00000000000..5a055675308 --- /dev/null +++ b/docs/framework/react/reference/interfaces/QueryExecuteOptions.md @@ -0,0 +1,375 @@ +--- +id: QueryExecuteOptions +title: QueryExecuteOptions +--- + +Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L555) + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](QueryOptions.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### initialPageParam? + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L567) + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:572](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L572) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` diff --git a/docs/framework/react/reference/interfaces/QueryFilters.md b/docs/framework/react/reference/interfaces/QueryFilters.md new file mode 100644 index 00000000000..6b177d93aa5 --- /dev/null +++ b/docs/framework/react/reference/interfaces/QueryFilters.md @@ -0,0 +1,102 @@ +--- +id: QueryFilters +title: QueryFilters +--- + +Defined in: [packages/query-core/src/utils.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L31) + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extended by + +- [`InvalidateQueryFilters`](InvalidateQueryFilters.md) +- [`RefetchQueryFilters`](RefetchQueryFilters.md) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries diff --git a/docs/framework/react/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/react/reference/interfaces/QueryObserverBaseResult.md new file mode 100644 index 00000000000..2840be27e27 --- /dev/null +++ b/docs/framework/react/reference/interfaces/QueryObserverBaseResult.md @@ -0,0 +1,358 @@ +--- +id: QueryObserverBaseResult +title: QueryObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) + +## Extended by + +- [`QueryObserverPendingResult`](QueryObserverPendingResult.md) +- [`QueryObserverLoadingResult`](QueryObserverLoadingResult.md) +- [`QueryObserverLoadingErrorResult`](QueryObserverLoadingErrorResult.md) +- [`QueryObserverRefetchErrorResult`](QueryObserverRefetchErrorResult.md) +- [`QueryObserverSuccessResult`](QueryObserverSuccessResult.md) +- [`QueryObserverPlaceholderResult`](QueryObserverPlaceholderResult.md) +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) + +The last successfully resolved data for the query. + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +*** + +### isLoadingError + +```ts +isLoadingError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) + +Will be `true` if the query failed while fetching for the first time. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) + +Will be `true` if the data shown is the placeholder data. + +*** + +### isRefetchError + +```ts +isRefetchError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) + +Will be `true` if the query failed while refetching. + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. diff --git a/docs/framework/react/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/react/reference/interfaces/QueryObserverLoadingErrorResult.md new file mode 100644 index 00000000000..97d5d5125a7 --- /dev/null +++ b/docs/framework/react/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverLoadingErrorResult +title: QueryObserverLoadingErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: true; +``` + +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/react/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/react/reference/interfaces/QueryObserverLoadingResult.md new file mode 100644 index 00000000000..1f442f18130 --- /dev/null +++ b/docs/framework/react/reference/interfaces/QueryObserverLoadingResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverLoadingResult +title: QueryObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L873) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: true; +``` + +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:885](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L885) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:884](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L884) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/react/reference/interfaces/QueryObserverOptions.md b/docs/framework/react/reference/interfaces/QueryObserverOptions.md new file mode 100644 index 00000000000..6d3cf82607b --- /dev/null +++ b/docs/framework/react/reference/interfaces/QueryObserverOptions.md @@ -0,0 +1,542 @@ +--- +id: QueryObserverOptions +title: QueryObserverOptions +--- + +Defined in: [packages/query-core/src/types.ts:373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L373) + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](QueryOptions.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Extended by + +- [`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md) +- [`UseBaseQueryOptions`](UseBaseQueryOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### enabled? + +```ts +optional enabled: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### placeholderData? + +```ts +optional placeholderData: + | NonFunctionGuard +| PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. diff --git a/docs/framework/react/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/react/reference/interfaces/QueryObserverPendingResult.md new file mode 100644 index 00000000000..ad040ff9cc5 --- /dev/null +++ b/docs/framework/react/reference/interfaces/QueryObserverPendingResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverPendingResult +title: QueryObserverPendingResult +--- + +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:862](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L862) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:864](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L864) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:866](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L866) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:865](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L865) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:869](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L869) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:870](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L870) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/react/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/react/reference/interfaces/QueryObserverPlaceholderResult.md new file mode 100644 index 00000000000..8a1ae61dee9 --- /dev/null +++ b/docs/framework/react/reference/interfaces/QueryObserverPlaceholderResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverPlaceholderResult +title: QueryObserverPlaceholderResult +--- + +Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: true; +``` + +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/react/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/react/reference/interfaces/QueryObserverRefetchErrorResult.md new file mode 100644 index 00000000000..c8d5274697a --- /dev/null +++ b/docs/framework/react/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverRefetchErrorResult +title: QueryObserverRefetchErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: true; +``` + +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/react/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/react/reference/interfaces/QueryObserverSuccessResult.md new file mode 100644 index 00000000000..e3c834e6c3a --- /dev/null +++ b/docs/framework/react/reference/interfaces/QueryObserverSuccessResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverSuccessResult +title: QueryObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/react/reference/interfaces/QueryOptions.md b/docs/framework/react/reference/interfaces/QueryOptions.md new file mode 100644 index 00000000000..ba603a4332f --- /dev/null +++ b/docs/framework/react/reference/interfaces/QueryOptions.md @@ -0,0 +1,240 @@ +--- +id: QueryOptions +title: QueryOptions +--- + +Defined in: [packages/query-core/src/types.ts:231](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L231) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +*** + +### initialData? + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +*** + +### queryFn? + +```ts +optional queryFn: + | QueryFunction + | typeof skipToken; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. diff --git a/docs/framework/react/reference/interfaces/QueryState.md b/docs/framework/react/reference/interfaces/QueryState.md new file mode 100644 index 00000000000..7dce476d743 --- /dev/null +++ b/docs/framework/react/reference/interfaces/QueryState.md @@ -0,0 +1,175 @@ +--- +id: QueryState +title: QueryState +--- + +Defined in: [packages/query-core/src/query.ts:52](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L52) + +The raw state stored on a `Query` instance. This is the underlying state +that observer results (e.g. `QueryObserverResult`) are derived from. + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:56](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L56) + +The last successfully resolved data for the query. + +*** + +### dataUpdateCount + +```ts +dataUpdateCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L60) + +The number of times the query has successfully resolved. + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/query.ts:64](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L64) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/query.ts:69](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L69) + +The error object for the query, if the last attempt resulted in an error. +- Defaults to `null`. + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:73](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L73) + +The sum of all errors, incremented every time the query resolves with an error. + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/query.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L77) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +*** + +### fetchFailureCount + +```ts +fetchFailureCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L83) + +The failure count for the current fetch. +- Incremented every time the fetch fails. +- Reset to `0` when the fetch succeeds. + +*** + +### fetchFailureReason + +```ts +fetchFailureReason: TError | null; +``` + +Defined in: [packages/query-core/src/query.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L88) + +The reason the current fetch failed, as reported by the retryer. +- Reset to `null` when the fetch succeeds. + +*** + +### fetchMeta + +```ts +fetchMeta: FetchMeta | null; +``` + +Defined in: [packages/query-core/src/query.ts:93](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L93) + +Metadata passed to the currently in-flight (or most recent) fetch, e.g. the +`fetchMore` direction for infinite queries. + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/query.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L112) + +The fetch status of the query. +- `fetching`: the `queryFn` is currently executing. +- `paused`: a fetch wanted to run but has been paused (see network mode). +- `idle`: the query is not fetching. + +*** + +### isInvalidated + +```ts +isInvalidated: boolean; +``` + +Defined in: [packages/query-core/src/query.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L98) + +Whether the query has been marked as invalidated via `invalidate()`. +- Reset to `false` whenever the query resolves successfully. + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/query.ts:105](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L105) + +The status of the query. +- `pending` if there's no cached data and no attempt was finished yet. +- `error` if the last attempt resulted in an error. +- `success` if the query has data. diff --git a/docs/framework/react/reference/interfaces/RefetchOptions.md b/docs/framework/react/reference/interfaces/RefetchOptions.md new file mode 100644 index 00000000000..a3db94b1674 --- /dev/null +++ b/docs/framework/react/reference/interfaces/RefetchOptions.md @@ -0,0 +1,45 @@ +--- +id: RefetchOptions +title: RefetchOptions +--- + +Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L679) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Extended by + +- [`InvalidateOptions`](InvalidateOptions.md) +- [`ResetOptions`](ResetOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/react/reference/interfaces/RefetchQueryFilters.md b/docs/framework/react/reference/interfaces/RefetchQueryFilters.md new file mode 100644 index 00000000000..f2b6b287875 --- /dev/null +++ b/docs/framework/react/reference/interfaces/RefetchQueryFilters.md @@ -0,0 +1,125 @@ +--- +id: RefetchQueryFilters +title: RefetchQueryFilters +--- + +Defined in: [packages/query-core/src/types.ts:696](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L696) + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extends + +- [`QueryFilters`](QueryFilters.md)\<`TQueryKey`\> + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`exact`](QueryFilters.md#exact) + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`fetchStatus`](QueryFilters.md#fetchstatus) + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`predicate`](QueryFilters.md#predicate) + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`queryKey`](QueryFilters.md#querykey) + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`stale`](QueryFilters.md#stale) + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/react/reference/interfaces/Register.md b/docs/framework/react/reference/interfaces/Register.md new file mode 100644 index 00000000000..4f442442b48 --- /dev/null +++ b/docs/framework/react/reference/interfaces/Register.md @@ -0,0 +1,6 @@ +--- +id: Register +title: Register +--- + +Defined in: [packages/query-core/src/types.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L37) diff --git a/docs/framework/react/reference/interfaces/ResetOptions.md b/docs/framework/react/reference/interfaces/ResetOptions.md new file mode 100644 index 00000000000..bfa931717f8 --- /dev/null +++ b/docs/framework/react/reference/interfaces/ResetOptions.md @@ -0,0 +1,44 @@ +--- +id: ResetOptions +title: ResetOptions +--- + +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) + +## Extends + +- [`RefetchOptions`](RefetchOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`cancelRefetch`](RefetchOptions.md#cancelrefetch) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`throwOnError`](RefetchOptions.md#throwonerror) diff --git a/docs/framework/react/reference/interfaces/ResultOptions.md b/docs/framework/react/reference/interfaces/ResultOptions.md new file mode 100644 index 00000000000..dbf00d6c67e --- /dev/null +++ b/docs/framework/react/reference/interfaces/ResultOptions.md @@ -0,0 +1,22 @@ +--- +id: ResultOptions +title: ResultOptions +--- + +Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) + +## Extended by + +- [`RefetchOptions`](RefetchOptions.md) +- [`FetchNextPageOptions`](FetchNextPageOptions.md) +- [`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +## Properties + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) diff --git a/docs/framework/react/reference/interfaces/SetDataOptions.md b/docs/framework/react/reference/interfaces/SetDataOptions.md new file mode 100644 index 00000000000..5fcbcfdf7cd --- /dev/null +++ b/docs/framework/react/reference/interfaces/SetDataOptions.md @@ -0,0 +1,16 @@ +--- +id: SetDataOptions +title: SetDataOptions +--- + +Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1448) + +## Properties + +### updatedAt? + +```ts +optional updatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) diff --git a/docs/framework/react/reference/interfaces/UseBaseQueryOptions.md b/docs/framework/react/reference/interfaces/UseBaseQueryOptions.md index 16f50718bec..f9e18e09b4d 100644 --- a/docs/framework/react/reference/interfaces/UseBaseQueryOptions.md +++ b/docs/framework/react/reference/interfaces/UseBaseQueryOptions.md @@ -3,14 +3,14 @@ id: UseBaseQueryOptions title: UseBaseQueryOptions --- -Defined in: [react-query/src/types.ts:47](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L47) +Defined in: [packages/react-query/src/types.ts:47](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L47) -The options shared by `useQuery` and `useSuspenseQuery`. Extends QueryObserverOptions from +The options shared by `useQuery` and `useSuspenseQuery`. Extends [QueryObserverOptions](QueryObserverOptions.md) from `@tanstack/query-core` with the `react-query`-specific `subscribed` option. ## Extends -- `QueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> +- [`QueryObserverOptions`](QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> ## Type Parameters @@ -22,7 +22,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. @@ -42,19 +42,550 @@ The type of the data actually held in the query cache — the input to `select` ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. ## Properties +### enabled? + +```ts +optional enabled: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`enabled`](QueryObserverOptions.md#enabled) + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`gcTime`](QueryObserverOptions.md#gctime) + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialData`](QueryObserverOptions.md#initialdata) + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialDataUpdatedAt`](QueryObserverOptions.md#initialdataupdatedat) + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`maxPages`](QueryObserverOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`meta`](QueryObserverOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`networkMode`](QueryObserverOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister()? + +```ts +optional persister: (queryFn, context, query) => TQueryFnData | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Parameters + +##### queryFn + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TQueryFnData`, `NoInfer`\<`TQueryKey`\>, `never`\> + +##### context + +###### client + +[`QueryClient`](../classes/QueryClient.md) + +###### direction? + +`unknown` + +**Deprecated** + +if you want access to the direction, you can add it to the pageParam + +###### meta + +`Record`\<`string`, `unknown`\> \| `undefined` + +###### pageParam? + +`unknown` + +###### queryKey + +`NoInfer`\<`TQueryKey`\> + +###### signal + +`AbortSignal` + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`TQueryFnData` \| `Promise`\<`TQueryFnData`\> + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`persister`](QueryObserverOptions.md#persister) + +*** + +### placeholderData? + +```ts +optional placeholderData: + | NonFunctionGuard +| PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`placeholderData`](QueryObserverOptions.md#placeholderdata) + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryFn`](QueryObserverOptions.md#queryfn) + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryHash`](QueryObserverOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKey`](QueryObserverOptions.md#querykey) + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKeyHashFn`](QueryObserverOptions.md#querykeyhashfn) + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchInterval`](QueryObserverOptions.md#refetchinterval) + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnMount`](QueryObserverOptions.md#refetchonmount) + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnReconnect`](QueryObserverOptions.md#refetchonreconnect) + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnWindowFocus`](QueryObserverOptions.md#refetchonwindowfocus) + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retry`](QueryObserverOptions.md#retry) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryOnMount`](QueryObserverOptions.md#retryonmount) + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`select`](QueryObserverOptions.md#select) + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`staleTime`](QueryObserverOptions.md#staletime) + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`structuralSharing`](QueryObserverOptions.md#structuralsharing) + +*** + ### subscribed? ```ts optional subscribed: boolean; ``` -Defined in: [react-query/src/types.ts:65](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L65) +Defined in: [packages/react-query/src/types.ts:65](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L65) Set this to `false` to unsubscribe this observer from updates to the query cache. @@ -63,3 +594,41 @@ Set this to `false` to unsubscribe this observer from updates to the query cache ```ts true ``` + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`suspense`](QueryObserverOptions.md#suspense) + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`throwOnError`](QueryObserverOptions.md#throwonerror) diff --git a/docs/framework/react/reference/interfaces/UseInfiniteQueryOptions.md b/docs/framework/react/reference/interfaces/UseInfiniteQueryOptions.md index 3ce35ff761b..2ced6a93c53 100644 --- a/docs/framework/react/reference/interfaces/UseInfiniteQueryOptions.md +++ b/docs/framework/react/reference/interfaces/UseInfiniteQueryOptions.md @@ -3,15 +3,15 @@ id: UseInfiniteQueryOptions title: UseInfiniteQueryOptions --- -Defined in: [react-query/src/types.ts:238](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L238) +Defined in: [packages/react-query/src/types.ts:238](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L238) -The options accepted by `useInfiniteQuery`. Extends InfiniteQueryObserverOptions from +The options accepted by `useInfiniteQuery`. Extends [InfiniteQueryObserverOptions](InfiniteQueryObserverOptions.md) from `@tanstack/query-core` with the `react-query`-specific `subscribed` option, minus `suspense` (which `react-query` derives from which hook you call rather than exposing as an option). ## Extends -- `OmitKeyof`\<`InfiniteQueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"suspense"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"suspense"`\> ## Type Parameters @@ -23,20 +23,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. @@ -48,13 +48,590 @@ The type of the parameter passed to `queryFn` to fetch a given page. ## Properties +### enabled? + +```ts +optional enabled: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.enabled +``` + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`gcTime`](QueryOptions.md#gctime) + +*** + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +#### Inherited from + +```ts +OmitKeyof.getNextPageParam +``` + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +#### Inherited from + +```ts +OmitKeyof.getPreviousPageParam +``` + +*** + +### initialData? + +```ts +optional initialData: + | InfiniteData +| InitialDataFunction>; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +OmitKeyof.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +OmitKeyof.initialDataUpdatedAt +``` + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +```ts +OmitKeyof.initialPageParam +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`maxPages`](QueryOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`meta`](QueryOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`networkMode`](QueryOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +OmitKeyof.persister +``` + +*** + +### placeholderData? + +```ts +optional placeholderData: + | InfiniteData +| PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +```ts +OmitKeyof.placeholderData +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +OmitKeyof.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`queryHash`](QueryOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +OmitKeyof.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +OmitKeyof.queryKeyHashFn +``` + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchInterval +``` + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnMount +``` + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnReconnect +``` + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnWindowFocus +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.retryOnMount +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +[`InfiniteData`](InfiniteData.md) + +#### Returns + +`TData` + +#### Inherited from + +```ts +OmitKeyof.select +``` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +```ts +OmitKeyof.staleTime +``` + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.structuralSharing +``` + +*** + ### subscribed? ```ts optional subscribed: boolean; ``` -Defined in: [react-query/src/types.ts:259](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L259) +Defined in: [packages/react-query/src/types.ts:259](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L259) Set this to `false` to unsubscribe this observer from updates to the query cache. @@ -63,3 +640,25 @@ Set this to `false` to unsubscribe this observer from updates to the query cache ```ts true ``` + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.throwOnError +``` diff --git a/docs/framework/react/reference/interfaces/UseMutationOptions.md b/docs/framework/react/reference/interfaces/UseMutationOptions.md index 2ae7e55f6a1..e0e69f5bf86 100644 --- a/docs/framework/react/reference/interfaces/UseMutationOptions.md +++ b/docs/framework/react/reference/interfaces/UseMutationOptions.md @@ -3,14 +3,14 @@ id: UseMutationOptions title: UseMutationOptions --- -Defined in: [react-query/src/types.ts:412](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L412) +Defined in: [packages/react-query/src/types.ts:412](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L412) -The options accepted by `useMutation`. Same as MutationObserverOptions from `@tanstack/query-core`, +The options accepted by `useMutation`. Same as [MutationObserverOptions](MutationObserverOptions.md) from `@tanstack/query-core`, minus the internal `_defaulted` flag. ## Extends -- `OmitKeyof`\<`MutationObserverOptions`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"_defaulted"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"_defaulted"`\> ## Type Parameters @@ -22,7 +22,7 @@ The type your mutation function resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your mutation function may throw. @@ -38,3 +38,285 @@ The type of the variable passed to `mutate`/`mutateAsync`. The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as their `onMutateResult` parameter — useful for optimistic-update rollback data. + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`gcTime`](MutationOptions.md#gctime) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`meta`](MutationOptions.md#meta) + +*** + +### mutationFn? + +```ts +optional mutationFn: MutationFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) + +#### Inherited from + +```ts +OmitKeyof.mutationFn +``` + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`mutationKey`](MutationOptions.md#mutationkey) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`networkMode`](MutationOptions.md#networkmode) + +*** + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +OmitKeyof.onError +``` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, context) => TOnMutateResult | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) + +#### Parameters + +##### variables + +`TVariables` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`TOnMutateResult` \| `Promise`\<`TOnMutateResult`\> + +#### Inherited from + +```ts +OmitKeyof.onMutate +``` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +OmitKeyof.onSettled +``` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +OmitKeyof.onSuccess +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### scope? + +```ts +optional scope: MutationScope; +``` + +Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`scope`](MutationOptions.md#scope) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean | (error) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) + +#### Inherited from + +```ts +OmitKeyof.throwOnError +``` diff --git a/docs/framework/react/reference/interfaces/UseQueryOptions.md b/docs/framework/react/reference/interfaces/UseQueryOptions.md index 2099250b292..c110ade2f3d 100644 --- a/docs/framework/react/reference/interfaces/UseQueryOptions.md +++ b/docs/framework/react/reference/interfaces/UseQueryOptions.md @@ -3,14 +3,14 @@ id: UseQueryOptions title: UseQueryOptions --- -Defined in: [react-query/src/types.ts:165](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L165) +Defined in: [packages/react-query/src/types.ts:165](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L165) The options accepted by `useQuery`. Same as [UseBaseQueryOptions](UseBaseQueryOptions.md), minus `suspense` (which `react-query` derives from which hook you call rather than exposing as an option). ## Extends -- `OmitKeyof`\<[`UseBaseQueryOptions`](UseBaseQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryFnData`, `TQueryKey`\>, `"suspense"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`UseBaseQueryOptions`](UseBaseQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryFnData`, `TQueryKey`\>, `"suspense"`\> ## Type Parameters @@ -22,7 +22,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. @@ -35,19 +35,586 @@ The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` when ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. ## Properties +### enabled? + +```ts +optional enabled: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.enabled +``` + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`gcTime`](QueryOptions.md#gctime) + +*** + +### initialData? + +```ts +optional initialData: + | TQueryFnData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +OmitKeyof.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +OmitKeyof.initialDataUpdatedAt +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`maxPages`](QueryOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`meta`](QueryOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`networkMode`](QueryOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister()? + +```ts +optional persister: (queryFn, context, query) => TQueryFnData | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Parameters + +##### queryFn + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TQueryFnData`, `NoInfer`\<`TQueryKey`\>, `never`\> + +##### context + +###### client + +[`QueryClient`](../classes/QueryClient.md) + +###### direction? + +`unknown` + +**Deprecated** + +if you want access to the direction, you can add it to the pageParam + +###### meta + +`Record`\<`string`, `unknown`\> \| `undefined` + +###### pageParam? + +`unknown` + +###### queryKey + +`NoInfer`\<`TQueryKey`\> + +###### signal + +`AbortSignal` + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`TQueryFnData` \| `Promise`\<`TQueryFnData`\> + +#### Inherited from + +```ts +OmitKeyof.persister +``` + +*** + +### placeholderData? + +```ts +optional placeholderData: + | NonFunctionGuard +| PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +```ts +OmitKeyof.placeholderData +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +OmitKeyof.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`queryHash`](QueryOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +OmitKeyof.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +OmitKeyof.queryKeyHashFn +``` + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchInterval +``` + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnMount +``` + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnReconnect +``` + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnWindowFocus +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.retryOnMount +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryFnData` + +#### Returns + +`TData` + +#### Inherited from + +```ts +OmitKeyof.select +``` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +```ts +OmitKeyof.staleTime +``` + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.structuralSharing +``` + +*** + ### subscribed? ```ts optional subscribed: boolean; ``` -Defined in: [react-query/src/types.ts:65](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L65) +Defined in: [packages/react-query/src/types.ts:65](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L65) Set this to `false` to unsubscribe this observer from updates to the query cache. @@ -62,3 +629,25 @@ true ```ts OmitKeyof.subscribed ``` + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.throwOnError +``` diff --git a/docs/framework/react/reference/interfaces/UseSuspenseInfiniteQueryOptions.md b/docs/framework/react/reference/interfaces/UseSuspenseInfiniteQueryOptions.md index c3ea5865ffe..fc153462fe5 100644 --- a/docs/framework/react/reference/interfaces/UseSuspenseInfiniteQueryOptions.md +++ b/docs/framework/react/reference/interfaces/UseSuspenseInfiniteQueryOptions.md @@ -3,7 +3,7 @@ id: UseSuspenseInfiniteQueryOptions title: UseSuspenseInfiniteQueryOptions --- -Defined in: [react-query/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L280) +Defined in: [packages/react-query/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L280) The options accepted by `useSuspenseInfiniteQuery`. Same as [UseInfiniteQueryOptions](UseInfiniteQueryOptions.md), minus `enabled`, `throwOnError`, and `placeholderData` — Suspense hooks cannot render a "disabled" or "placeholder" state, so @@ -11,7 +11,7 @@ those options don't apply. ## Extends -- `OmitKeyof`\<[`UseInfiniteQueryOptions`](UseInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"queryFn"` \| `"enabled"` \| `"throwOnError"` \| `"placeholderData"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`UseInfiniteQueryOptions`](UseInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"queryFn"` \| `"enabled"` \| `"throwOnError"` \| `"placeholderData"`\> ## Type Parameters @@ -23,20 +23,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. @@ -48,26 +48,538 @@ The type of the parameter passed to `queryFn` to fetch a given page. ## Properties +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`gcTime`](QueryOptions.md#gctime) + +*** + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +#### Inherited from + +```ts +OmitKeyof.getNextPageParam +``` + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +#### Inherited from + +```ts +OmitKeyof.getPreviousPageParam +``` + +*** + +### initialData? + +```ts +optional initialData: + | InfiniteData +| InitialDataFunction>; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +OmitKeyof.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +OmitKeyof.initialDataUpdatedAt +``` + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +```ts +OmitKeyof.initialPageParam +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`maxPages`](QueryOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`meta`](QueryOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`networkMode`](QueryOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +OmitKeyof.persister +``` + +*** + ### queryFn? ```ts optional queryFn: QueryFunction; ``` -Defined in: [react-query/src/types.ts:294](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L294) +Defined in: [packages/react-query/src/types.ts:294](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L294) `skipToken` is not allowed here — Suspense hooks cannot render a "disabled" state, so a query function must always be provided, unless a default query function has been defined. *** +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`queryHash`](QueryOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +OmitKeyof.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +OmitKeyof.queryKeyHashFn +``` + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchInterval +``` + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnMount +``` + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnReconnect +``` + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnWindowFocus +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.retryOnMount +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +[`InfiniteData`](InfiniteData.md) + +#### Returns + +`TData` + +#### Inherited from + +```ts +OmitKeyof.select +``` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +```ts +OmitKeyof.staleTime +``` + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.structuralSharing +``` + +*** + ### subscribed? ```ts optional subscribed: boolean; ``` -Defined in: [react-query/src/types.ts:259](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L259) +Defined in: [packages/react-query/src/types.ts:259](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L259) Set this to `false` to unsubscribe this observer from updates to the query cache. diff --git a/docs/framework/react/reference/interfaces/UseSuspenseQueryOptions.md b/docs/framework/react/reference/interfaces/UseSuspenseQueryOptions.md index f6177722755..28978d06d35 100644 --- a/docs/framework/react/reference/interfaces/UseSuspenseQueryOptions.md +++ b/docs/framework/react/reference/interfaces/UseSuspenseQueryOptions.md @@ -3,7 +3,7 @@ id: UseSuspenseQueryOptions title: UseSuspenseQueryOptions --- -Defined in: [react-query/src/types.ts:196](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L196) +Defined in: [packages/react-query/src/types.ts:196](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L196) The options accepted by `useSuspenseQuery`. Same as [UseQueryOptions](UseQueryOptions.md), minus `enabled`, `throwOnError`, and `placeholderData` — Suspense hooks cannot render a "disabled" or "placeholder" state, so those options @@ -11,7 +11,7 @@ don't apply. ## Extends -- `OmitKeyof`\<[`UseQueryOptions`](UseQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\>, `"queryFn"` \| `"enabled"` \| `"throwOnError"` \| `"placeholderData"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`UseQueryOptions`](UseQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\>, `"queryFn"` \| `"enabled"` \| `"throwOnError"` \| `"placeholderData"`\> ## Type Parameters @@ -23,7 +23,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. @@ -36,32 +36,534 @@ The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` when ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. ## Properties +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`gcTime`](QueryOptions.md#gctime) + +*** + +### initialData? + +```ts +optional initialData: + | TQueryFnData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +OmitKeyof.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +OmitKeyof.initialDataUpdatedAt +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`maxPages`](QueryOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`meta`](QueryOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`networkMode`](QueryOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister()? + +```ts +optional persister: (queryFn, context, query) => TQueryFnData | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Parameters + +##### queryFn + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TQueryFnData`, `NoInfer`\<`TQueryKey`\>, `never`\> + +##### context + +###### client + +[`QueryClient`](../classes/QueryClient.md) + +###### direction? + +`unknown` + +**Deprecated** + +if you want access to the direction, you can add it to the pageParam + +###### meta + +`Record`\<`string`, `unknown`\> \| `undefined` + +###### pageParam? + +`unknown` + +###### queryKey + +`NoInfer`\<`TQueryKey`\> + +###### signal + +`AbortSignal` + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`TQueryFnData` \| `Promise`\<`TQueryFnData`\> + +#### Inherited from + +```ts +OmitKeyof.persister +``` + +*** + ### queryFn? ```ts optional queryFn: QueryFunction; ``` -Defined in: [react-query/src/types.ts:209](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L209) +Defined in: [packages/react-query/src/types.ts:209](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L209) `skipToken` is not allowed here — Suspense hooks cannot render a "disabled" state, so a query function must always be provided, unless a default query function has been defined. *** +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryOptions`](QueryOptions.md).[`queryHash`](QueryOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +OmitKeyof.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +OmitKeyof.queryKeyHashFn +``` + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchInterval +``` + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnMount +``` + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnReconnect +``` + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnWindowFocus +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.retryOnMount +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryFnData` + +#### Returns + +`TData` + +#### Inherited from + +```ts +OmitKeyof.select +``` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +```ts +OmitKeyof.staleTime +``` + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.structuralSharing +``` + +*** + ### subscribed? ```ts optional subscribed: boolean; ``` -Defined in: [react-query/src/types.ts:65](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L65) +Defined in: [packages/react-query/src/types.ts:65](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L65) Set this to `false` to unsubscribe this observer from updates to the query cache. diff --git a/docs/framework/react/reference/type-aliases/AnyDataTag.md b/docs/framework/react/reference/type-aliases/AnyDataTag.md new file mode 100644 index 00000000000..d3d5e33bb3e --- /dev/null +++ b/docs/framework/react/reference/type-aliases/AnyDataTag.md @@ -0,0 +1,30 @@ +--- +id: AnyDataTag +title: AnyDataTag +--- + +```ts +type AnyDataTag = object; +``` + +Defined in: [packages/query-core/src/types.ts:67](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L67) + +## Properties + +### \[dataTagErrorSymbol\] + +```ts +[dataTagErrorSymbol]: any; +``` + +Defined in: [packages/query-core/src/types.ts:69](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L69) + +*** + +### \[dataTagSymbol\] + +```ts +[dataTagSymbol]: any; +``` + +Defined in: [packages/query-core/src/types.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L68) diff --git a/docs/framework/react/reference/type-aliases/AnyUseBaseQueryOptions.md b/docs/framework/react/reference/type-aliases/AnyUseBaseQueryOptions.md index 947988618e0..441d01063ea 100644 --- a/docs/framework/react/reference/type-aliases/AnyUseBaseQueryOptions.md +++ b/docs/framework/react/reference/type-aliases/AnyUseBaseQueryOptions.md @@ -7,7 +7,7 @@ title: AnyUseBaseQueryOptions type AnyUseBaseQueryOptions = UseBaseQueryOptions; ``` -Defined in: [react-query/src/types.ts:28](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L28) +Defined in: [packages/react-query/src/types.ts:28](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L28) [UseBaseQueryOptions](../interfaces/UseBaseQueryOptions.md) with all type parameters set to `any`, useful when the specific types aren't relevant, e.g. when accepting options for any query in a helper function. diff --git a/docs/framework/react/reference/type-aliases/AnyUseInfiniteQueryOptions.md b/docs/framework/react/reference/type-aliases/AnyUseInfiniteQueryOptions.md index a38ab02f8cb..33a9039dac7 100644 --- a/docs/framework/react/reference/type-aliases/AnyUseInfiniteQueryOptions.md +++ b/docs/framework/react/reference/type-aliases/AnyUseInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: AnyUseInfiniteQueryOptions type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions; ``` -Defined in: [react-query/src/types.ts:219](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L219) +Defined in: [packages/react-query/src/types.ts:219](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L219) [UseInfiniteQueryOptions](../interfaces/UseInfiniteQueryOptions.md) with all type parameters set to `any`, useful when the specific types aren't relevant, e.g. when accepting options for any query in a helper function. diff --git a/docs/framework/react/reference/type-aliases/AnyUseMutationOptions.md b/docs/framework/react/reference/type-aliases/AnyUseMutationOptions.md index facf8ea370d..77e6c303e94 100644 --- a/docs/framework/react/reference/type-aliases/AnyUseMutationOptions.md +++ b/docs/framework/react/reference/type-aliases/AnyUseMutationOptions.md @@ -7,7 +7,7 @@ title: AnyUseMutationOptions type AnyUseMutationOptions = UseMutationOptions; ``` -Defined in: [react-query/src/types.ts:401](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L401) +Defined in: [packages/react-query/src/types.ts:401](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L401) [UseMutationOptions](../interfaces/UseMutationOptions.md) with all type parameters set to `any`, useful when the specific types aren't relevant, e.g. when accepting options for any mutation in a helper function. diff --git a/docs/framework/react/reference/type-aliases/AnyUseQueryOptions.md b/docs/framework/react/reference/type-aliases/AnyUseQueryOptions.md index fcfc898f6ed..d444460854b 100644 --- a/docs/framework/react/reference/type-aliases/AnyUseQueryOptions.md +++ b/docs/framework/react/reference/type-aliases/AnyUseQueryOptions.md @@ -7,7 +7,7 @@ title: AnyUseQueryOptions type AnyUseQueryOptions = UseQueryOptions; ``` -Defined in: [react-query/src/types.ts:154](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L154) +Defined in: [packages/react-query/src/types.ts:154](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L154) [UseQueryOptions](../interfaces/UseQueryOptions.md) with all type parameters set to `any`, useful when the specific types aren't relevant, e.g. when accepting options for any query in a helper function. diff --git a/docs/framework/react/reference/type-aliases/AnyUseSuspenseInfiniteQueryOptions.md b/docs/framework/react/reference/type-aliases/AnyUseSuspenseInfiniteQueryOptions.md index ea3a18b2716..04dc4684b00 100644 --- a/docs/framework/react/reference/type-aliases/AnyUseSuspenseInfiniteQueryOptions.md +++ b/docs/framework/react/reference/type-aliases/AnyUseSuspenseInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: AnyUseSuspenseInfiniteQueryOptions type AnyUseSuspenseInfiniteQueryOptions = UseSuspenseInfiniteQueryOptions; ``` -Defined in: [react-query/src/types.ts:266](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L266) +Defined in: [packages/react-query/src/types.ts:266](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L266) [UseSuspenseInfiniteQueryOptions](../interfaces/UseSuspenseInfiniteQueryOptions.md) with all type parameters set to `any`, useful when the specific types aren't relevant, e.g. when accepting options for any query in a helper function. diff --git a/docs/framework/react/reference/type-aliases/AnyUseSuspenseQueryOptions.md b/docs/framework/react/reference/type-aliases/AnyUseSuspenseQueryOptions.md index 150a2781b62..b8e59f8f692 100644 --- a/docs/framework/react/reference/type-aliases/AnyUseSuspenseQueryOptions.md +++ b/docs/framework/react/reference/type-aliases/AnyUseSuspenseQueryOptions.md @@ -7,7 +7,7 @@ title: AnyUseSuspenseQueryOptions type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions; ``` -Defined in: [react-query/src/types.ts:179](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L179) +Defined in: [packages/react-query/src/types.ts:179](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L179) [UseSuspenseQueryOptions](../interfaces/UseSuspenseQueryOptions.md) with all type parameters set to `any`, useful when the specific types aren't relevant, e.g. when accepting options for any query in a helper function. diff --git a/docs/framework/react/reference/type-aliases/DataTag.md b/docs/framework/react/reference/type-aliases/DataTag.md new file mode 100644 index 00000000000..904ca124464 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/DataTag.md @@ -0,0 +1,24 @@ +--- +id: DataTag +title: DataTag +--- + +```ts +type DataTag = TType extends AnyDataTag ? TType : TType & object; +``` + +Defined in: [packages/query-core/src/types.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L71) + +## Type Parameters + +### TType + +`TType` + +### TValue + +`TValue` + +### TError + +`TError` = [`UnsetMarker`](UnsetMarker.md) diff --git a/docs/framework/react/reference/type-aliases/DefaultError.md b/docs/framework/react/reference/type-aliases/DefaultError.md new file mode 100644 index 00000000000..da9f615482f --- /dev/null +++ b/docs/framework/react/reference/type-aliases/DefaultError.md @@ -0,0 +1,10 @@ +--- +id: DefaultError +title: DefaultError +--- + +```ts +type DefaultError = Register extends object ? TError : Error; +``` + +Defined in: [packages/query-core/src/types.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L45) diff --git a/docs/framework/react/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/react/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md new file mode 100644 index 00000000000..733a1a5ad75 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -0,0 +1,32 @@ +--- +id: DefaultedInfiniteQueryObserverOptions +title: DefaultedInfiniteQueryObserverOptions +--- + +```ts +type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; +``` + +Defined in: [packages/query-core/src/types.ts:538](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L538) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` diff --git a/docs/framework/react/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/react/reference/type-aliases/DefaultedQueryObserverOptions.md new file mode 100644 index 00000000000..1b4309f150c --- /dev/null +++ b/docs/framework/react/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -0,0 +1,32 @@ +--- +id: DefaultedQueryObserverOptions +title: DefaultedQueryObserverOptions +--- + +```ts +type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; +``` + +Defined in: [packages/query-core/src/types.ts:509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L509) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult.md new file mode 100644 index 00000000000..ced8e568299 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -0,0 +1,22 @@ +--- +id: DefinedInfiniteQueryObserverResult +title: DefinedInfiniteQueryObserverResult +--- + +```ts +type DefinedInfiniteQueryObserverResult = + | InfiniteQueryObserverRefetchErrorResult +| InfiniteQueryObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/react/reference/type-aliases/DefinedInitialDataInfiniteOptions.md b/docs/framework/react/reference/type-aliases/DefinedInitialDataInfiniteOptions.md index 1721394a2ec..9a70bff735c 100644 --- a/docs/framework/react/reference/type-aliases/DefinedInitialDataInfiniteOptions.md +++ b/docs/framework/react/reference/type-aliases/DefinedInitialDataInfiniteOptions.md @@ -7,7 +7,7 @@ title: DefinedInitialDataInfiniteOptions type DefinedInitialDataInfiniteOptions = UseInfiniteQueryOptions & object; ``` -Defined in: [react-query/src/infiniteQueryOptions.ts:103](https://github.com/TanStack/query/blob/main/packages/react-query/src/infiniteQueryOptions.ts#L103) +Defined in: [packages/react-query/src/infiniteQueryOptions.ts:103](https://github.com/TanStack/query/blob/main/packages/react-query/src/infiniteQueryOptions.ts#L103) The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is set — `data` is never `undefined`. @@ -39,20 +39,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/react/reference/type-aliases/DefinedInitialDataOptions.md b/docs/framework/react/reference/type-aliases/DefinedInitialDataOptions.md index 1807607291b..ada7a76611f 100644 --- a/docs/framework/react/reference/type-aliases/DefinedInitialDataOptions.md +++ b/docs/framework/react/reference/type-aliases/DefinedInitialDataOptions.md @@ -7,7 +7,7 @@ title: DefinedInitialDataOptions type DefinedInitialDataOptions = Omit, "queryFn"> & object; ``` -Defined in: [react-query/src/queryOptions.ts:80](https://github.com/TanStack/query/blob/main/packages/react-query/src/queryOptions.ts#L80) +Defined in: [packages/react-query/src/queryOptions.ts:80](https://github.com/TanStack/query/blob/main/packages/react-query/src/queryOptions.ts#L80) The options accepted by the `queryOptions` overload selected when `initialData` is set — `data` is never `undefined`. @@ -48,7 +48,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -60,6 +60,6 @@ The type `data` ends up as after `select` runs. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/react/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/react/reference/type-aliases/DefinedQueryObserverResult.md new file mode 100644 index 00000000000..7afdbfd38bc --- /dev/null +++ b/docs/framework/react/reference/type-aliases/DefinedQueryObserverResult.md @@ -0,0 +1,22 @@ +--- +id: DefinedQueryObserverResult +title: DefinedQueryObserverResult +--- + +```ts +type DefinedQueryObserverResult = + | QueryObserverRefetchErrorResult +| QueryObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/react/reference/type-aliases/DefinedUseInfiniteQueryResult.md b/docs/framework/react/reference/type-aliases/DefinedUseInfiniteQueryResult.md index ee49de8a33a..f1d410e9c1b 100644 --- a/docs/framework/react/reference/type-aliases/DefinedUseInfiniteQueryResult.md +++ b/docs/framework/react/reference/type-aliases/DefinedUseInfiniteQueryResult.md @@ -7,10 +7,10 @@ title: DefinedUseInfiniteQueryResult type DefinedUseInfiniteQueryResult = DefinedInfiniteQueryObserverResult; ``` -Defined in: [react-query/src/types.ts:377](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L377) +Defined in: [packages/react-query/src/types.ts:377](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L377) The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined`. Re-exports -DefinedInfiniteQueryObserverResult from `@tanstack/query-core`. +[DefinedInfiniteQueryObserverResult](DefinedInfiniteQueryObserverResult.md) from `@tanstack/query-core`. ## Type Parameters @@ -22,6 +22,6 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. diff --git a/docs/framework/react/reference/type-aliases/DefinedUseQueryResult.md b/docs/framework/react/reference/type-aliases/DefinedUseQueryResult.md index 724b88fb8dd..5340c35d628 100644 --- a/docs/framework/react/reference/type-aliases/DefinedUseQueryResult.md +++ b/docs/framework/react/reference/type-aliases/DefinedUseQueryResult.md @@ -7,10 +7,10 @@ title: DefinedUseQueryResult type DefinedUseQueryResult = DefinedQueryObserverResult; ``` -Defined in: [react-query/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L353) +Defined in: [packages/react-query/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L353) The result of `useQuery` when `initialData` is set, or of `useSuspenseQuery` before the `isPlaceholderData` -omission — `data` is never `undefined`. Re-exports DefinedQueryObserverResult from +omission — `data` is never `undefined`. Re-exports [DefinedQueryObserverResult](DefinedQueryObserverResult.md) from `@tanstack/query-core`. ## Type Parameters @@ -23,6 +23,6 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. diff --git a/docs/framework/react/reference/type-aliases/DistributiveOmit.md b/docs/framework/react/reference/type-aliases/DistributiveOmit.md new file mode 100644 index 00000000000..33b87a5cd6e --- /dev/null +++ b/docs/framework/react/reference/type-aliases/DistributiveOmit.md @@ -0,0 +1,20 @@ +--- +id: DistributiveOmit +title: DistributiveOmit +--- + +```ts +type DistributiveOmit = TObject extends any ? Omit : never; +``` + +Defined in: [packages/query-core/src/types.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L14) + +## Type Parameters + +### TObject + +`TObject` + +### TKey + +`TKey` *extends* keyof `TObject` diff --git a/docs/framework/react/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/react/reference/type-aliases/EnsureInfiniteQueryDataOptions.md new file mode 100644 index 00000000000..305eef94893 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -0,0 +1,42 @@ +--- +id: EnsureInfiniteQueryDataOptions +title: EnsureInfiniteQueryDataOptions +--- + +```ts +type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; +``` + +Defined in: [packages/query-core/src/types.ts:612](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L612) + +## Type Declaration + +### ~~revalidateIfStale?~~ + +```ts +optional revalidateIfStale: boolean; +``` + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Deprecated diff --git a/docs/framework/react/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/react/reference/type-aliases/FetchInfiniteQueryOptions.md new file mode 100644 index 00000000000..1ee1470b14a --- /dev/null +++ b/docs/framework/react/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -0,0 +1,34 @@ +--- +id: FetchInfiniteQueryOptions +title: FetchInfiniteQueryOptions +--- + +```ts +type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; +``` + +Defined in: [packages/query-core/src/types.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L656) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Deprecated diff --git a/docs/framework/react/reference/type-aliases/FetchStatus.md b/docs/framework/react/reference/type-aliases/FetchStatus.md new file mode 100644 index 00000000000..4dae9444af6 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/FetchStatus.md @@ -0,0 +1,10 @@ +--- +id: FetchStatus +title: FetchStatus +--- + +```ts +type FetchStatus = "fetching" | "paused" | "idle"; +``` + +Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) diff --git a/docs/framework/react/reference/type-aliases/GetNextPageParamFunction.md b/docs/framework/react/reference/type-aliases/GetNextPageParamFunction.md new file mode 100644 index 00000000000..81d1a1544ab --- /dev/null +++ b/docs/framework/react/reference/type-aliases/GetNextPageParamFunction.md @@ -0,0 +1,42 @@ +--- +id: GetNextPageParamFunction +title: GetNextPageParamFunction +--- + +```ts +type GetNextPageParamFunction = (lastPage, allPages, lastPageParam, allPageParams) => TPageParam | undefined | null; +``` + +Defined in: [packages/query-core/src/types.ts:203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L203) + +## Type Parameters + +### TPageParam + +`TPageParam` + +### TQueryFnData + +`TQueryFnData` = `unknown` + +## Parameters + +### lastPage + +`TQueryFnData` + +### allPages + +`TQueryFnData`[] + +### lastPageParam + +`TPageParam` + +### allPageParams + +`TPageParam`[] + +## Returns + +`TPageParam` \| `undefined` \| `null` diff --git a/docs/framework/react/reference/type-aliases/GetPreviousPageParamFunction.md b/docs/framework/react/reference/type-aliases/GetPreviousPageParamFunction.md new file mode 100644 index 00000000000..5a6d9b93d7e --- /dev/null +++ b/docs/framework/react/reference/type-aliases/GetPreviousPageParamFunction.md @@ -0,0 +1,42 @@ +--- +id: GetPreviousPageParamFunction +title: GetPreviousPageParamFunction +--- + +```ts +type GetPreviousPageParamFunction = (firstPage, allPages, firstPageParam, allPageParams) => TPageParam | undefined | null; +``` + +Defined in: [packages/query-core/src/types.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L196) + +## Type Parameters + +### TPageParam + +`TPageParam` + +### TQueryFnData + +`TQueryFnData` = `unknown` + +## Parameters + +### firstPage + +`TQueryFnData` + +### allPages + +`TQueryFnData`[] + +### firstPageParam + +`TPageParam` + +### allPageParams + +`TPageParam`[] + +## Returns + +`TPageParam` \| `undefined` \| `null` diff --git a/docs/framework/react/reference/type-aliases/InferDataFromTag.md b/docs/framework/react/reference/type-aliases/InferDataFromTag.md new file mode 100644 index 00000000000..09a15ca4b1c --- /dev/null +++ b/docs/framework/react/reference/type-aliases/InferDataFromTag.md @@ -0,0 +1,20 @@ +--- +id: InferDataFromTag +title: InferDataFromTag +--- + +```ts +type InferDataFromTag = TTaggedQueryKey extends DataTag ? TaggedValue : TQueryFnData; +``` + +Defined in: [packages/query-core/src/types.ts:90](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L90) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` + +### TTaggedQueryKey + +`TTaggedQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/react/reference/type-aliases/InferErrorFromTag.md b/docs/framework/react/reference/type-aliases/InferErrorFromTag.md new file mode 100644 index 00000000000..cd94e4b5c3f --- /dev/null +++ b/docs/framework/react/reference/type-aliases/InferErrorFromTag.md @@ -0,0 +1,20 @@ +--- +id: InferErrorFromTag +title: InferErrorFromTag +--- + +```ts +type InferErrorFromTag = TTaggedQueryKey extends DataTag ? TaggedError extends UnsetMarker ? TError : TaggedError : TError; +``` + +Defined in: [packages/query-core/src/types.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L95) + +## Type Parameters + +### TError + +`TError` + +### TTaggedQueryKey + +`TTaggedQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/react/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/react/reference/type-aliases/InfiniteQueryExecuteOptions.md new file mode 100644 index 00000000000..29c974cfddf --- /dev/null +++ b/docs/framework/react/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -0,0 +1,32 @@ +--- +id: InfiniteQueryExecuteOptions +title: InfiniteQueryExecuteOptions +--- + +```ts +type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; +``` + +Defined in: [packages/query-core/src/types.ts:635](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L635) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` diff --git a/docs/framework/react/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/react/reference/type-aliases/InfiniteQueryObserverResult.md new file mode 100644 index 00000000000..95fda780d1d --- /dev/null +++ b/docs/framework/react/reference/type-aliases/InfiniteQueryObserverResult.md @@ -0,0 +1,25 @@ +--- +id: InfiniteQueryObserverResult +title: InfiniteQueryObserverResult +--- + +```ts +type InfiniteQueryObserverResult = + | DefinedInfiniteQueryObserverResult + | InfiniteQueryObserverLoadingErrorResult + | InfiniteQueryObserverLoadingResult + | InfiniteQueryObserverPendingResult +| InfiniteQueryObserverPlaceholderResult; +``` + +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/react/reference/type-aliases/InitialDataFunction.md b/docs/framework/react/reference/type-aliases/InitialDataFunction.md new file mode 100644 index 00000000000..6ba4aaabe61 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/InitialDataFunction.md @@ -0,0 +1,20 @@ +--- +id: InitialDataFunction +title: InitialDataFunction +--- + +```ts +type InitialDataFunction = () => T | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L173) + +## Type Parameters + +### T + +`T` + +## Returns + +`T` \| `undefined` diff --git a/docs/framework/react/reference/type-aliases/ManagedTimerId.md b/docs/framework/react/reference/type-aliases/ManagedTimerId.md new file mode 100644 index 00000000000..d7833e3e4f0 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/ManagedTimerId.md @@ -0,0 +1,19 @@ +--- +id: ManagedTimerId +title: ManagedTimerId +--- + +```ts +type ManagedTimerId = + | number + | { + [toPrimitive]: () => number; +}; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:17](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L17) + +Wrapping `setTimeout` is awkward from a typing perspective because platform +typings may extend the return type of `setTimeout`. For example, NodeJS +typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be +able to return such a type. diff --git a/docs/framework/react/reference/type-aliases/MutateFunction.md b/docs/framework/react/reference/type-aliases/MutateFunction.md new file mode 100644 index 00000000000..f574ca7f8ca --- /dev/null +++ b/docs/framework/react/reference/type-aliases/MutateFunction.md @@ -0,0 +1,38 @@ +--- +id: MutateFunction +title: MutateFunction +--- + +```ts +type MutateFunction = (...rest) => Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1258) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Parameters + +### rest + +...[`MutateFunctionRest`](MutateFunctionRest.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Returns + +`Promise`\<`TData`\> diff --git a/docs/framework/react/reference/type-aliases/MutateFunctionRest.md b/docs/framework/react/reference/type-aliases/MutateFunctionRest.md new file mode 100644 index 00000000000..aef21572aeb --- /dev/null +++ b/docs/framework/react/reference/type-aliases/MutateFunctionRest.md @@ -0,0 +1,28 @@ +--- +id: MutateFunctionRest +title: MutateFunctionRest +--- + +```ts +type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; +``` + +Defined in: [packages/query-core/src/types.ts:1243](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1243) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` diff --git a/docs/framework/react/reference/type-aliases/MutationCacheNotifyEvent.md b/docs/framework/react/reference/type-aliases/MutationCacheNotifyEvent.md new file mode 100644 index 00000000000..aa5e196bc72 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/MutationCacheNotifyEvent.md @@ -0,0 +1,20 @@ +--- +id: MutationCacheNotifyEvent +title: MutationCacheNotifyEvent +--- + +```ts +type MutationCacheNotifyEvent = + | NotifyEventMutationAdded + | NotifyEventMutationRemoved + | NotifyEventMutationObserverAdded + | NotifyEventMutationObserverRemoved + | NotifyEventMutationObserverOptionsUpdated + | NotifyEventMutationUpdated; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L98) + +The event passed to a `MutationCache` subscriber. Fired whenever a mutation is added or removed +from the cache, its state is updated, or one of its observers is added, removed, or has its +options updated. diff --git a/docs/framework/react/reference/type-aliases/MutationFunction.md b/docs/framework/react/reference/type-aliases/MutationFunction.md new file mode 100644 index 00000000000..e306a5f1a48 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/MutationFunction.md @@ -0,0 +1,34 @@ +--- +id: MutationFunction +title: MutationFunction +--- + +```ts +type MutationFunction = (variables, context) => Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1161](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1161) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TVariables + +`TVariables` = `unknown` + +## Parameters + +### variables + +`TVariables` + +### context + +[`MutationFunctionContext`](MutationFunctionContext.md) + +## Returns + +`Promise`\<`TData`\> diff --git a/docs/framework/react/reference/type-aliases/MutationFunctionContext.md b/docs/framework/react/reference/type-aliases/MutationFunctionContext.md new file mode 100644 index 00000000000..b29a54df298 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/MutationFunctionContext.md @@ -0,0 +1,40 @@ +--- +id: MutationFunctionContext +title: MutationFunctionContext +--- + +```ts +type MutationFunctionContext = object; +``` + +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) + +## Properties + +### client + +```ts +client: QueryClient; +``` + +Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) + +*** + +### meta + +```ts +meta: MutationMeta | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) + +*** + +### mutationKey? + +```ts +optional mutationKey: MutationKey; +``` + +Defined in: [packages/query-core/src/types.ts:1158](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1158) diff --git a/docs/framework/react/reference/type-aliases/MutationKey.md b/docs/framework/react/reference/type-aliases/MutationKey.md new file mode 100644 index 00000000000..f89c6959883 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/MutationKey.md @@ -0,0 +1,10 @@ +--- +id: MutationKey +title: MutationKey +--- + +```ts +type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; +``` + +Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) diff --git a/docs/framework/react/reference/type-aliases/MutationMeta.md b/docs/framework/react/reference/type-aliases/MutationMeta.md new file mode 100644 index 00000000000..e1d481cdcf1 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/MutationMeta.md @@ -0,0 +1,10 @@ +--- +id: MutationMeta +title: MutationMeta +--- + +```ts +type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; +``` + +Defined in: [packages/query-core/src/types.ts:1147](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1147) diff --git a/docs/framework/react/reference/type-aliases/MutationObserverResult.md b/docs/framework/react/reference/type-aliases/MutationObserverResult.md new file mode 100644 index 00000000000..cbd07f40537 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/MutationObserverResult.md @@ -0,0 +1,32 @@ +--- +id: MutationObserverResult +title: MutationObserverResult +--- + +```ts +type MutationObserverResult = + | MutationObserverIdleResult + | MutationObserverLoadingResult + | MutationObserverErrorResult +| MutationObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` diff --git a/docs/framework/react/reference/type-aliases/MutationScope.md b/docs/framework/react/reference/type-aliases/MutationScope.md new file mode 100644 index 00000000000..6ec14643477 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/MutationScope.md @@ -0,0 +1,20 @@ +--- +id: MutationScope +title: MutationScope +--- + +```ts +type MutationScope = object; +``` + +Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) + +## Properties + +### id + +```ts +id: string; +``` + +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) diff --git a/docs/framework/react/reference/type-aliases/MutationStatus.md b/docs/framework/react/reference/type-aliases/MutationStatus.md new file mode 100644 index 00000000000..eedf0fb979a --- /dev/null +++ b/docs/framework/react/reference/type-aliases/MutationStatus.md @@ -0,0 +1,10 @@ +--- +id: MutationStatus +title: MutationStatus +--- + +```ts +type MutationStatus = "idle" | "pending" | "success" | "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) diff --git a/docs/framework/react/reference/type-aliases/NetworkMode.md b/docs/framework/react/reference/type-aliases/NetworkMode.md new file mode 100644 index 00000000000..94ae0ba76ed --- /dev/null +++ b/docs/framework/react/reference/type-aliases/NetworkMode.md @@ -0,0 +1,10 @@ +--- +id: NetworkMode +title: NetworkMode +--- + +```ts +type NetworkMode = "online" | "always" | "offlineFirst"; +``` + +Defined in: [packages/query-core/src/types.ts:223](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L223) diff --git a/docs/framework/react/reference/type-aliases/NonUndefinedGuard.md b/docs/framework/react/reference/type-aliases/NonUndefinedGuard.md new file mode 100644 index 00000000000..4aaf208013b --- /dev/null +++ b/docs/framework/react/reference/type-aliases/NonUndefinedGuard.md @@ -0,0 +1,16 @@ +--- +id: NonUndefinedGuard +title: NonUndefinedGuard +--- + +```ts +type NonUndefinedGuard = T extends undefined ? never : T; +``` + +Defined in: [packages/query-core/src/types.ts:12](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L12) + +## Type Parameters + +### T + +`T` diff --git a/docs/framework/react/reference/type-aliases/NotifyEventType.md b/docs/framework/react/reference/type-aliases/NotifyEventType.md new file mode 100644 index 00000000000..7b788ced7af --- /dev/null +++ b/docs/framework/react/reference/type-aliases/NotifyEventType.md @@ -0,0 +1,17 @@ +--- +id: NotifyEventType +title: NotifyEventType +--- + +```ts +type NotifyEventType = + | "added" + | "removed" + | "updated" + | "observerAdded" + | "observerRemoved" + | "observerResultsUpdated" + | "observerOptionsUpdated"; +``` + +Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) diff --git a/docs/framework/react/reference/type-aliases/NotifyOnChangeProps.md b/docs/framework/react/reference/type-aliases/NotifyOnChangeProps.md new file mode 100644 index 00000000000..7de194fa10b --- /dev/null +++ b/docs/framework/react/reference/type-aliases/NotifyOnChangeProps.md @@ -0,0 +1,17 @@ +--- +id: NotifyOnChangeProps +title: NotifyOnChangeProps +--- + +```ts +type NotifyOnChangeProps = + | keyof InfiniteQueryObserverResult[] + | "all" + | undefined + | () => + | keyof InfiniteQueryObserverResult[] + | "all" + | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L225) diff --git a/docs/framework/react/reference/type-aliases/OmitKeyof.md b/docs/framework/react/reference/type-aliases/OmitKeyof.md new file mode 100644 index 00000000000..690a7b0a5d2 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/OmitKeyof.md @@ -0,0 +1,28 @@ +--- +id: OmitKeyof +title: OmitKeyof +--- + +```ts +type OmitKeyof = Omit; +``` + +Defined in: [packages/query-core/src/types.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L19) + +## Type Parameters + +### TObject + +`TObject` + +### TKey + +`TKey` *extends* `TStrictly` *extends* `"safely"` ? + \| keyof `TObject` + \| `string` & `Record`\<`never`, `never`\> + \| `number` & `Record`\<`never`, `never`\> + \| `symbol` & `Record`\<`never`, `never`\> : keyof `TObject` + +### TStrictly + +`TStrictly` *extends* `"strictly"` \| `"safely"` = `"strictly"` diff --git a/docs/framework/react/reference/type-aliases/Override.md b/docs/framework/react/reference/type-aliases/Override.md new file mode 100644 index 00000000000..8abcecd1e1b --- /dev/null +++ b/docs/framework/react/reference/type-aliases/Override.md @@ -0,0 +1,20 @@ +--- +id: Override +title: Override +--- + +```ts +type Override = { [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey] }; +``` + +Defined in: [packages/query-core/src/types.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L31) + +## Type Parameters + +### TTargetA + +`TTargetA` + +### TTargetB + +`TTargetB` diff --git a/docs/framework/react/reference/type-aliases/PlaceholderDataFunction.md b/docs/framework/react/reference/type-aliases/PlaceholderDataFunction.md new file mode 100644 index 00000000000..cd40f28b41e --- /dev/null +++ b/docs/framework/react/reference/type-aliases/PlaceholderDataFunction.md @@ -0,0 +1,42 @@ +--- +id: PlaceholderDataFunction +title: PlaceholderDataFunction +--- + +```ts +type PlaceholderDataFunction = (previousData, previousQuery) => TQueryData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:177](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L177) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +## Parameters + +### previousData + +`TQueryData` | `undefined` + +### previousQuery + +[`Query`](../classes/Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> | `undefined` + +## Returns + +`TQueryData` \| `undefined` diff --git a/docs/framework/react/reference/type-aliases/QueriesOptions.md b/docs/framework/react/reference/type-aliases/QueriesOptions.md index 9ab4be62e37..1f98b59bdb9 100644 --- a/docs/framework/react/reference/type-aliases/QueriesOptions.md +++ b/docs/framework/react/reference/type-aliases/QueriesOptions.md @@ -7,7 +7,7 @@ title: QueriesOptions type QueriesOptions = TDepth["length"] extends MAXIMUM_DEPTH ? UseQueryOptionsForUseQueries[] : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryOptionsForUseQueries] : T extends [infer Head, ...(infer Tails)] ? QueriesOptions<[...Tails], [...TResults, GetUseQueryOptionsForUseQueries], [...TDepth, 1]> : ReadonlyArray extends T ? T : T extends UseQueryOptionsForUseQueries[] ? UseQueryOptionsForUseQueries[] : UseQueryOptionsForUseQueries[]; ``` -Defined in: [react-query/src/useQueries.ts:156](https://github.com/TanStack/query/blob/main/packages/react-query/src/useQueries.ts#L156) +Defined in: [packages/react-query/src/useQueries.ts:156](https://github.com/TanStack/query/blob/main/packages/react-query/src/useQueries.ts#L156) The `queries` array accepted by `useQueries`. Recursively unwraps each tuple element so every entry's `queryFn`/`select`/`throwOnError` are inferred individually, up to 20 elements. An opaque array (e.g. diff --git a/docs/framework/react/reference/type-aliases/QueriesPlaceholderDataFunction.md b/docs/framework/react/reference/type-aliases/QueriesPlaceholderDataFunction.md new file mode 100644 index 00000000000..5d3fca8c9e0 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/QueriesPlaceholderDataFunction.md @@ -0,0 +1,30 @@ +--- +id: QueriesPlaceholderDataFunction +title: QueriesPlaceholderDataFunction +--- + +```ts +type QueriesPlaceholderDataFunction = (previousData, previousQuery) => TQueryData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L187) + +## Type Parameters + +### TQueryData + +`TQueryData` + +## Parameters + +### previousData + +`undefined` + +### previousQuery + +`undefined` + +## Returns + +`TQueryData` \| `undefined` diff --git a/docs/framework/react/reference/type-aliases/QueriesResults.md b/docs/framework/react/reference/type-aliases/QueriesResults.md index c560ce906d6..4742d4045bc 100644 --- a/docs/framework/react/reference/type-aliases/QueriesResults.md +++ b/docs/framework/react/reference/type-aliases/QueriesResults.md @@ -7,7 +7,7 @@ title: QueriesResults type QueriesResults = TDepth["length"] extends MAXIMUM_DEPTH ? UseQueryResult[] : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryResult] : T extends [infer Head, ...(infer Tails)] ? QueriesResults<[...Tails], [...TResults, GetUseQueryResult], [...TDepth, 1]> : { [K in keyof T]: GetUseQueryResult }; ``` -Defined in: [react-query/src/useQueries.ts:207](https://github.com/TanStack/query/blob/main/packages/react-query/src/useQueries.ts#L207) +Defined in: [packages/react-query/src/useQueries.ts:207](https://github.com/TanStack/query/blob/main/packages/react-query/src/useQueries.ts#L207) The result type returned by `useQueries`, when no `combine` is provided. Mirrors [QueriesOptions](QueriesOptions.md): each tuple element's result type is inferred individually, up to 20 elements. A non-tuple array is mapped diff --git a/docs/framework/react/reference/type-aliases/QueryBooleanOption.md b/docs/framework/react/reference/type-aliases/QueryBooleanOption.md new file mode 100644 index 00000000000..9759e3ddb42 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/QueryBooleanOption.md @@ -0,0 +1,28 @@ +--- +id: QueryBooleanOption +title: QueryBooleanOption +--- + +```ts +type QueryBooleanOption = boolean | (query) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L119) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/react/reference/type-aliases/QueryCacheNotifyEvent.md b/docs/framework/react/reference/type-aliases/QueryCacheNotifyEvent.md new file mode 100644 index 00000000000..8e52da9e279 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/QueryCacheNotifyEvent.md @@ -0,0 +1,21 @@ +--- +id: QueryCacheNotifyEvent +title: QueryCacheNotifyEvent +--- + +```ts +type QueryCacheNotifyEvent = + | NotifyEventQueryAdded + | NotifyEventQueryRemoved + | NotifyEventQueryUpdated + | NotifyEventQueryObserverAdded + | NotifyEventQueryObserverRemoved + | NotifyEventQueryObserverResultsUpdated + | NotifyEventQueryObserverOptionsUpdated; +``` + +Defined in: [packages/query-core/src/queryCache.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L84) + +The event passed to a `QueryCache` subscriber. Fired whenever a query is added or removed from +the cache, its state is updated (e.g. via `query.setState` or `queryClient.removeQueries`), or +one of its observers is added, removed, or has its results or options updated. diff --git a/docs/framework/react/reference/type-aliases/QueryClientProviderProps.md b/docs/framework/react/reference/type-aliases/QueryClientProviderProps.md index dc1ee2d8bd3..7de9414379d 100644 --- a/docs/framework/react/reference/type-aliases/QueryClientProviderProps.md +++ b/docs/framework/react/reference/type-aliases/QueryClientProviderProps.md @@ -7,7 +7,7 @@ title: QueryClientProviderProps type QueryClientProviderProps = object; ``` -Defined in: [react-query/src/QueryClientProvider.tsx:38](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryClientProvider.tsx#L38) +Defined in: [packages/react-query/src/QueryClientProvider.tsx:38](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryClientProvider.tsx#L38) The props accepted by `QueryClientProvider`. @@ -19,7 +19,7 @@ The props accepted by `QueryClientProvider`. optional children: React.ReactNode; ``` -Defined in: [react-query/src/QueryClientProvider.tsx:48](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryClientProvider.tsx#L48) +Defined in: [packages/react-query/src/QueryClientProvider.tsx:48](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryClientProvider.tsx#L48) The components that get access to the provided `QueryClient`. @@ -31,7 +31,7 @@ The components that get access to the provided `QueryClient`. client: QueryClient; ``` -Defined in: [react-query/src/QueryClientProvider.tsx:44](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryClientProvider.tsx#L44) +Defined in: [packages/react-query/src/QueryClientProvider.tsx:44](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryClientProvider.tsx#L44) **Required** diff --git a/docs/framework/react/reference/type-aliases/QueryErrorClearResetFunction.md b/docs/framework/react/reference/type-aliases/QueryErrorClearResetFunction.md index 73be345b630..7a8071145d0 100644 --- a/docs/framework/react/reference/type-aliases/QueryErrorClearResetFunction.md +++ b/docs/framework/react/reference/type-aliases/QueryErrorClearResetFunction.md @@ -7,7 +7,7 @@ title: QueryErrorClearResetFunction type QueryErrorClearResetFunction = () => void; ``` -Defined in: [react-query/src/QueryErrorResetBoundary.tsx:7](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L7) +Defined in: [packages/react-query/src/QueryErrorResetBoundary.tsx:7](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L7) ## Returns diff --git a/docs/framework/react/reference/type-aliases/QueryErrorIsResetFunction.md b/docs/framework/react/reference/type-aliases/QueryErrorIsResetFunction.md index 049ead420e7..038a72d7b04 100644 --- a/docs/framework/react/reference/type-aliases/QueryErrorIsResetFunction.md +++ b/docs/framework/react/reference/type-aliases/QueryErrorIsResetFunction.md @@ -7,7 +7,7 @@ title: QueryErrorIsResetFunction type QueryErrorIsResetFunction = () => boolean; ``` -Defined in: [react-query/src/QueryErrorResetBoundary.tsx:6](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L6) +Defined in: [packages/react-query/src/QueryErrorResetBoundary.tsx:6](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L6) ## Returns diff --git a/docs/framework/react/reference/type-aliases/QueryErrorResetBoundaryFunction.md b/docs/framework/react/reference/type-aliases/QueryErrorResetBoundaryFunction.md index df4218127f2..9b2ee994a57 100644 --- a/docs/framework/react/reference/type-aliases/QueryErrorResetBoundaryFunction.md +++ b/docs/framework/react/reference/type-aliases/QueryErrorResetBoundaryFunction.md @@ -7,7 +7,7 @@ title: QueryErrorResetBoundaryFunction type QueryErrorResetBoundaryFunction = (value) => React.ReactNode; ``` -Defined in: [react-query/src/QueryErrorResetBoundary.tsx:87](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L87) +Defined in: [packages/react-query/src/QueryErrorResetBoundary.tsx:87](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L87) A render-prop function usable as `children` on `QueryErrorResetBoundary`. diff --git a/docs/framework/react/reference/type-aliases/QueryErrorResetFunction.md b/docs/framework/react/reference/type-aliases/QueryErrorResetFunction.md index a4bbfd436ec..fe60d7b0ac7 100644 --- a/docs/framework/react/reference/type-aliases/QueryErrorResetFunction.md +++ b/docs/framework/react/reference/type-aliases/QueryErrorResetFunction.md @@ -7,7 +7,7 @@ title: QueryErrorResetFunction type QueryErrorResetFunction = () => void; ``` -Defined in: [react-query/src/QueryErrorResetBoundary.tsx:5](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L5) +Defined in: [packages/react-query/src/QueryErrorResetBoundary.tsx:5](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L5) ## Returns diff --git a/docs/framework/react/reference/type-aliases/QueryFunction.md b/docs/framework/react/reference/type-aliases/QueryFunction.md new file mode 100644 index 00000000000..306367388a1 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/QueryFunction.md @@ -0,0 +1,34 @@ +--- +id: QueryFunction +title: QueryFunction +--- + +```ts +type QueryFunction = (context) => T | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L102) + +## Type Parameters + +### T + +`T` = `unknown` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Parameters + +### context + +[`QueryFunctionContext`](QueryFunctionContext.md)\<`TQueryKey`, `TPageParam`\> + +## Returns + +`T` \| `Promise`\<`T`\> diff --git a/docs/framework/react/reference/type-aliases/QueryFunctionContext.md b/docs/framework/react/reference/type-aliases/QueryFunctionContext.md new file mode 100644 index 00000000000..d2c9fe3e2b2 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/QueryFunctionContext.md @@ -0,0 +1,20 @@ +--- +id: QueryFunctionContext +title: QueryFunctionContext +--- + +```ts +type QueryFunctionContext = [TPageParam] extends [never] ? object : object; +``` + +Defined in: [packages/query-core/src/types.ts:144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L144) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` diff --git a/docs/framework/react/reference/type-aliases/QueryKey.md b/docs/framework/react/reference/type-aliases/QueryKey.md new file mode 100644 index 00000000000..1a3f34cde18 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/QueryKey.md @@ -0,0 +1,10 @@ +--- +id: QueryKey +title: QueryKey +--- + +```ts +type QueryKey = Register extends object ? TQueryKey extends ReadonlyArray ? TQueryKey : TQueryKey extends unknown[] ? TQueryKey : ReadonlyArray : ReadonlyArray; +``` + +Defined in: [packages/query-core/src/types.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L51) diff --git a/docs/framework/react/reference/type-aliases/QueryKeyHashFunction.md b/docs/framework/react/reference/type-aliases/QueryKeyHashFunction.md new file mode 100644 index 00000000000..feda96373cc --- /dev/null +++ b/docs/framework/react/reference/type-aliases/QueryKeyHashFunction.md @@ -0,0 +1,26 @@ +--- +id: QueryKeyHashFunction +title: QueryKeyHashFunction +--- + +```ts +type QueryKeyHashFunction = (queryKey) => string; +``` + +Defined in: [packages/query-core/src/types.ts:192](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L192) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) + +## Parameters + +### queryKey + +`TQueryKey` + +## Returns + +`string` diff --git a/docs/framework/react/reference/type-aliases/QueryKeyWithDataTag.md b/docs/framework/react/reference/type-aliases/QueryKeyWithDataTag.md new file mode 100644 index 00000000000..6613f74be9e --- /dev/null +++ b/docs/framework/react/reference/type-aliases/QueryKeyWithDataTag.md @@ -0,0 +1,34 @@ +--- +id: QueryKeyWithDataTag +title: QueryKeyWithDataTag +--- + +```ts +type QueryKeyWithDataTag = object; +``` + +Defined in: [packages/query-core/src/types.ts:82](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L82) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +## Properties + +### queryKey + +```ts +queryKey: DataTag; +``` + +Defined in: [packages/query-core/src/types.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L87) diff --git a/docs/framework/react/reference/type-aliases/QueryMeta.md b/docs/framework/react/reference/type-aliases/QueryMeta.md new file mode 100644 index 00000000000..c12917b2cce --- /dev/null +++ b/docs/framework/react/reference/type-aliases/QueryMeta.md @@ -0,0 +1,10 @@ +--- +id: QueryMeta +title: QueryMeta +--- + +```ts +type QueryMeta = Register extends object ? TQueryMeta extends Record ? TQueryMeta : Record : Record; +``` + +Defined in: [packages/query-core/src/types.ts:215](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L215) diff --git a/docs/framework/react/reference/type-aliases/QueryObserverResult.md b/docs/framework/react/reference/type-aliases/QueryObserverResult.md new file mode 100644 index 00000000000..f6c4118a978 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/QueryObserverResult.md @@ -0,0 +1,25 @@ +--- +id: QueryObserverResult +title: QueryObserverResult +--- + +```ts +type QueryObserverResult = + | DefinedQueryObserverResult + | QueryObserverLoadingErrorResult + | QueryObserverLoadingResult + | QueryObserverPendingResult +| QueryObserverPlaceholderResult; +``` + +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/react/reference/type-aliases/QueryPersister.md b/docs/framework/react/reference/type-aliases/QueryPersister.md new file mode 100644 index 00000000000..72e80165b0d --- /dev/null +++ b/docs/framework/react/reference/type-aliases/QueryPersister.md @@ -0,0 +1,24 @@ +--- +id: QueryPersister +title: QueryPersister +--- + +```ts +type QueryPersister = [TPageParam] extends [never] ? (queryFn, context, query) => T | Promise : (queryFn, context, query) => T | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L128) + +## Type Parameters + +### T + +`T` = `unknown` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` diff --git a/docs/framework/react/reference/type-aliases/QueryStatus.md b/docs/framework/react/reference/type-aliases/QueryStatus.md new file mode 100644 index 00000000000..ed6059e03ec --- /dev/null +++ b/docs/framework/react/reference/type-aliases/QueryStatus.md @@ -0,0 +1,10 @@ +--- +id: QueryStatus +title: QueryStatus +--- + +```ts +type QueryStatus = "pending" | "error" | "success"; +``` + +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) diff --git a/docs/framework/react/reference/type-aliases/SkipToken.md b/docs/framework/react/reference/type-aliases/SkipToken.md new file mode 100644 index 00000000000..176c23830d2 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/SkipToken.md @@ -0,0 +1,12 @@ +--- +id: SkipToken +title: SkipToken +--- + +```ts +type SkipToken = typeof skipToken; +``` + +Defined in: [packages/query-core/src/utils.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L524) + +The type of the [skipToken](../variables/skipToken.md) sentinel value. diff --git a/docs/framework/react/reference/type-aliases/StaleTime.md b/docs/framework/react/reference/type-aliases/StaleTime.md new file mode 100644 index 00000000000..3e7e21608be --- /dev/null +++ b/docs/framework/react/reference/type-aliases/StaleTime.md @@ -0,0 +1,10 @@ +--- +id: StaleTime +title: StaleTime +--- + +```ts +type StaleTime = number | "static"; +``` + +Defined in: [packages/query-core/src/types.ts:108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L108) diff --git a/docs/framework/react/reference/type-aliases/StaleTimeFunction.md b/docs/framework/react/reference/type-aliases/StaleTimeFunction.md new file mode 100644 index 00000000000..b1c541fa64e --- /dev/null +++ b/docs/framework/react/reference/type-aliases/StaleTimeFunction.md @@ -0,0 +1,28 @@ +--- +id: StaleTimeFunction +title: StaleTimeFunction +--- + +```ts +type StaleTimeFunction = StaleTime | (query) => StaleTime; +``` + +Defined in: [packages/query-core/src/types.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L110) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/react/reference/type-aliases/SuspenseQueriesOptions.md b/docs/framework/react/reference/type-aliases/SuspenseQueriesOptions.md index 213540b5449..e63aa2563b8 100644 --- a/docs/framework/react/reference/type-aliases/SuspenseQueriesOptions.md +++ b/docs/framework/react/reference/type-aliases/SuspenseQueriesOptions.md @@ -7,7 +7,7 @@ title: SuspenseQueriesOptions type SuspenseQueriesOptions = TDepth["length"] extends MAXIMUM_DEPTH ? UseSuspenseQueryOptions[] : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryOptions] : T extends [infer Head, ...(infer Tails)] ? SuspenseQueriesOptions<[...Tails], [...TResults, GetUseSuspenseQueryOptions], [...TDepth, 1]> : unknown[] extends T ? T : T extends UseSuspenseQueryOptions[] ? UseSuspenseQueryOptions[] : UseSuspenseQueryOptions[]; ``` -Defined in: [react-query/src/useSuspenseQueries.ts:119](https://github.com/TanStack/query/blob/main/packages/react-query/src/useSuspenseQueries.ts#L119) +Defined in: [packages/react-query/src/useSuspenseQueries.ts:119](https://github.com/TanStack/query/blob/main/packages/react-query/src/useSuspenseQueries.ts#L119) The `queries` array accepted by `useSuspenseQueries`. Recursively unwraps each tuple element so every entry's `queryFn`/`select` are inferred individually, up to 20 elements. An opaque array (e.g. `unknown[]`) diff --git a/docs/framework/react/reference/type-aliases/SuspenseQueriesResults.md b/docs/framework/react/reference/type-aliases/SuspenseQueriesResults.md index 0db1c6f054e..f1c2d32eca0 100644 --- a/docs/framework/react/reference/type-aliases/SuspenseQueriesResults.md +++ b/docs/framework/react/reference/type-aliases/SuspenseQueriesResults.md @@ -7,7 +7,7 @@ title: SuspenseQueriesResults type SuspenseQueriesResults = TDepth["length"] extends MAXIMUM_DEPTH ? UseSuspenseQueryResult[] : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryResult] : T extends [infer Head, ...(infer Tails)] ? SuspenseQueriesResults<[...Tails], [...TResults, GetUseSuspenseQueryResult], [...TDepth, 1]> : { [K in keyof T]: GetUseSuspenseQueryResult }; ``` -Defined in: [react-query/src/useSuspenseQueries.ts:165](https://github.com/TanStack/query/blob/main/packages/react-query/src/useSuspenseQueries.ts#L165) +Defined in: [packages/react-query/src/useSuspenseQueries.ts:165](https://github.com/TanStack/query/blob/main/packages/react-query/src/useSuspenseQueries.ts#L165) The result type returned by `useSuspenseQueries`, when no `combine` is provided. Mirrors [SuspenseQueriesOptions](SuspenseQueriesOptions.md): each tuple element's result type is inferred individually, up to 20 elements. diff --git a/docs/framework/react/reference/type-aliases/ThrowOnError.md b/docs/framework/react/reference/type-aliases/ThrowOnError.md new file mode 100644 index 00000000000..60ad44c1cd1 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/ThrowOnError.md @@ -0,0 +1,28 @@ +--- +id: ThrowOnError +title: ThrowOnError +--- + +```ts +type ThrowOnError = boolean | (error, query) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L361) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` + +### TError + +`TError` + +### TQueryData + +`TQueryData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/react/reference/type-aliases/TimeoutCallback.md b/docs/framework/react/reference/type-aliases/TimeoutCallback.md new file mode 100644 index 00000000000..387fb1238f3 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/TimeoutCallback.md @@ -0,0 +1,27 @@ +--- +id: TimeoutCallback +title: TimeoutCallback +--- + +```ts +type TimeoutCallback = (_) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:9](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L9) + +TimeoutManager does not support passing arguments to the callback. + +`(_: void)` is the argument type inferred by TypeScript's default typings for +`setTimeout(cb, number)`. +If we don't accept a single void argument, then +`new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. + +## Parameters + +### \_ + +`void` + +## Returns + +`void` diff --git a/docs/framework/react/reference/type-aliases/TimeoutProvider.md b/docs/framework/react/reference/type-aliases/TimeoutProvider.md new file mode 100644 index 00000000000..6416fe4c557 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/TimeoutProvider.md @@ -0,0 +1,106 @@ +--- +id: TimeoutProvider +title: TimeoutProvider +--- + +```ts +type TimeoutProvider = object; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:22](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L22) + +Backend for timer functions. + +## Type Parameters + +### TTimerId + +`TTimerId` *extends* [`ManagedTimerId`](ManagedTimerId.md) = [`ManagedTimerId`](ManagedTimerId.md) + +## Properties + +### clearInterval() + +```ts +readonly clearInterval: (intervalId) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) + +#### Parameters + +##### intervalId + +`TTimerId` | `undefined` + +#### Returns + +`void` + +*** + +### clearTimeout() + +```ts +readonly clearTimeout: (timeoutId) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L25) + +#### Parameters + +##### timeoutId + +`TTimerId` | `undefined` + +#### Returns + +`void` + +*** + +### setInterval() + +```ts +readonly setInterval: (callback, delay) => TTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L27) + +#### Parameters + +##### callback + +[`TimeoutCallback`](TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +`TTimerId` + +*** + +### setTimeout() + +```ts +readonly setTimeout: (callback, delay) => TTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L24) + +#### Parameters + +##### callback + +[`TimeoutCallback`](TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +`TTimerId` diff --git a/docs/framework/react/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md b/docs/framework/react/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md index a59e75eeb93..de486a2b72d 100644 --- a/docs/framework/react/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md +++ b/docs/framework/react/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md @@ -7,7 +7,7 @@ title: UndefinedInitialDataInfiniteOptions type UndefinedInitialDataInfiniteOptions = UseInfiniteQueryOptions & object; ``` -Defined in: [react-query/src/infiniteQueryOptions.ts:24](https://github.com/TanStack/query/blob/main/packages/react-query/src/infiniteQueryOptions.ts#L24) +Defined in: [packages/react-query/src/infiniteQueryOptions.ts:24](https://github.com/TanStack/query/blob/main/packages/react-query/src/infiniteQueryOptions.ts#L24) The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set — `data` may be `undefined` while the query is `pending`. @@ -38,20 +38,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/react/reference/type-aliases/UndefinedInitialDataOptions.md b/docs/framework/react/reference/type-aliases/UndefinedInitialDataOptions.md index cfabb5cd25d..bf9de58ac2d 100644 --- a/docs/framework/react/reference/type-aliases/UndefinedInitialDataOptions.md +++ b/docs/framework/react/reference/type-aliases/UndefinedInitialDataOptions.md @@ -7,7 +7,7 @@ title: UndefinedInitialDataOptions type UndefinedInitialDataOptions = UseQueryOptions & object; ``` -Defined in: [react-query/src/queryOptions.ts:22](https://github.com/TanStack/query/blob/main/packages/react-query/src/queryOptions.ts#L22) +Defined in: [packages/react-query/src/queryOptions.ts:22](https://github.com/TanStack/query/blob/main/packages/react-query/src/queryOptions.ts#L22) The options accepted by the `queryOptions` overload selected when no `initialData` is set — `data` may be `undefined` while the query is `pending`. @@ -38,7 +38,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -50,6 +50,6 @@ The type `data` ends up as after `select` runs. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/react/reference/type-aliases/UnsetMarker.md b/docs/framework/react/reference/type-aliases/UnsetMarker.md new file mode 100644 index 00000000000..8b9c14e1907 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/UnsetMarker.md @@ -0,0 +1,10 @@ +--- +id: UnsetMarker +title: UnsetMarker +--- + +```ts +type UnsetMarker = typeof unsetMarker; +``` + +Defined in: [packages/query-core/src/types.ts:66](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L66) diff --git a/docs/framework/react/reference/type-aliases/UnusedSkipTokenInfiniteOptions.md b/docs/framework/react/reference/type-aliases/UnusedSkipTokenInfiniteOptions.md index 180225a81bf..1d098ea74fc 100644 --- a/docs/framework/react/reference/type-aliases/UnusedSkipTokenInfiniteOptions.md +++ b/docs/framework/react/reference/type-aliases/UnusedSkipTokenInfiniteOptions.md @@ -7,7 +7,7 @@ title: UnusedSkipTokenInfiniteOptions type UnusedSkipTokenInfiniteOptions = OmitKeyof, "queryFn"> & object; ``` -Defined in: [react-query/src/infiniteQueryOptions.ts:64](https://github.com/TanStack/query/blob/main/packages/react-query/src/infiniteQueryOptions.ts#L64) +Defined in: [packages/react-query/src/infiniteQueryOptions.ts:64](https://github.com/TanStack/query/blob/main/packages/react-query/src/infiniteQueryOptions.ts#L64) The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set and `queryFn` is not `skipToken` — same as [UndefinedInitialDataInfiniteOptions](UndefinedInitialDataInfiniteOptions.md), but `queryFn` may not be @@ -36,20 +36,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/react/reference/type-aliases/UnusedSkipTokenOptions.md b/docs/framework/react/reference/type-aliases/UnusedSkipTokenOptions.md index dee4b40d41a..0a7365b2ffa 100644 --- a/docs/framework/react/reference/type-aliases/UnusedSkipTokenOptions.md +++ b/docs/framework/react/reference/type-aliases/UnusedSkipTokenOptions.md @@ -7,7 +7,7 @@ title: UnusedSkipTokenOptions type UnusedSkipTokenOptions = OmitKeyof, "queryFn"> & object; ``` -Defined in: [react-query/src/queryOptions.ts:50](https://github.com/TanStack/query/blob/main/packages/react-query/src/queryOptions.ts#L50) +Defined in: [packages/react-query/src/queryOptions.ts:50](https://github.com/TanStack/query/blob/main/packages/react-query/src/queryOptions.ts#L50) The options accepted by the `queryOptions` overload selected when no `initialData` is set and `queryFn` is not `skipToken` — same as [UndefinedInitialDataOptions](UndefinedInitialDataOptions.md), but `queryFn` may not be `skipToken`. @@ -35,7 +35,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -47,6 +47,6 @@ The type `data` ends up as after `select` runs. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/react/reference/type-aliases/Updater.md b/docs/framework/react/reference/type-aliases/Updater.md new file mode 100644 index 00000000000..b6a29ccc5fc --- /dev/null +++ b/docs/framework/react/reference/type-aliases/Updater.md @@ -0,0 +1,35 @@ +--- +id: Updater +title: Updater +--- + +```ts +type Updater = TOutput | (input) => TOutput; +``` + +Defined in: [packages/query-core/src/utils.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L103) + +Either a plain value of type `TOutput`, or a function that receives `TInput` and returns `TOutput`. +Used for example by `setQueryData`-style updaters, which accept either the new data directly or a +function that computes it from the previous data. See functionalUpdate. + +## Type Parameters + +### TInput + +`TInput` + +### TOutput + +`TOutput` + +## Example + +```ts +queryClient.setQueryData(['posts'], newPosts) + +// Or, using an updater function that receives the current data: +queryClient.setQueryData(['posts'], (oldPosts) => + oldPosts ? [...oldPosts, newPost] : oldPosts, +) +``` diff --git a/docs/framework/react/reference/type-aliases/UseBaseMutationResult.md b/docs/framework/react/reference/type-aliases/UseBaseMutationResult.md index f6c7190284c..86d821ea070 100644 --- a/docs/framework/react/reference/type-aliases/UseBaseMutationResult.md +++ b/docs/framework/react/reference/type-aliases/UseBaseMutationResult.md @@ -9,9 +9,9 @@ type UseBaseMutationResult = Overrid }> & object; ``` -Defined in: [react-query/src/types.ts:471](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L471) +Defined in: [packages/react-query/src/types.ts:471](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L471) -The result of `useMutation`. Same as MutationObserverResult from `@tanstack/query-core`, with +The result of `useMutation`. Same as [MutationObserverResult](MutationObserverResult.md) from `@tanstack/query-core`, with `mutate` narrowed to the fire-and-forget [UseMutateFunction](UseMutateFunction.md) signature, plus the added `mutateAsync`. ## Type Declaration @@ -34,7 +34,7 @@ The type your mutation function resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your mutation function may throw. diff --git a/docs/framework/react/reference/type-aliases/UseBaseQueryResult.md b/docs/framework/react/reference/type-aliases/UseBaseQueryResult.md index fd2e94e6bef..dc4dbd8b812 100644 --- a/docs/framework/react/reference/type-aliases/UseBaseQueryResult.md +++ b/docs/framework/react/reference/type-aliases/UseBaseQueryResult.md @@ -7,10 +7,10 @@ title: UseBaseQueryResult type UseBaseQueryResult = QueryObserverResult; ``` -Defined in: [react-query/src/types.ts:314](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L314) +Defined in: [packages/react-query/src/types.ts:314](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L314) The result of `useQuery` when `initialData` isn't set — `data` may be `undefined` while the query is -`pending`. Re-exports QueryObserverResult from `@tanstack/query-core`. `useInfiniteQuery` returns +`pending`. Re-exports [QueryObserverResult](QueryObserverResult.md) from `@tanstack/query-core`. `useInfiniteQuery` returns [UseInfiniteQueryResult](UseInfiniteQueryResult.md) instead. ## Type Parameters @@ -23,6 +23,6 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. diff --git a/docs/framework/react/reference/type-aliases/UseInfiniteQueryResult.md b/docs/framework/react/reference/type-aliases/UseInfiniteQueryResult.md index 019bf84cd3c..53e06124b7b 100644 --- a/docs/framework/react/reference/type-aliases/UseInfiniteQueryResult.md +++ b/docs/framework/react/reference/type-aliases/UseInfiniteQueryResult.md @@ -7,10 +7,10 @@ title: UseInfiniteQueryResult type UseInfiniteQueryResult = InfiniteQueryObserverResult; ``` -Defined in: [react-query/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L365) +Defined in: [packages/react-query/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L365) The result of `useInfiniteQuery` when `initialData` isn't set — `data` may be `undefined` while the query is -`pending`. Re-exports InfiniteQueryObserverResult from `@tanstack/query-core`. +`pending`. Re-exports [InfiniteQueryObserverResult](InfiniteQueryObserverResult.md) from `@tanstack/query-core`. ## Type Parameters @@ -22,6 +22,6 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. diff --git a/docs/framework/react/reference/type-aliases/UseMutateAsyncFunction.md b/docs/framework/react/reference/type-aliases/UseMutateAsyncFunction.md index b190e9e9c5d..3cedcd5ea1f 100644 --- a/docs/framework/react/reference/type-aliases/UseMutateAsyncFunction.md +++ b/docs/framework/react/reference/type-aliases/UseMutateAsyncFunction.md @@ -7,7 +7,7 @@ title: UseMutateAsyncFunction type UseMutateAsyncFunction = MutateFunction; ``` -Defined in: [react-query/src/types.ts:454](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L454) +Defined in: [packages/react-query/src/types.ts:454](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L454) The type of `mutateAsync`, as returned by `useMutation`. Similar to [UseMutateFunction](UseMutateFunction.md), but returns a promise which can be awaited. @@ -22,7 +22,7 @@ The type your mutation function resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your mutation function may throw. diff --git a/docs/framework/react/reference/type-aliases/UseMutateFunction.md b/docs/framework/react/reference/type-aliases/UseMutateFunction.md index 09312afba8f..ede87618a20 100644 --- a/docs/framework/react/reference/type-aliases/UseMutateFunction.md +++ b/docs/framework/react/reference/type-aliases/UseMutateFunction.md @@ -7,7 +7,7 @@ title: UseMutateFunction type UseMutateFunction = (...args) => void; ``` -Defined in: [react-query/src/types.ts:433](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L433) +Defined in: [packages/react-query/src/types.ts:433](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L433) The type of `mutate`, as returned by `useMutation`. Forwards the variables (and an optional per-call `onSuccess`/`onError`/`onSettled`) to the underlying `mutate` call. Fire-and-forget — errors are surfaced @@ -23,7 +23,7 @@ The type your mutation function resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your mutation function may throw. @@ -44,7 +44,7 @@ their `onMutateResult` parameter — useful for optimistic-update rollback data. ### args -...`Parameters`\<`MutateFunction`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> +...`Parameters`\<[`MutateFunction`](MutateFunction.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> ## Returns diff --git a/docs/framework/react/reference/type-aliases/UseMutationResult.md b/docs/framework/react/reference/type-aliases/UseMutationResult.md index 6fcc1df853b..5eed68d0161 100644 --- a/docs/framework/react/reference/type-aliases/UseMutationResult.md +++ b/docs/framework/react/reference/type-aliases/UseMutationResult.md @@ -7,7 +7,7 @@ title: UseMutationResult type UseMutationResult = UseBaseMutationResult; ``` -Defined in: [react-query/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L500) +Defined in: [packages/react-query/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L500) The result of `useMutation`. Same as [UseBaseMutationResult](UseBaseMutationResult.md). @@ -21,7 +21,7 @@ The type your mutation function resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your mutation function may throw. diff --git a/docs/framework/react/reference/type-aliases/UsePrefetchInfiniteQueryOptions.md b/docs/framework/react/reference/type-aliases/UsePrefetchInfiniteQueryOptions.md index f2dc79b0825..cddee068a8d 100644 --- a/docs/framework/react/reference/type-aliases/UsePrefetchInfiniteQueryOptions.md +++ b/docs/framework/react/reference/type-aliases/UsePrefetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: UsePrefetchInfiniteQueryOptions type UsePrefetchInfiniteQueryOptions = DistributiveOmit, "queryFn"> & object; ``` -Defined in: [react-query/src/types.ts:118](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L118) +Defined in: [packages/react-query/src/types.ts:118](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L118) The options accepted by `usePrefetchInfiniteQuery` — everything you can pass to `queryClient.infiniteQuery`, except `queryFn` is required unless a default query function has been defined. @@ -33,13 +33,13 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs. Defaults to `InfiniteData`, the shape of all fetched pages plus their page params — a prefetch never reads `data` back out, so this @@ -47,7 +47,7 @@ parameter only matters if you reuse these options elsewhere with `select` applie ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/react/reference/type-aliases/UsePrefetchQueryOptions.md b/docs/framework/react/reference/type-aliases/UsePrefetchQueryOptions.md index 2e8ce8ab558..ccf272bb395 100644 --- a/docs/framework/react/reference/type-aliases/UsePrefetchQueryOptions.md +++ b/docs/framework/react/reference/type-aliases/UsePrefetchQueryOptions.md @@ -7,7 +7,7 @@ title: UsePrefetchQueryOptions type UsePrefetchQueryOptions = DistributiveOmit, "queryFn"> & object; ``` -Defined in: [react-query/src/types.ts:80](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L80) +Defined in: [packages/react-query/src/types.ts:80](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L80) The options accepted by `usePrefetchQuery` — everything you can pass to `queryClient.query`, except `queryFn` is required unless a default query function has been defined. @@ -33,7 +33,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -53,6 +53,6 @@ The type of the data actually held in the query cache — the input to `select` ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/react/reference/type-aliases/UseQueryResult.md b/docs/framework/react/reference/type-aliases/UseQueryResult.md index b64fffaf328..c557f59e842 100644 --- a/docs/framework/react/reference/type-aliases/UseQueryResult.md +++ b/docs/framework/react/reference/type-aliases/UseQueryResult.md @@ -7,7 +7,7 @@ title: UseQueryResult type UseQueryResult = UseBaseQueryResult; ``` -Defined in: [react-query/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L325) +Defined in: [packages/react-query/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L325) The result of `useQuery`. Same as [UseBaseQueryResult](UseBaseQueryResult.md). @@ -21,6 +21,6 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. diff --git a/docs/framework/react/reference/type-aliases/UseSuspenseInfiniteQueryResult.md b/docs/framework/react/reference/type-aliases/UseSuspenseInfiniteQueryResult.md index d44b2182610..eda0d8b290e 100644 --- a/docs/framework/react/reference/type-aliases/UseSuspenseInfiniteQueryResult.md +++ b/docs/framework/react/reference/type-aliases/UseSuspenseInfiniteQueryResult.md @@ -7,7 +7,7 @@ title: UseSuspenseInfiniteQueryResult type UseSuspenseInfiniteQueryResult = OmitKeyof, "isPlaceholderData">; ``` -Defined in: [react-query/src/types.ts:389](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L389) +Defined in: [packages/react-query/src/types.ts:389](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L389) The result of `useSuspenseInfiniteQuery`. Same as [DefinedUseInfiniteQueryResult](DefinedUseInfiniteQueryResult.md), minus `isPlaceholderData` — Suspense hooks never render placeholder data. @@ -22,6 +22,6 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. diff --git a/docs/framework/react/reference/type-aliases/UseSuspenseQueryResult.md b/docs/framework/react/reference/type-aliases/UseSuspenseQueryResult.md index fde2040cab7..d3e04a8a059 100644 --- a/docs/framework/react/reference/type-aliases/UseSuspenseQueryResult.md +++ b/docs/framework/react/reference/type-aliases/UseSuspenseQueryResult.md @@ -7,7 +7,7 @@ title: UseSuspenseQueryResult type UseSuspenseQueryResult = DistributiveOmit, "isPlaceholderData">; ``` -Defined in: [react-query/src/types.ts:337](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L337) +Defined in: [packages/react-query/src/types.ts:337](https://github.com/TanStack/query/blob/main/packages/react-query/src/types.ts#L337) The result of `useSuspenseQuery`. Same as [DefinedUseQueryResult](DefinedUseQueryResult.md), minus `isPlaceholderData` — always `false` on that type, so this drops the dead field rather than an active state. @@ -22,6 +22,6 @@ The type `data` ends up as after `select` runs. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. diff --git a/docs/framework/react/reference/type-aliases/WithRequired.md b/docs/framework/react/reference/type-aliases/WithRequired.md new file mode 100644 index 00000000000..c8ef831db3c --- /dev/null +++ b/docs/framework/react/reference/type-aliases/WithRequired.md @@ -0,0 +1,20 @@ +--- +id: WithRequired +title: WithRequired +--- + +```ts +type WithRequired = TTarget & { [_ in TKey]: {} }; +``` + +Defined in: [packages/query-core/src/types.ts:505](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L505) + +## Type Parameters + +### TTarget + +`TTarget` + +### TKey + +`TKey` *extends* keyof `TTarget` diff --git a/docs/framework/react/reference/type-aliases/dataTagErrorSymbol.md b/docs/framework/react/reference/type-aliases/dataTagErrorSymbol.md new file mode 100644 index 00000000000..26148a94d6e --- /dev/null +++ b/docs/framework/react/reference/type-aliases/dataTagErrorSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagErrorSymbol +title: dataTagErrorSymbol +--- + +```ts +type dataTagErrorSymbol = typeof dataTagErrorSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:63](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L63) diff --git a/docs/framework/react/reference/type-aliases/dataTagSymbol.md b/docs/framework/react/reference/type-aliases/dataTagSymbol.md new file mode 100644 index 00000000000..0012c108cc5 --- /dev/null +++ b/docs/framework/react/reference/type-aliases/dataTagSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagSymbol +title: dataTagSymbol +--- + +```ts +type dataTagSymbol = typeof dataTagSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L61) diff --git a/docs/framework/react/reference/variables/IsRestoringProvider.md b/docs/framework/react/reference/variables/IsRestoringProvider.md index e320fdaefe0..e639f1db7c2 100644 --- a/docs/framework/react/reference/variables/IsRestoringProvider.md +++ b/docs/framework/react/reference/variables/IsRestoringProvider.md @@ -7,7 +7,7 @@ title: IsRestoringProvider const IsRestoringProvider: Provider = IsRestoringContext.Provider; ``` -Defined in: [react-query/src/IsRestoringProvider.ts:19](https://github.com/TanStack/query/blob/main/packages/react-query/src/IsRestoringProvider.ts#L19) +Defined in: [packages/react-query/src/IsRestoringProvider.ts:19](https://github.com/TanStack/query/blob/main/packages/react-query/src/IsRestoringProvider.ts#L19) The Provider that `PersistQueryClientProvider` uses to signal whether a persisted client is currently being restored, read by `useIsRestoring`. diff --git a/docs/framework/react/reference/variables/QueryClientContext.md b/docs/framework/react/reference/variables/QueryClientContext.md index 20619cd18df..96c30a4f250 100644 --- a/docs/framework/react/reference/variables/QueryClientContext.md +++ b/docs/framework/react/reference/variables/QueryClientContext.md @@ -7,6 +7,6 @@ title: QueryClientContext const QueryClientContext: Context; ``` -Defined in: [react-query/src/QueryClientProvider.tsx:9](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryClientProvider.tsx#L9) +Defined in: [packages/react-query/src/QueryClientProvider.tsx:9](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryClientProvider.tsx#L9) The context that `useQueryClient` reads from. `QueryClientProvider` is the normal way to set it. diff --git a/docs/framework/react/reference/variables/dataTagErrorSymbol.md b/docs/framework/react/reference/variables/dataTagErrorSymbol.md new file mode 100644 index 00000000000..20bab62fb01 --- /dev/null +++ b/docs/framework/react/reference/variables/dataTagErrorSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagErrorSymbol +title: dataTagErrorSymbol +--- + +```ts +const dataTagErrorSymbol: typeof dataTagErrorSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:63](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L63) diff --git a/docs/framework/react/reference/variables/dataTagSymbol.md b/docs/framework/react/reference/variables/dataTagSymbol.md new file mode 100644 index 00000000000..83dd68a56e9 --- /dev/null +++ b/docs/framework/react/reference/variables/dataTagSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagSymbol +title: dataTagSymbol +--- + +```ts +const dataTagSymbol: typeof dataTagSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L61) diff --git a/docs/framework/react/reference/variables/defaultScheduler.md b/docs/framework/react/reference/variables/defaultScheduler.md new file mode 100644 index 00000000000..70e14d3f846 --- /dev/null +++ b/docs/framework/react/reference/variables/defaultScheduler.md @@ -0,0 +1,13 @@ +--- +id: defaultScheduler +title: defaultScheduler +--- + +```ts +const defaultScheduler: ScheduleFunction = systemSetTimeoutZero; +``` + +Defined in: [packages/query-core/src/notifyManager.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L19) + +Default scheduling function used by the notify manager. +Schedules the callback with the system's `setTimeout(callback, 0)`. diff --git a/docs/framework/react/reference/variables/environmentManager.md b/docs/framework/react/reference/variables/environmentManager.md new file mode 100644 index 00000000000..caa1d70b2b6 --- /dev/null +++ b/docs/framework/react/reference/variables/environmentManager.md @@ -0,0 +1,44 @@ +--- +id: environmentManager +title: environmentManager +--- + +```ts +const environmentManager: object; +``` + +Defined in: [packages/query-core/src/environmentManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L15) + +Manages environment detection used by TanStack Query internals. + +## Type Declaration + +### isServer() + +```ts +isServer: () => boolean; +``` + +Returns whether the current runtime should be treated as a server environment. + +#### Returns + +`boolean` + +### setIsServer() + +```ts +setIsServer(isServerValue): void; +``` + +Overrides the server check globally. + +#### Parameters + +##### isServerValue + +`IsServerValue` + +#### Returns + +`void` diff --git a/docs/framework/react/reference/variables/focusManager.md b/docs/framework/react/reference/variables/focusManager.md new file mode 100644 index 00000000000..cbf7fcb4a17 --- /dev/null +++ b/docs/framework/react/reference/variables/focusManager.md @@ -0,0 +1,12 @@ +--- +id: focusManager +title: focusManager +--- + +```ts +const focusManager: FocusManager; +``` + +Defined in: [packages/query-core/src/focusManager.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L142) + +Singleton instance of FocusManager, used to manage and observe the focus state within TanStack Query. diff --git a/docs/framework/react/reference/variables/isServer.md b/docs/framework/react/reference/variables/isServer.md new file mode 100644 index 00000000000..28956d55cbf --- /dev/null +++ b/docs/framework/react/reference/variables/isServer.md @@ -0,0 +1,14 @@ +--- +id: isServer +title: isServer +--- + +```ts +const isServer: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L112) + +## Deprecated + +use `environmentManager.isServer()` instead. diff --git a/docs/framework/react/reference/variables/notifyManager.md b/docs/framework/react/reference/variables/notifyManager.md new file mode 100644 index 00000000000..e5ecca8df60 --- /dev/null +++ b/docs/framework/react/reference/variables/notifyManager.md @@ -0,0 +1,156 @@ +--- +id: notifyManager +title: notifyManager +--- + +```ts +const notifyManager: object; +``` + +Defined in: [packages/query-core/src/notifyManager.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L135) + +Handles scheduling and batching callbacks in TanStack Query. + +## Type Declaration + +### batch() + +```ts +readonly batch: (callback) => T; +``` + +Batches all updates scheduled inside the passed callback. +This is mainly used internally to optimize query client updating. +Batches can be nested; the queue is only flushed once the outermost `batch` call finishes. +The return value of `callback` is passed through. + +#### Type Parameters + +##### T + +`T` + +#### Parameters + +##### callback + +() => `T` + +#### Returns + +`T` + +### batchCalls() + +```ts +readonly batchCalls: (callback) => BatchCallsCallback; +``` + +All calls to the wrapped function will be batched. + +#### Type Parameters + +##### T + +`T` *extends* `unknown`[] + +#### Parameters + +##### callback + +`BatchCallsCallback`\<`T`\> + +#### Returns + +`BatchCallsCallback`\<`T`\> + +### schedule() + +```ts +schedule: (callback) => void; +``` + +Schedules a function to be run on the next batch. +By default, the batch is run with a `setTimeout`, but this can be configured via `setScheduler`. + +#### Parameters + +##### callback + +`NotifyCallback` + +#### Returns + +`void` + +### setBatchNotifyFunction() + +```ts +readonly setBatchNotifyFunction: (fn) => void; +``` + +Use this method to set a custom function to batch notifications together into a single tick. +By default React Query will use the batch function provided by ReactDOM or React Native. + +#### Parameters + +##### fn + +`BatchNotifyFunction` + +#### Returns + +`void` + +### setNotifyFunction() + +```ts +readonly setNotifyFunction: (fn) => void; +``` + +Use this method to set a custom notify function. +This can be used to for example wrap notifications with `React.act` while running tests. + +#### Parameters + +##### fn + +`NotifyFunction` + +#### Returns + +`void` + +### setScheduler() + +```ts +readonly setScheduler: (fn) => void; +``` + +Configures a custom callback that schedules when the next batch runs. +The default behavior is `setTimeout(callback, 0)`. + +#### Parameters + +##### fn + +`ScheduleFunction` + +#### Returns + +`void` + +#### Example + +```ts +import { notifyManager } from '@tanstack/query-core' + +// Schedule batches in the next microtask +notifyManager.setScheduler(queueMicrotask) + +// Schedule batches before the next frame is rendered +notifyManager.setScheduler(requestAnimationFrame) + +// Schedule batches some time in the future +notifyManager.setScheduler((cb) => setTimeout(cb, 10)) +``` diff --git a/docs/framework/react/reference/variables/onlineManager.md b/docs/framework/react/reference/variables/onlineManager.md new file mode 100644 index 00000000000..4ae083f245b --- /dev/null +++ b/docs/framework/react/reference/variables/onlineManager.md @@ -0,0 +1,12 @@ +--- +id: onlineManager +title: onlineManager +--- + +```ts +const onlineManager: OnlineManager; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L117) + +Singleton instance of OnlineManager, used to manage and observe the online state within TanStack Query. diff --git a/docs/framework/react/reference/variables/skipToken.md b/docs/framework/react/reference/variables/skipToken.md new file mode 100644 index 00000000000..3163e91c1c2 --- /dev/null +++ b/docs/framework/react/reference/variables/skipToken.md @@ -0,0 +1,23 @@ +--- +id: skipToken +title: skipToken +--- + +```ts +const skipToken: typeof skipToken; +``` + +Defined in: [packages/query-core/src/utils.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L520) + +Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent +to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`, +a query disabled via `skipToken` cannot be triggered with `refetch`. + +## Example + +```ts +new QueryObserver(queryClient, { + queryKey: ['post', postId], + queryFn: postId != null ? () => fetchPost(postId) : skipToken, +}) +``` diff --git a/docs/framework/react/reference/variables/timeoutManager.md b/docs/framework/react/reference/variables/timeoutManager.md new file mode 100644 index 00000000000..2dcfa29b55a --- /dev/null +++ b/docs/framework/react/reference/variables/timeoutManager.md @@ -0,0 +1,12 @@ +--- +id: timeoutManager +title: timeoutManager +--- + +```ts +const timeoutManager: TimeoutManager; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:226](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L226) + +Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/react/reference/variables/unsetMarker.md b/docs/framework/react/reference/variables/unsetMarker.md new file mode 100644 index 00000000000..d19ee65b38e --- /dev/null +++ b/docs/framework/react/reference/variables/unsetMarker.md @@ -0,0 +1,10 @@ +--- +id: unsetMarker +title: unsetMarker +--- + +```ts +const unsetMarker: typeof unsetMarker; +``` + +Defined in: [packages/query-core/src/types.ts:65](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L65) diff --git a/docs/framework/solid/reference/classes/CancelledError.md b/docs/framework/solid/reference/classes/CancelledError.md new file mode 100644 index 00000000000..7fded5da20f --- /dev/null +++ b/docs/framework/solid/reference/classes/CancelledError.md @@ -0,0 +1,273 @@ +--- +id: CancelledError +title: CancelledError +--- + +Defined in: [packages/query-core/src/retryer.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L77) + +The error thrown by a `Retryer` (and surfaced to `query.promise`/`mutation`) when a fetch is cancelled, e.g. via +`query.cancel()`. `revert`, if `true`, tells the caller to restore the state the query was in before the fetch +started instead of surfacing the error. `silent`, if `true`, tells the caller to suppress this error and instead +resolve with the promise of the fetch that triggered the cancellation. + +## Example + +```ts +query.cancel() + +try { + await query.promise +} catch (error) { + if (error instanceof CancelledError) { + // the fetch was cancelled, e.g. via `query.cancel()` + } +} +``` + +## Extends + +- `Error` + +## Constructors + +### Constructor + +```ts +new CancelledError(options?): CancelledError; +``` + +Defined in: [packages/query-core/src/retryer.ts:80](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L80) + +#### Parameters + +##### options? + +[`CancelOptions`](../interfaces/CancelOptions.md) + +#### Returns + +`CancelledError` + +#### Overrides + +```ts +Error.constructor +``` + +## Properties + +### cause? + +```ts +optional cause: unknown; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24 + +#### Inherited from + +```ts +Error.cause +``` + +*** + +### message + +```ts +message: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 + +#### Inherited from + +```ts +Error.message +``` + +*** + +### name + +```ts +name: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 + +#### Inherited from + +```ts +Error.name +``` + +*** + +### revert? + +```ts +optional revert: boolean; +``` + +Defined in: [packages/query-core/src/retryer.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L78) + +*** + +### silent? + +```ts +optional silent: boolean; +``` + +Defined in: [packages/query-core/src/retryer.ts:79](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L79) + +*** + +### stack? + +```ts +optional stack: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 + +#### Inherited from + +```ts +Error.stack +``` + +*** + +### stackTraceLimit + +```ts +static stackTraceLimit: number; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:68 + +The `Error.stackTraceLimit` property specifies the number of stack frames +collected by a stack trace (whether generated by `new Error().stack` or +`Error.captureStackTrace(obj)`). + +The default value is `10` but may be set to any valid JavaScript number. Changes +will affect any stack trace captured _after_ the value has been changed. + +If set to a non-number value, or set to a negative number, stack traces will +not capture any frames. + +#### Inherited from + +```ts +Error.stackTraceLimit +``` + +## Methods + +### captureStackTrace() + +```ts +static captureStackTrace(targetObject, constructorOpt?): void; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:52 + +Creates a `.stack` property on `targetObject`, which when accessed returns +a string representing the location in the code at which +`Error.captureStackTrace()` was called. + +```js +const myObject = {}; +Error.captureStackTrace(myObject); +myObject.stack; // Similar to `new Error().stack` +``` + +The first line of the trace will be prefixed with +`${myObject.name}: ${myObject.message}`. + +The optional `constructorOpt` argument accepts a function. If given, all frames +above `constructorOpt`, including `constructorOpt`, will be omitted from the +generated stack trace. + +The `constructorOpt` argument is useful for hiding implementation +details of error generation from the user. For instance: + +```js +function a() { + b(); +} + +function b() { + c(); +} + +function c() { + // Create an error without stack trace to avoid calculating the stack trace twice. + const { stackTraceLimit } = Error; + Error.stackTraceLimit = 0; + const error = new Error(); + Error.stackTraceLimit = stackTraceLimit; + + // Capture the stack trace above function b + Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace + throw error; +} + +a(); +``` + +#### Parameters + +##### targetObject + +`object` + +##### constructorOpt? + +`Function` + +#### Returns + +`void` + +#### Inherited from + +```ts +Error.captureStackTrace +``` + +*** + +### prepareStackTrace() + +```ts +static prepareStackTrace(err, stackTraces): any; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:56 + +#### Parameters + +##### err + +`Error` + +##### stackTraces + +`CallSite`[] + +#### Returns + +`any` + +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +```ts +Error.prepareStackTrace +``` diff --git a/docs/framework/solid/reference/classes/InfiniteQueryObserver.md b/docs/framework/solid/reference/classes/InfiniteQueryObserver.md new file mode 100644 index 00000000000..ddcdefbc07f --- /dev/null +++ b/docs/framework/solid/reference/classes/InfiniteQueryObserver.md @@ -0,0 +1,665 @@ +--- +id: InfiniteQueryObserver +title: InfiniteQueryObserver +--- + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L41) + +An `InfiniteQueryObserver` extends `QueryObserver` to observe and switch +between infinite queries. It augments the base `QueryObserverResult` with +infinite-query-specific fields and methods, such as `hasNextPage` and +`fetchNextPage`, and is the primitive that framework adapters (e.g. +`useInfiniteQuery`) build their hooks on top of. + +## Example + +```ts +const observer = new InfiniteQueryObserver(queryClient, { + queryKey: ['projects'], + queryFn: ({ pageParam }) => fetchProjects(pageParam), + initialPageParam: 0, + getNextPageParam: (lastPage) => lastPage.nextCursor, +}) + +const unsubscribe = observer.subscribe((result) => console.log(result)) +``` + +## Extends + +- [`QueryObserver`](QueryObserver.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Constructors + +### Constructor + +```ts +new InfiniteQueryObserver(client, options): InfiniteQueryObserver; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L83) + +#### Parameters + +##### client + +`QueryClient` + +##### options + +`InfiniteQueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`InfiniteQueryObserver`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`constructor`](QueryObserver.md#constructor) + +## Properties + +### fetch + +```ts +protected fetch: ReplaceReturnType<(fetchOptions) => Promise>, Promise>>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:72](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L72) + +#### Overrides + +```ts +QueryObserver.fetch +``` + +*** + +### getCurrentResult + +```ts +getCurrentResult: ReplaceReturnType<() => QueryObserverResult, InfiniteQueryObserverResult>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L60) + +Returns the most recently computed `QueryObserverResult` for the +observed query. This is a point-in-time read; to be notified of updates +as they happen, subscribe to the observer instead (its inherited +`subscribe` method). + +#### Example + +```ts +const result = observer.getCurrentResult() +console.log(result.status, result.data) +``` + +#### Overrides + +```ts +QueryObserver.getCurrentResult +``` + +*** + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`listeners`](QueryObserver.md#listeners) + +*** + +### options + +```ts +options: QueryObserverOptions, TQueryKey>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L89) + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`options`](QueryObserver.md#options) + +*** + +### subscribe() + +```ts +subscribe: (listener) => () => void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L55) + +#### Parameters + +##### listener + +`InfiniteQueryObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Overrides + +```ts +QueryObserver.subscribe +``` + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L96) + +#### Returns + +`void` + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`bindMethods`](QueryObserver.md#bindmethods) + +*** + +### createResult() + +```ts +protected createResult(query, options): InfiniteQueryObserverResult; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:201](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L201) + +#### Parameters + +##### query + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +##### options + +`InfiniteQueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`createResult`](QueryObserver.md#createresult) + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L161) + +Stops observing the current query: clears all listeners, cancels the +stale and refetch-interval timers, and removes this observer from the +query it was observing. + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`destroy`](QueryObserver.md#destroy) + +*** + +### fetchNextPage() + +```ts +fetchNextPage(options?): Promise>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L161) + +Fetches the next page of the infinite query and returns a promise that +resolves with the resulting `InfiniteQueryObserverResult`. The page +param used for the fetch is determined by `getNextPageParam`, which +receives the current pages/page params and whose result also determines +`hasNextPage`. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](../interfaces/FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const { hasNextPage } = observer.getCurrentResult() + +if (hasNextPage) { + await observer.fetchNextPage() +} +``` + +#### See + +[InfiniteQueryObserver#fetchPreviousPage](#fetchpreviouspage) + +*** + +### fetchOptimistic() + +```ts +fetchOptimistic(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:395](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L395) + +Fetches a query defined by the given options without affecting this +observer's own tracked query or result, and returns a promise that +resolves with the `QueryObserverResult` for that fetch. This is useful +for prefetching data that another observer (e.g. a query about to be +navigated to) will need, ahead of time. + +#### Parameters + +##### options + +`QueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.fetchOptimistic({ + queryKey: ['posts', 2], + queryFn: () => fetchPost(2), +}) +console.log(result.data) +``` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`fetchOptimistic`](QueryObserver.md#fetchoptimistic) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage(options?): Promise>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:190](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L190) + +Fetches the previous page of the infinite query and returns a promise +that resolves with the resulting `InfiniteQueryObserverResult`. The page +param used for the fetch is determined by `getPreviousPageParam`, which +receives the current pages/page params and whose result also determines +`hasPreviousPage`. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](../interfaces/FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const { hasPreviousPage } = observer.getCurrentResult() + +if (hasPreviousPage) { + await observer.fetchPreviousPage() +} +``` + +#### See + +[InfiniteQueryObserver#fetchNextPage](#fetchnextpage) + +*** + +### getCurrentQuery() + +```ts +getCurrentQuery(): Query, TQueryKey>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:357](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L357) + +Returns the `Query` instance this observer is currently observing. + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`getCurrentQuery`](QueryObserver.md#getcurrentquery) + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(options): InfiniteQueryObserverResult; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L127) + +The infinite-query counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult), marking the +options as an infinite query before delegating to it. Called by framework adapters (e.g. +`useInfiniteQuery`) ahead of subscribing, to compute the current `InfiniteQueryObserverResult` +synchronously. + +#### Parameters + +##### options + +[`DefaultedInfiniteQueryObserverOptions`](../type-aliases/DefaultedInfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`getOptimisticResult`](QueryObserver.md#getoptimisticresult) + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`hasListeners`](QueryObserver.md#haslisteners) + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L110) + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`onSubscribe`](QueryObserver.md#onsubscribe) + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L124) + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`onUnsubscribe`](QueryObserver.md#onunsubscribe) + +*** + +### refetch() + +```ts +refetch(__namedParameters): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L371) + +Refetches the observed query and returns a promise that resolves with +the resulting `QueryObserverResult`. + +#### Parameters + +##### \_\_namedParameters + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.refetch({ cancelRefetch: false }) +console.log(result.data) +``` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`refetch`](QueryObserver.md#refetch) + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:108](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L108) + +Updates the observer's options. Behaves the same as +`QueryObserver.setOptions`, additionally marking the options as +belonging to an infinite query before delegating to the base +implementation. + +#### Parameters + +##### options + +`InfiniteQueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`void` + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`setOptions`](QueryObserver.md#setoptions) + +*** + +### shouldFetchOnReconnect() + +```ts +shouldFetchOnReconnect(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L135) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnReconnect` option) to refetch when the network +reconnects. + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`shouldFetchOnReconnect`](QueryObserver.md#shouldfetchonreconnect) + +*** + +### shouldFetchOnWindowFocus() + +```ts +shouldFetchOnWindowFocus(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L148) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnWindowFocus` option) to refetch when the window +regains focus. + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`shouldFetchOnWindowFocus`](QueryObserver.md#shouldfetchonwindowfocus) + +*** + +### trackProp() + +```ts +trackProp(key): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:350](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L350) + +Records that the given `QueryObserverResult` property was read, so a subsequent update only +notifies this observer if a tracked property actually changed. Normally called indirectly via +[QueryObserver#trackResult](QueryObserver.md#trackresult)'s proxy; exposed directly for adapters that track property +access themselves (e.g. through their own reactivity system) instead of via the proxy. + +#### Parameters + +##### key + +`"error"` | `"data"` | `"isError"` | `"isPending"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isSuccess"` | `"isPlaceholderData"` | `"status"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`trackProp`](QueryObserver.md#trackprop) + +*** + +### trackResult() + +```ts +trackResult(result, onPropTracked?): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:331](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L331) + +Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via +[QueryObserver#trackProp](QueryObserver.md#trackprop) (and an optional `onPropTracked` callback). Used by framework +adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on +properties you actually read" behavior. + +#### Parameters + +##### result + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +##### onPropTracked? + +(`key`) => `void` + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`trackResult`](QueryObserver.md#trackresult) + +*** + +### updateResult() + +```ts +updateResult(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L735) + +Recomputes and stores the current result from the current query/options, notifying listeners +if it changed. Framework adapters call this right after subscribing to make sure no query +update was missed in the gap between creating the observer and subscribing to it. + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`updateResult`](QueryObserver.md#updateresult) diff --git a/docs/framework/solid/reference/classes/Mutation.md b/docs/framework/solid/reference/classes/Mutation.md new file mode 100644 index 00000000000..4e85a5b2d4c --- /dev/null +++ b/docs/framework/solid/reference/classes/Mutation.md @@ -0,0 +1,329 @@ +--- +id: Mutation +title: Mutation +--- + +Defined in: [packages/query-core/src/mutation.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L135) + +Represents a single mutation attempt. A `Mutation` holds the mutation's +options, state (data/error/status), and the `MutationObserver`s currently +subscribed to it. + +Instances are created and managed internally by `MutationCache`; application +code typically interacts with mutations indirectly through `QueryClient` or +a framework hook like `useMutation`. Direct access to a `Mutation` instance +is possible via `mutationCache.find()`/`getAll()` for inspecting cache state. + +## Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +``` + +## Extends + +- `Removable` + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Constructors + +### Constructor + +```ts +new Mutation(config): Mutation; +``` + +Defined in: [packages/query-core/src/mutation.ts:152](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L152) + +#### Parameters + +##### config + +`MutationConfig`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`Mutation`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Overrides + +```ts +Removable.constructor +``` + +## Properties + +### gcTime + +```ts +gcTime: number; +``` + +Defined in: [packages/query-core/src/removable.ts:7](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L7) + +#### Inherited from + +```ts +Removable.gcTime +``` + +*** + +### mutationId + +```ts +readonly mutationId: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:143](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L143) + +*** + +### options + +```ts +options: MutationOptions; +``` + +Defined in: [packages/query-core/src/mutation.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L142) + +*** + +### state + +```ts +state: MutationState; +``` + +Defined in: [packages/query-core/src/mutation.ts:141](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L141) + +## Accessors + +### meta + +#### Get Signature + +```ts +get meta(): Record | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:179](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L179) + +The `meta` object passed in the mutation's options, if any. + +##### Returns + +`Record`\<`string`, `unknown`\> \| `undefined` + +## Methods + +### clearGcTimeout() + +```ts +protected clearGcTimeout(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L32) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.clearGcTimeout +``` + +*** + +### continue() + +```ts +continue(): Promise; +``` + +Defined in: [packages/query-core/src/mutation.ts:243](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L243) + +Resumes a mutation that is currently paused or was restored from a +dehydrated, still-`pending` state. + +- If this mutation has an active retryer (it paused mid-attempt, e.g. due + to the network mode or scope-based queuing), its retryer is resumed. +- Otherwise, if the mutation's status is still `pending` (e.g. it was + dehydrated while an attempt was in flight and never got a retryer in + this instance), `execute` is called again with the last known variables. +- Otherwise the mutation has already settled and this resolves immediately + without running anything again. + +#### Returns + +`Promise`\<`unknown`\> + +#### Example + +```ts +// typically driven by reconnect handling, e.g. queryClient.resumePausedMutations() +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +await mutation?.continue() +``` + +#### See + +[Mutation#execute](#execute) + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:10](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L10) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.destroy +``` + +*** + +### execute() + +```ts +execute(variables): Promise; +``` + +Defined in: [packages/query-core/src/mutation.ts:283](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L283) + +Runs the mutation function for the given variables through a retryer, and +drives the mutation's state and lifecycle callbacks through to settlement. + +If this mutation's state is already `pending` when `execute` is called +(i.e. it was restored, still in-flight, from a dehydrated state), the +`onMutate` step is skipped and a `continue` action is dispatched to +unpause it; otherwise a `pending` action is dispatched first, then the +mutation cache's `onMutate` and the mutation's own `onMutate` option are +awaited in that order, and the resulting context is stored. + +The mutation function is then run (subject to `retry`/`retryDelay`/ +`networkMode`, and to the mutation cache's scope-based serialization). +On success, the cache's `onSuccess`/`onSettled` callbacks run before the +mutation's own `onSuccess`/`onSettled` options, a `success` action is +dispatched, and the resolved data is returned. On failure, the same +cache-then-option ordering is used for `onError`/`onSettled`, but each of +those four callbacks is individually caught so that a throwing callback +cannot mask the original error; an `error` action is then dispatched and +the original error is re-thrown. + +#### Parameters + +##### variables + +`TVariables` + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +// typically invoked by MutationObserver.mutate, not called directly +const data = await mutation.execute(variables) +``` + +#### See + +[Mutation#continue](#continue) + +*** + +### optionalRemove() + +```ts +protected optionalRemove(): void; +``` + +Defined in: [packages/query-core/src/mutation.ts:212](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L212) + +#### Returns + +`void` + +#### Overrides + +```ts +Removable.optionalRemove +``` + +*** + +### scheduleGc() + +```ts +protected scheduleGc(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L14) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.scheduleGc +``` + +*** + +### updateGcTime() + +```ts +protected updateGcTime(newGcTime): void; +``` + +Defined in: [packages/query-core/src/removable.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L24) + +#### Parameters + +##### newGcTime + +`number` | `undefined` + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.updateGcTime +``` diff --git a/docs/framework/solid/reference/classes/MutationCache.md b/docs/framework/solid/reference/classes/MutationCache.md new file mode 100644 index 00000000000..f79919b1c4b --- /dev/null +++ b/docs/framework/solid/reference/classes/MutationCache.md @@ -0,0 +1,308 @@ +--- +id: MutationCache +title: MutationCache +--- + +Defined in: [packages/query-core/src/mutationCache.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L117) + +The `MutationCache` is the storage for mutations. + +Normally, you will not interact with the `MutationCache` directly and instead use a +`QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of +safe/known updates to the cache, such as mutations being added, removed, or updated. + +## Extends + +- `Subscribable`\<`MutationCacheListener`\> + +## Constructors + +### Constructor + +```ts +new MutationCache(config): MutationCache; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) + +#### Parameters + +##### config + +[`MutationCacheConfig`](../interfaces/MutationCacheConfig.md) = `{}` + +#### Returns + +`MutationCache` + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### config + +```ts +config: MutationCacheConfig = {}; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) + +*** + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:229](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L229) + +Removes all mutations from the cache. + +#### Returns + +`void` + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +mutationCache.clear() +``` + +*** + +### find() + +```ts +find(filters): + | Mutation + | undefined; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L271) + +A slightly more advanced method that can be used to get an existing mutation instance from +the cache. If the mutation does not exist, `undefined` is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about a mutation in rare scenarios. + +#### Type Parameters + +##### TData + +`TData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TVariables + +`TVariables` = `any` + +##### TOnMutateResult + +`TOnMutateResult` = `unknown` + +#### Parameters + +##### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) + +#### Returns + + \| [`Mutation`](Mutation.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + \| `undefined` + +#### See + +[MutationCache#findAll](#findall) + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +``` + +*** + +### findAll() + +```ts +findAll(filters): Mutation[]; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:301](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L301) + +An even more advanced method that can be used to get existing mutation instances from the +cache that match the given filters. If no mutations match, an empty array is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about mutations in rare scenarios. + +#### Parameters + +##### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) = `{}` + +#### Returns + +[`Mutation`](Mutation.md)\<`unknown`, `Error`, `unknown`, `unknown`\>[] + +#### See + +[MutationCache#find](#find) + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutations = mutationCache.findAll({ mutationKey: ['addPost'] }) +``` + +*** + +### getAll() + +```ts +getAll(): Mutation[]; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:252](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L252) + +Returns all mutations within the cache. + +This is not typically needed for most applications, but can come in handy when needing more +information about a mutation in rare scenarios. + +#### Returns + +[`Mutation`](Mutation.md)\<`unknown`, `Error`, `unknown`, `unknown`\>[] + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutations = mutationCache.getAll() +``` + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L23) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L27) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`MutationCacheListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/solid/reference/classes/MutationObserver.md b/docs/framework/solid/reference/classes/MutationObserver.md new file mode 100644 index 00000000000..b6c88ef3463 --- /dev/null +++ b/docs/framework/solid/reference/classes/MutationObserver.md @@ -0,0 +1,335 @@ +--- +id: MutationObserver +title: MutationObserver +--- + +Defined in: [packages/query-core/src/mutationObserver.ts:38](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L38) + +Observes a single mutation and derives a `MutationObserverResult` from it. +A framework hook like `useMutation` creates one `MutationObserver` per hook +call, keeps it stable across re-renders, calls `setOptions` when the options +passed to the hook change, subscribes to it to re-render on updates, and +reads `getCurrentResult()` for the value to return. Calling `mutate()` +builds a new underlying `Mutation` in the `MutationCache` and executes it. + +## Example + +```ts +const observer = new MutationObserver(queryClient, { + mutationFn: (variables: { title: string }) => addPost(variables), +}) +``` + +## Extends + +- `Subscribable`\<`MutationObserverListener`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Constructors + +### Constructor + +```ts +new MutationObserver(client, options): MutationObserver; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:58](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L58) + +#### Parameters + +##### client + +`QueryClient` + +##### options + +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`MutationObserver`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Overrides + +```ts +Subscribable< + MutationObserverListener +>.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +*** + +### options + +```ts +options: MutationObserverOptions; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:46](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L46) + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L75) + +#### Returns + +`void` + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): MutationObserverResult; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:155](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L155) + +Returns the observer's current result, derived from the observed +mutation's state (or the default, `idle` state if no mutation has been +built yet, e.g. before the first `mutate()` call or after `reset()`). + +#### Returns + +[`MutationObserverResult`](../type-aliases/MutationObserverResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### mutate() + +```ts +mutate(variables, options?): Promise; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:207](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L207) + +Builds a new `Mutation` in the `MutationCache` using the observer's +current options, detaches this observer from any previously observed +mutation, attaches it to the new one, and executes it with the given +variables. + +The optional per-call `options` (`onSuccess`/`onError`/`onSettled`) are +invoked once the mutation settles, in addition to any callbacks defined +on the observer's own options. + +#### Parameters + +##### variables + +`TVariables` + +##### options? + +[`MutateOptions`](../interfaces/MutateOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +await observer.mutate( + { title: 'New post' }, + { onSuccess: (data) => console.log(data) }, +) +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L127) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L135) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### reset() + +```ts +reset(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L180) + +Detaches the observer from the mutation it is currently observing (if +any) and resets the observed result back to its default, `idle` state. + +This does not cancel an in-flight mutation; the mutation itself keeps +running to completion and its own callbacks still fire, but this +observer stops reflecting its state and a subsequent `mutate()` call +will build a brand new mutation. + +#### Returns + +`void` + +#### Example + +```ts +observer.reset() +``` + +#### See + +[MutationObserver#mutate](#mutate) + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L96) + +Updates the observer's options. + +If the new `mutationKey` differs from the previous one (and both were +defined), the observer is reset, detaching it from the mutation it was +observing. Otherwise, if the currently observed mutation is still +`pending`, its options are updated in place as well. + +#### Parameters + +##### options + +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setOptions({ + mutationFn: (variables: { title: string }) => addPost(variables), + onSuccess: (data) => console.log(data), +}) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`MutationObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/solid/reference/classes/QueriesObserver.md b/docs/framework/solid/reference/classes/QueriesObserver.md new file mode 100644 index 00000000000..6d696bfa87a --- /dev/null +++ b/docs/framework/solid/reference/classes/QueriesObserver.md @@ -0,0 +1,325 @@ +--- +id: QueriesObserver +title: QueriesObserver +--- + +Defined in: [packages/query-core/src/queriesObserver.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L54) + +A `QueriesObserver` watches an array of queries at once, exposing them as +a single array of `QueryObserverResult`s (or, when a `combine` option is +given, as a combined value derived from that array). It manages one +internal `QueryObserver` per query, and is the primitive that framework +adapters (e.g. `useQueries`) build their hooks on top of. + +## Example + +```ts +const observer = new QueriesObserver(queryClient, [ + { queryKey: ['post', 1], queryFn: fetchPost }, + { queryKey: ['post', 2], queryFn: fetchPost }, +]) + +const unsubscribe = observer.subscribe((result) => { + console.log(result) +}) +``` + +## Extends + +- `Subscribable`\<`QueriesObserverListener`\> + +## Type Parameters + +### TCombinedResult + +`TCombinedResult` = [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +## Constructors + +### Constructor + +```ts +new QueriesObserver( + client, + queries, +options?): QueriesObserver; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L68) + +#### Parameters + +##### client + +`QueryClient` + +##### queries + +`QueryObserverOptions`\<`any`, `any`, `any`, `any`, `any`, `never`\>[] + +##### options? + +[`QueriesObserverOptions`](../interfaces/QueriesObserverOptions.md)\<`TCombinedResult`\> + +#### Returns + +`QueriesObserver`\<`TCombinedResult`\> + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L104) + +Stops observing all queries: clears all listeners and destroys every +underlying `QueryObserver` this observer manages. + +#### Returns + +`void` + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): QueryObserverResult[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L208) + +Returns the most recently computed array of `QueryObserverResult`s, one +per observed query, in the same order as the queries passed to the +constructor or `setQueries`. + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +#### Example + +```ts +const results = observer.getCurrentResult() +const data = results.map((result) => result.data) +``` + +*** + +### getObservers() + +```ts +getObservers(): QueryObserver[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L225) + +Returns the underlying `QueryObserver` instances this observer manages, +in the same order as the queries passed to the constructor or +`setQueries`. + +#### Returns + +[`QueryObserver`](QueryObserver.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[]\>[] + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(queries, combine): [QueryObserverResult[], (r?) => TCombinedResult, () => QueryObserverResult[]]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L236) + +The `QueriesObserver` counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult) — computes +the result for the given (already-defaulted) queries right now, synchronously. Called by +framework adapters (e.g. `useQueries`) ahead of subscribing, returning a tuple of the raw +per-query results, a function to compute the combined result from them, and a function to +wrap the results for property-access tracking. + +#### Parameters + +##### queries + +`QueryObserverOptions`\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[], `never`\>[] + +##### combine + +`CombineFn`\<`TCombinedResult`\> | `undefined` + +#### Returns + +\[[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[], (`r?`) => `TCombinedResult`, () => [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[]\] + +*** + +### getQueries() + +```ts +getQueries(): Query[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:216](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L216) + +Returns the underlying `Query` instances currently being observed, in +the same order as the queries passed to the constructor or `setQueries`. + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L84) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L94) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setQueries() + +```ts +setQueries(queries, options?): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:125](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L125) + +Replaces the set of queries being observed. Existing `QueryObserver`s +are reused for queries that match an already-observed query hash; +observers for queries that are no longer present are destroyed, and new +observers are created and subscribed to for newly added queries. + +#### Parameters + +##### queries + +`QueryObserverOptions`\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[], `never`\>[] + +##### options? + +[`QueriesObserverOptions`](../interfaces/QueriesObserverOptions.md)\<`TCombinedResult`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setQueries([ + { queryKey: ['post', 1], queryFn: fetchPost }, + { queryKey: ['post', 3], queryFn: fetchPost }, +]) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueriesObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/solid/reference/classes/Query.md b/docs/framework/solid/reference/classes/Query.md new file mode 100644 index 00000000000..273d24bdbe8 --- /dev/null +++ b/docs/framework/solid/reference/classes/Query.md @@ -0,0 +1,585 @@ +--- +id: Query +title: Query +--- + +Defined in: [packages/query-core/src/query.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L225) + +Represents a single cached query. A `Query` holds the query's key, options, +state (data/error/status), and the observers currently subscribed to it. + +Instances are created and managed internally by `QueryCache`; application +code typically interacts with queries indirectly through `QueryClient` or +a framework hook like `useQuery`. Direct access to a `Query` instance is +possible via `queryCache.find()`/`findAll()` for inspecting cache state. + +## Example + +```ts +const queryCache = queryClient.getQueryCache() +const query = queryCache.find({ queryKey: ['posts'] }) + +if (query) { + console.log(query.state.dataUpdatedAt) +} +``` + +## Extends + +- `Removable` + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Constructors + +### Constructor + +```ts +new Query(config): Query; +``` + +Defined in: [packages/query-core/src/query.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L246) + +#### Parameters + +##### config + +`QueryConfig`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Query`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Overrides + +```ts +Removable.constructor +``` + +## Properties + +### gcTime + +```ts +gcTime: number; +``` + +Defined in: [packages/query-core/src/removable.ts:7](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L7) + +#### Inherited from + +```ts +Removable.gcTime +``` + +*** + +### observers + +```ts +observers: QueryObserver[]; +``` + +Defined in: [packages/query-core/src/query.ts:242](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L242) + +*** + +### options + +```ts +options: QueryOptions; +``` + +Defined in: [packages/query-core/src/query.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L233) + +*** + +### queryHash + +```ts +queryHash: string; +``` + +Defined in: [packages/query-core/src/query.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L232) + +*** + +### queryKey + +```ts +queryKey: TQueryKey; +``` + +Defined in: [packages/query-core/src/query.ts:231](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L231) + +*** + +### state + +```ts +state: QueryState; +``` + +Defined in: [packages/query-core/src/query.ts:234](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L234) + +## Accessors + +### meta + +#### Get Signature + +```ts +get meta(): Record | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L264) + +The `meta` object passed in the query's options, if any. + +##### Returns + +`Record`\<`string`, `unknown`\> \| `undefined` + +*** + +### promise + +#### Get Signature + +```ts +get promise(): Promise | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L277) + +The promise for the currently in-flight fetch, if the query is fetching. +`undefined` when the query is not fetching. + +##### Returns + +`Promise`\<`TData`\> \| `undefined` + +## Methods + +### cancel() + +```ts +cancel(options?): Promise; +``` + +Defined in: [packages/query-core/src/query.ts:348](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L348) + +Cancels the query's currently in-flight fetch, if any. +- Returns a promise that resolves once the cancellation has settled. +- If no fetch is in progress, resolves immediately. + +#### Parameters + +##### options? + +[`CancelOptions`](../interfaces/CancelOptions.md) + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await query.cancel() +``` + +*** + +### clearGcTimeout() + +```ts +protected clearGcTimeout(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L32) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.clearGcTimeout +``` + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/query.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L361) + +Clears the query's garbage collection timeout and silently cancels any +in-flight fetch. Called by `QueryCache` when the query is removed from +the cache. + +#### Returns + +`void` + +#### See + +[Query#cancel](#cancel) + +#### Overrides + +```ts +Removable.destroy +``` + +*** + +### fetch() + +```ts +fetch(options?, fetchOptions?): Promise; +``` + +Defined in: [packages/query-core/src/query.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L590) + +Fetches the query, i.e. runs its `queryFn` (through any configured +retryer/behavior) and updates the query's state with the result. +- If a fetch is already in flight, returns its promise instead of + starting a new one, unless `fetchOptions.cancelRefetch` is set and the + query already has data, in which case the current fetch is silently + cancelled first. +- If `options` is passed, it replaces the query's current options + before fetching. + +#### Parameters + +##### options? + +`QueryOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\> + +##### fetchOptions? + +`FetchOptions`\<`TQueryFnData`\> + +#### Returns + +`Promise`\<`TData`\> + +*** + +### getObserversCount() + +```ts +getObserversCount(): number; +``` + +Defined in: [packages/query-core/src/query.ts:560](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L560) + +Returns the number of observers currently subscribed to this query. + +#### Returns + +`number` + +#### Example + +```ts +if (query.getObserversCount() === 0) { + // no component is currently watching this query +} +``` + +*** + +### invalidate() + +```ts +invalidate(): void; +``` + +Defined in: [packages/query-core/src/query.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L574) + +Marks the query as invalidated, unless it is already invalidated. This +updates `state.isInvalidated` and notifies observers, but does not by +itself trigger a refetch. + +#### Returns + +`void` + +#### Example + +```ts +query.invalidate() +``` + +*** + +### isActive() + +```ts +isActive(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:386](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L386) + +Returns `true` if the query has at least one observer for which `enabled` +does not resolve to `false`. + +#### Returns + +`boolean` + +*** + +### isDisabled() + +```ts +isDisabled(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:400](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L400) + +Returns `true` if the query is disabled, meaning it will not fetch +automatically. +- If the query has observers, it is disabled when none of them are active + (see `isActive`). +- If the query has no observers, it is disabled when its `queryFn` is + `skipToken` or it has never been fetched. + +#### Returns + +`boolean` + +*** + +### isFetched() + +```ts +isFetched(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:412](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L412) + +Returns `true` if the query has been fetched, i.e. it has resolved with +either data or an error at least once. + +#### Returns + +`boolean` + +*** + +### isStale() + +```ts +isStale(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:447](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L447) + +Returns `true` if the query is stale. +- If the query has observers, defers to whether any observer's current + result reports `isStale` (which accounts for each observer's own + `staleTime` and `enabled` state). +- If the query has no observers, it is considered stale when it has no + data or has been invalidated. + +#### Returns + +`boolean` + +#### See + +[Query#isStaleByTime](#isstalebytime) + +#### Example + +```ts +if (query.isStale()) { + // refetch or otherwise treat the cached data as outdated +} +``` + +*** + +### isStaleByTime() + +```ts +isStaleByTime(staleTime): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:473](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L473) + +Returns `true` if the query's data is stale relative to the given +`staleTime` (defaults to `0`). +- A query with no data is always stale. +- `staleTime: 'static'` is never stale. +- An invalidated query is always stale. +- Otherwise, staleness is based on elapsed time since `dataUpdatedAt`. + +#### Parameters + +##### staleTime + +[`StaleTime`](../type-aliases/StaleTime.md) = `0` + +#### Returns + +`boolean` + +#### See + +[Query#isStale](#isstale) + +#### Example + +```ts +const isStale = query.isStaleByTime(1000 * 60) +``` + +*** + +### isStatic() + +```ts +isStatic(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:420](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L420) + +Returns `true` if the query has at least one observer configured with +`staleTime: 'static'`, meaning it is treated as never stale. + +#### Returns + +`boolean` + +*** + +### optionalRemove() + +```ts +protected optionalRemove(): void; +``` + +Defined in: [packages/query-core/src/query.ts:305](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L305) + +#### Returns + +`void` + +#### Overrides + +```ts +Removable.optionalRemove +``` + +*** + +### reset() + +```ts +reset(): void; +``` + +Defined in: [packages/query-core/src/query.ts:377](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L377) + +Resets the query back to its initial state (the state it had when it was +first created, e.g. any `initialData`), destroying it first to cancel any +in-flight fetch. + +#### Returns + +`void` + +*** + +### scheduleGc() + +```ts +protected scheduleGc(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L14) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.scheduleGc +``` + +*** + +### setState() + +```ts +setState(state): void; +``` + +Defined in: [packages/query-core/src/query.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L334) + +Merges the given partial state directly into this query's state, notifying observers. Used +by persistence and broadcast plugins to restore a state snapshot, and by devtools to let a +user manually trigger a loading/error state or edit the cached data. + +#### Parameters + +##### state + +`Partial`\<[`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\>\> + +#### Returns + +`void` + +*** + +### updateGcTime() + +```ts +protected updateGcTime(newGcTime): void; +``` + +Defined in: [packages/query-core/src/removable.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L24) + +#### Parameters + +##### newGcTime + +`number` | `undefined` + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.updateGcTime +``` diff --git a/docs/framework/solid/reference/classes/QueryCache.md b/docs/framework/solid/reference/classes/QueryCache.md new file mode 100644 index 00000000000..5582a9a2560 --- /dev/null +++ b/docs/framework/solid/reference/classes/QueryCache.md @@ -0,0 +1,461 @@ +--- +id: QueryCache +title: QueryCache +--- + +Defined in: [packages/query-core/src/queryCache.ts:113](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L113) + +The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta +information, and state of the queries it contains. + +Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient` +for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of +safe/known updates to the cache, such as queries being added, removed, or updated. + +## Extends + +- `Subscribable`\<`QueryCacheListener`\> + +## Constructors + +### Constructor + +```ts +new QueryCache(config): QueryCache; +``` + +Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) + +#### Parameters + +##### config + +[`QueryCacheConfig`](../interfaces/QueryCacheConfig.md) = `{}` + +#### Returns + +`QueryCache` + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### config + +```ts +config: QueryCacheConfig = {}; +``` + +Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) + +*** + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### build() + +```ts +build( + client, + options, +state?): Query; +``` + +Defined in: [packages/query-core/src/queryCache.ts:137](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L137) + +Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or +builds and adds a new one to the cache if none exists yet. Used by framework adapters and +plugins (e.g. broadcast/persistence) that need to get-or-create a `Query` directly, bypassing +the reactive `QueryObserver` machinery. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### client + +`QueryClient` + +##### options + +[`WithRequired`](../type-aliases/WithRequired.md)\<`QueryOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\>, `"queryKey"`\> + +##### state? + +[`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\> + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const query = queryCache.build(queryClient, { + queryKey: ['posts'], + queryFn: fetchPosts, +}) +``` + +*** + +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:222](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L222) + +Removes all queries from the cache. + +#### Returns + +`void` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +queryCache.clear() +``` + +*** + +### find() + +```ts +find(filters): + | Query + | undefined; +``` + +Defined in: [packages/query-core/src/queryCache.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L289) + +A slightly more advanced method that can be used to get an existing query instance from the +cache. This instance not only contains all the state for the query, but all of the instances, +and underlying guts of the query as well. If the query does not exist, `undefined` is +returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about a query in rare scenarios (e.g. looking at `query.state.dataUpdatedAt` to +decide whether a query is fresh enough to be used as an initial value). + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +#### Parameters + +##### filters + +[`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryFilters`](../interfaces/QueryFilters.md)\, `"queryKey"`\> + +#### Returns + + \| [`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, readonly `unknown`[]\> + \| `undefined` + +#### See + +[QueryCache#findAll](#findall) + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const query = queryCache.find({ queryKey: ['posts'] }) +``` + +*** + +### findAll() + +```ts +findAll(filters): Query[]; +``` + +Defined in: [packages/query-core/src/queryCache.ts:314](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L314) + +An even more advanced method that can be used to get existing query instances from the cache +that partially match a query key. If no queries match, an empty array is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about queries in rare scenarios. + +#### Parameters + +##### filters + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = `{}` + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +#### See + +[QueryCache#find](#find) + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const queries = queryCache.findAll({ queryKey: ['posts'] }) +``` + +*** + +### get() + +```ts +get(queryHash): + | Query + | undefined; +``` + +Defined in: [packages/query-core/src/queryCache.ts:244](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L244) + +Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none +exists. Unlike [QueryCache#find](#find), this looks up by the already-computed hash rather +than by `QueryFilters`. Used by plugins (e.g. broadcast/hydration) that already have a hash +to look up directly. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### queryHash + +`string` + +#### Returns + + \| [`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + \| `undefined` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() +const queryHash = hashKey(['posts']) + +const query = queryCache.get(queryHash) +``` + +*** + +### getAll() + +```ts +getAll(): Query[]; +``` + +Defined in: [packages/query-core/src/queryCache.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L267) + +Returns all queries within the cache. + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const queries = queryCache.getAll() +``` + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L23) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L27) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### remove() + +```ts +remove(query): void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:198](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L198) + +Destroys the given `Query` and removes it from the cache, notifying subscribers with a +`'removed'` event. A no-op if the query is no longer the one currently stored under its hash +(e.g. it was already replaced). Used by plugins (e.g. the broadcast client) that mirror +removals across `QueryCache` instances. + +#### Parameters + +##### query + +[`Query`](Query.md)\<`any`, `any`, `any`, `any`\> + +#### Returns + +`void` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() +const query = queryCache.find({ queryKey: ['posts'] }) + +if (query) { + queryCache.remove(query) +} +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueryCacheListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/solid/reference/classes/QueryClient.md b/docs/framework/solid/reference/classes/QueryClient.md index b46ac5ef938..4565b72ccc6 100644 --- a/docs/framework/solid/reference/classes/QueryClient.md +++ b/docs/framework/solid/reference/classes/QueryClient.md @@ -3,7 +3,7 @@ id: QueryClient title: QueryClient --- -Defined in: [QueryClient.ts:113](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L113) +Defined in: [packages/solid-query/src/QueryClient.ts:113](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L113) The core `@tanstack/query-core` `QueryClient`, typed so its `defaultOptions.queries` accepts Solid's `reconcile` option. @@ -20,7 +20,7 @@ The core `@tanstack/query-core` `QueryClient`, typed so its `defaultOptions.quer new QueryClient(config): QueryClient; ``` -Defined in: [QueryClient.ts:114](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L114) +Defined in: [packages/solid-query/src/QueryClient.ts:114](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L114) #### Parameters @@ -37,3 +37,1620 @@ Defined in: [QueryClient.ts:114](https://github.com/TanStack/query/blob/main/pac ```ts QueryCoreClient.constructor ``` + +## Methods + +### cancelQueries() + +```ts +cancelQueries(filters?, cancelOptions?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L425) + +Cancels outgoing fetches for queries matching the given filters. Most useful when performing +optimistic updates, since any outgoing refetch that resolves afterwards would otherwise +overwrite the optimistic update. By default (`revert: true`), a cancelled query's data is +reverted to its state before the outgoing fetch started. + +The returned promise never rejects, even if individual cancellations fail. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +##### cancelOptions? + +[`CancelOptions`](../interfaces/CancelOptions.md) = `{}` + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.cancelQueries({ queryKey: ['posts'], exact: true }) +``` + +#### Inherited from + +```ts +QueryCoreClient.cancelQueries +``` + +*** + +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1073) + +Clears both the query cache and the mutation cache this client is connected to. + +#### Returns + +`void` + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +queryClient.clear() +``` + +#### Inherited from + +```ts +QueryCoreClient.clear +``` + +*** + +### defaultMutationOptions() + +```ts +defaultMutationOptions(options?): T; +``` + +Defined in: [packages/query-core/src/queryClient.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1047) + +The mutation counterpart of [QueryClient#defaultQueryOptions](#defaultqueryoptions). Called by framework +adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the +given `mutationKey`, then the client's `defaultOptions.mutations`, then the caller's options +on top. A no-op if the options are already defaulted (`_defaulted: true`). + +#### Type Parameters + +##### T + +`T` *extends* `MutationOptions`\<`any`, `any`, `any`, `any`\> + +#### Parameters + +##### options? + +`T` + +#### Returns + +`T` + +#### Inherited from + +```ts +QueryCoreClient.defaultMutationOptions +``` + +*** + +### defaultQueryOptions() + +```ts +defaultQueryOptions(options): DefaultedQueryObserverOptions; +``` + +Defined in: [packages/query-core/src/queryClient.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L960) + +Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the +caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the +given `queryKey`, then the client's own `defaultOptions.queries`, then the caller's options +on top. A no-op if the options are already defaulted (`_defaulted: true`). + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +`QueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\> | [`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Inherited from + +```ts +QueryCoreClient.defaultQueryOptions +``` + +*** + +### ~~ensureInfiniteQueryData()~~ + +```ts +ensureInfiniteQueryData(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryClient.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L725) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`EnsureInfiniteQueryDataOptions`](../type-aliases/EnsureInfiniteQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\> + +#### Deprecated + +Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version. + +#### Inherited from + +```ts +QueryCoreClient.ensureInfiniteQueryData +``` + +*** + +### ~~ensureQueryData()~~ + +```ts +ensureQueryData(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L196) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### options + +[`EnsureQueryDataOptions`](../interfaces/EnsureQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Deprecated + +Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version. + +#### Inherited from + +```ts +QueryCoreClient.ensureQueryData +``` + +*** + +### ~~fetchInfiniteQuery()~~ + +```ts +fetchInfiniteQuery(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryClient.ts:682](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L682) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\> + +#### Deprecated + +Use queryClient.infiniteQuery(options) instead. This method will be removed in the next major version. + +#### Inherited from + +```ts +QueryCoreClient.fetchInfiniteQuery +``` + +*** + +### ~~fetchQuery()~~ + +```ts +fetchQuery(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L590) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Deprecated + +Use queryClient.query(options) instead. This method will be removed in the next major version. + +#### Inherited from + +```ts +QueryCoreClient.fetchQuery +``` + +*** + +### getDefaultOptions() + +```ts +getDefaultOptions(): DefaultOptions; +``` + +Defined in: [packages/query-core/src/queryClient.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L808) + +Returns the default options that were set when creating the client, or via +[QueryClient#setDefaultOptions](#setdefaultoptions). + +#### Returns + +`DefaultOptions` + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const defaultOptions = queryClient.getDefaultOptions() +``` + +#### Inherited from + +```ts +QueryCoreClient.getDefaultOptions +``` + +*** + +### getMutationCache() + +```ts +getMutationCache(): MutationCache; +``` + +Defined in: [packages/query-core/src/queryClient.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L792) + +Returns the mutation cache this client is connected to. + +#### Returns + +[`MutationCache`](MutationCache.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const mutationCache = queryClient.getMutationCache() +const mutations = mutationCache.findAll({ status: 'pending' }) +``` + +#### Inherited from + +```ts +QueryCoreClient.getMutationCache +``` + +*** + +### getMutationDefaults() + +```ts +getMutationDefaults(mutationKey): OmitKeyof, "mutationKey">; +``` + +Defined in: [packages/query-core/src/queryClient.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L935) + +Returns the default options registered for mutations whose mutation key partially matches +the given `mutationKey`, via [QueryClient#setMutationDefaults](#setmutationdefaults). If multiple registered +defaults match, they are merged together in registration order. + +#### Parameters + +##### mutationKey + +readonly `unknown`[] + +#### Returns + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`any`, `any`, `any`, `any`\>, `"mutationKey"`\> + +#### Example + +```ts +const defaultOptions = queryClient.getMutationDefaults(['addPost']) +``` + +#### Inherited from + +```ts +QueryCoreClient.getMutationDefaults +``` + +*** + +### getQueriesData() + +```ts +getQueriesData(filters): [readonly unknown[], TQueryFnData | undefined][]; +``` + +Defined in: [packages/query-core/src/queryClient.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L233) + +Imperative (non-reactive) way to retrieve the cached data of multiple queries at once. +Only queries matching the given filters are returned; if none match, an empty array is +returned. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters + +`TQueryFilters` + +#### Returns + +\[readonly `unknown`[], `TQueryFnData` \| `undefined`\][] + +#### See + +[QueryClient#getQueryData](#getquerydata) + +#### Example + +```ts +const data = queryClient.getQueriesData({ queryKey: ['posts'] }) +``` + +#### Inherited from + +```ts +QueryCoreClient.getQueriesData +``` + +*** + +### getQueryCache() + +```ts +getQueryCache(): QueryCache; +``` + +Defined in: [packages/query-core/src/queryClient.ts:776](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L776) + +Returns the query cache this client is connected to. + +#### Returns + +[`QueryCache`](QueryCache.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const queryCache = queryClient.getQueryCache() +const queries = queryCache.findAll({ queryKey: ['posts'] }) +``` + +#### Inherited from + +```ts +QueryCoreClient.getQueryCache +``` + +*** + +### getQueryData() + +```ts +getQueryData(queryKey): TInferredQueryFnData | undefined; +``` + +Defined in: [packages/query-core/src/queryClient.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L182) + +Imperative (non-reactive) way to retrieve data for a QueryKey. +Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. + +Hint: Do not use this function inside a component, because it won't receive updates. +Use `useQuery` to create a `QueryObserver` that subscribes to changes. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +#### Returns + +`TInferredQueryFnData` \| `undefined` + +#### See + +[QueryClient#getQueriesData](#getqueriesdata) + +#### Inherited from + +```ts +QueryCoreClient.getQueryData +``` + +*** + +### getQueryDefaults() + +```ts +getQueryDefaults(queryKey): OmitKeyof, "queryKey">; +``` + +Defined in: [packages/query-core/src/queryClient.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L878) + +Returns the default options registered for queries whose query key partially matches the +given `queryKey`, via [QueryClient#setQueryDefaults](#setquerydefaults). If multiple registered defaults +match, they are merged together in registration order. + +#### Parameters + +##### queryKey + +readonly `unknown`[] + +#### Returns + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<`QueryObserverOptions`\<`any`, `any`, `any`, `any`, `any`\>, `"queryKey"`\> + +#### Example + +```ts +const defaultOptions = queryClient.getQueryDefaults(['posts']) +``` + +#### Inherited from + +```ts +QueryCoreClient.getQueryDefaults +``` + +*** + +### getQueryState() + +```ts +getQueryState(queryKey): + | QueryState + | undefined; +``` + +Defined in: [packages/query-core/src/queryClient.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L343) + +Imperative (non-reactive) way to retrieve an existing query's state. If the query does not +exist, `undefined` is returned. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +##### TInferredError + +`TInferredError` = [`InferErrorFromTag`](../type-aliases/InferErrorFromTag.md)\<`TError`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +#### Returns + + \| [`QueryState`](../interfaces/QueryState.md)\<`TInferredQueryFnData`, `TInferredError`\> + \| `undefined` + +#### Example + +```ts +const state = queryClient.getQueryState(['posts']) +console.log(state?.dataUpdatedAt) +``` + +#### Inherited from + +```ts +QueryCoreClient.getQueryState +``` + +*** + +### infiniteQuery() + +```ts +infiniteQuery(options): Promise[] ? InfiniteData : TData>; +``` + +Defined in: [packages/query-core/src/queryClient.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L656) + +Asynchronous method to fetch and cache an infinite query, resolving with an +[InfiniteData](../interfaces/InfiniteData.md) object or throwing with the error. + +Behaves like [QueryClient#query](#query), accepting the same options (minus +`initialPageParam`), plus the required `initialPageParam`, and an optional `pages` / +`getNextPageParam` pair used to refetch a fixed number of pages from the start. + +This method replaces the deprecated `fetchInfiniteQuery`, and — combined with +`{ staleTime: 'static' }` — the deprecated `ensureInfiniteQueryData`. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`InfiniteQueryExecuteOptions`](../type-aliases/InfiniteQueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`[] *extends* [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>[] ? [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\> : `TData`\> + +#### Example + +```ts +try { + const data = await queryClient.infiniteQuery({ queryKey, queryFn, initialPageParam: 0 }) + console.log(data.pages) +} catch (error) { + console.log(error) +} +``` + +#### Inherited from + +```ts +QueryCoreClient.infiniteQuery +``` + +*** + +### invalidateQueries() + +```ts +invalidateQueries(filters?, options?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:453](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L453) + +Marks queries matching the given filters as invalidated. Unlike +[QueryClient#removeQueries](#removequeries), invalidated queries stay in the cache. + +Unless `filters.refetchType` is `'none'`, matching queries are then refetched via +[QueryClient#refetchQueries](#refetchqueries), using `filters.refetchType` if set, otherwise +`filters.type`, otherwise `'active'`. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`InvalidateQueryFilters`](../interfaces/InvalidateQueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`InvalidateOptions`](../interfaces/InvalidateOptions.md) = `{}` + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' }) +``` + +#### Inherited from + +```ts +QueryCoreClient.invalidateQueries +``` + +*** + +### isFetching() + +```ts +isFetching(filters?): number; +``` + +Defined in: [packages/query-core/src/queryClient.ts:149](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L149) + +Returns the number of queries in the cache that are currently fetching, optionally +matching a set of filters. This includes background-fetching, loading new pages, and +loading more infinite query results. + +#### Type Parameters + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters? + +`TQueryFilters` + +#### Returns + +`number` + +#### Example + +```ts +if (queryClient.isFetching()) { + console.log('At least one query is fetching!') +} +``` + +#### Inherited from + +```ts +QueryCoreClient.isFetching +``` + +*** + +### isMutating() + +```ts +isMutating(filters?): number; +``` + +Defined in: [packages/query-core/src/queryClient.ts:167](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L167) + +Returns the number of mutations in the cache that are currently pending, optionally +matching a set of filters. + +#### Type Parameters + +##### TMutationFilters + +`TMutationFilters` *extends* [`MutationFilters`](../interfaces/MutationFilters.md)\<`any`, `any`, `unknown`, `unknown`\> = [`MutationFilters`](../interfaces/MutationFilters.md)\<`unknown`, `Error`, `unknown`, `unknown`\> + +#### Parameters + +##### filters? + +`TMutationFilters` + +#### Returns + +`number` + +#### Example + +```ts +if (queryClient.isMutating()) { + console.log('At least one mutation is pending!') +} +``` + +#### Inherited from + +```ts +QueryCoreClient.isMutating +``` + +*** + +### mount() + +```ts +mount(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L103) + +Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start +listening for focus/online events and resume paused mutations. Ref-counted via an internal +mount count, so nested or multiple providers sharing the same `QueryClient` don't tear down +the shared listeners until the last one unmounts. + +#### Returns + +`void` + +#### Inherited from + +```ts +QueryCoreClient.mount +``` + +*** + +### ~~prefetchInfiniteQuery()~~ + +```ts +prefetchInfiniteQuery(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L704) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`void`\> + +#### Deprecated + +Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version. + +#### Inherited from + +```ts +QueryCoreClient.prefetchInfiniteQuery +``` + +*** + +### ~~prefetchQuery()~~ + +```ts +prefetchQuery(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:624](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L624) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### options + +[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Promise`\<`void`\> + +#### Deprecated + +Use queryClient.query(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version. + +#### Inherited from + +```ts +QueryCoreClient.prefetchQuery +``` + +*** + +### query() + +```ts +query(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:544](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L544) + +Asynchronous method to fetch and cache a query, resolving with the data or throwing with +the error. + +If the query already exists in the cache and its data is not stale (per the given +`staleTime`), the cached data is returned without fetching. Otherwise, the query is fetched +and the promise resolves once the fetch settles. If a `select` function is provided, it is +applied to the data in both cases (cached or freshly fetched) before it is returned. + +Unlike `useQuery`, retries are disabled by default here (`retry: false`) unless explicitly +configured, since there is no component to catch a thrown error and retry through re-render. + +The accepted options are a subset of `useQuery`'s options: fields that only make sense for a +reactive observer (e.g. `enabled`, `refetchInterval`, `refetchOnWindowFocus`, `notifyOnChangeProps`, +`throwOnError`, `suspense`, `placeholderData`) are not part of this method's options. + +This method replaces the deprecated `fetchQuery`, and — combined with +`{ staleTime: 'static' }` — the deprecated `ensureQueryData`. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`QueryExecuteOptions`](../interfaces/QueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +try { + const data = await queryClient.query({ queryKey, queryFn, staleTime: 10000 }) +} catch (error) { + console.log(error) +} +``` + +#### Inherited from + +```ts +QueryCoreClient.query +``` + +*** + +### refetchQueries() + +```ts +refetchQueries(filters?, options?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:490](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L490) + +Refetches queries matching the given filters, regardless of whether they are stale. Without +filters, every query in the cache is refetched. Queries that are disabled, or static (only +have observers with a static `staleTime`), are never refetched. + +By default (`cancelRefetch: true`), a currently running fetch is cancelled before the new +one starts. The returned promise resolves once all matching queries have settled; it does +not reject on individual query failures unless `throwOnError` is set. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`RefetchQueryFilters`](../interfaces/RefetchQueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +// refetch all active queries partially matching a query key: +await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' }) +``` + +#### Inherited from + +```ts +QueryCoreClient.refetchQueries +``` + +*** + +### removeQueries() + +```ts +removeQueries(filters?): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:369](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L369) + +Removes queries from the cache that match the given filters. Unlike +[QueryClient#invalidateQueries](#invalidatequeries) or [QueryClient#refetchQueries](#refetchqueries), this removes +matching queries from the cache instead of refetching them. Without filters, every query in +the cache is removed. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +#### Returns + +`void` + +#### Example + +```ts +queryClient.removeQueries({ queryKey: ['posts'], exact: true }) +``` + +#### Inherited from + +```ts +QueryCoreClient.removeQueries +``` + +*** + +### resetQueries() + +```ts +resetQueries(filters?, options?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L390) + +Resets queries matching the given filters back to their initial state (e.g. any +`initialData`), notifying subscribers rather than removing them. Active queries among the +matched set are then refetched, and the returned promise resolves once that refetch settles. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`ResetOptions`](../interfaces/ResetOptions.md) + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.resetQueries({ queryKey: ['posts'], exact: true }) +``` + +#### Inherited from + +```ts +QueryCoreClient.resetQueries +``` + +*** + +### resumePausedMutations() + +```ts +resumePausedMutations(): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:757](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L757) + +Resumes mutations that were paused because there was no network connection. Does nothing +(resolving immediately) if the client is currently offline. + +#### Returns + +`Promise`\<`unknown`\> + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +await queryClient.resumePausedMutations() +``` + +#### Inherited from + +```ts +QueryCoreClient.resumePausedMutations +``` + +*** + +### setDefaultOptions() + +```ts +setDefaultOptions(options): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L829) + +Dynamically sets the default options for this client, overwriting any previously defined +default options. + +#### Parameters + +##### options + +`DefaultOptions` + +#### Returns + +`void` + +#### See + +[QueryClient#getDefaultOptions](#getdefaultoptions) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +queryClient.setDefaultOptions({ + queries: { + staleTime: Infinity, + }, +}) +``` + +#### Inherited from + +```ts +QueryCoreClient.setDefaultOptions +``` + +*** + +### setMutationDefaults() + +```ts +setMutationDefaults(mutationKey, options): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L907) + +Sets default options for mutations whose mutation key partially matches the given +`mutationKey`. As with [QueryClient#setQueryDefaults](#setquerydefaults), the order of registration +matters when several registered defaults match the same mutation key. + +#### Type Parameters + +##### TData + +`TData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TVariables + +`TVariables` = `void` + +##### TOnMutateResult + +`TOnMutateResult` = `unknown` + +#### Parameters + +##### mutationKey + +readonly `unknown`[] + +##### options + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> + +#### Returns + +`void` + +#### See + +[QueryClient#getMutationDefaults](#getmutationdefaults) + +#### Example + +```ts +queryClient.setMutationDefaults(['addPost'], { mutationFn: addPost }) +``` + +#### Inherited from + +```ts +QueryCoreClient.setMutationDefaults +``` + +*** + +### setQueriesData() + +```ts +setQueriesData( + filters, + updater, + options?): [readonly unknown[], TQueryFnData | undefined][]; +``` + +Defined in: [packages/query-core/src/queryClient.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L312) + +Synchronous way to immediately update the cached data of multiple queries at once, using +filters or partial query key matching. Only queries that already exist and match the given +filters are updated; no new cache entries are created. Internally this calls +[QueryClient#setQueryData](#setquerydata) for each matching query. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters + +`TQueryFilters` + +##### updater + +[`Updater`](../type-aliases/Updater.md)\<`NoInfer`\<`TQueryFnData`\> \| `undefined`, `NoInfer`\<`TQueryFnData`\> \| `undefined`\> + +##### options? + +[`SetDataOptions`](../interfaces/SetDataOptions.md) + +#### Returns + +\[readonly `unknown`[], `TQueryFnData` \| `undefined`\][] + +#### Example + +```ts +queryClient.setQueriesData({ queryKey: ['posts'] }, (oldPosts) => + oldPosts ? oldPosts.filter((post) => post.id !== deletedId) : oldPosts, +) +``` + +#### Inherited from + +```ts +QueryCoreClient.setQueriesData +``` + +*** + +### setQueryData() + +```ts +setQueryData( + queryKey, + updater, + options?): NoInfer | undefined; +``` + +Defined in: [packages/query-core/src/queryClient.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L264) + +Synchronous way to immediately update a query's cached data. If the updater (or the value +passed) resolves to `undefined`, the cache is left untouched and no query is created; +otherwise, if the query does not exist yet, it will be created. To update multiple queries +at once by partially matching query keys, use [QueryClient#setQueriesData](#setqueriesdata) instead. + +Updates must be performed immutably: do not mutate `oldData`, or data previously retrieved +via [QueryClient#getQueryData](#getquerydata), in place. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +The query key to set data for. + +##### updater + +[`Updater`](../type-aliases/Updater.md)\<`NoInfer`\<`TInferredQueryFnData`\> \| `undefined`, `NoInfer`\<`TInferredQueryFnData`\> \| `undefined`\> + +Either the new data, or a function that receives the current data (which +may be `undefined`) and returns the new data. + +##### options? + +[`SetDataOptions`](../interfaces/SetDataOptions.md) + +#### Returns + +`NoInfer`\<`TInferredQueryFnData`\> \| `undefined` + +#### Example + +```ts +queryClient.setQueryData(['posts'], newPosts) + +// Or, using an updater function that receives the current data: +queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost]) +``` + +#### Inherited from + +```ts +QueryCoreClient.setQueryData +``` + +*** + +### setQueryDefaults() + +```ts +setQueryDefaults(queryKey, options): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L848) + +Sets default options for queries whose query key partially matches the given `queryKey`. + +If several registered query defaults match a given query key, they are merged together in +registration order by [QueryClient#getQueryDefaults](#getquerydefaults), so register defaults from the +most generic key to the least generic one — more specific defaults should be registered +after more generic ones so they take precedence. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +#### Parameters + +##### queryKey + +readonly `unknown`[] + +##### options + +`Partial`\<[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<`QueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`\>, `"queryKey"`\>\> + +#### Returns + +`void` + +#### Example + +```ts +queryClient.setQueryDefaults(['posts'], { queryFn: fetchPosts }) + +await queryClient.query({ queryKey: ['posts'] }) +``` + +#### Inherited from + +```ts +QueryCoreClient.setQueryDefaults +``` + +*** + +### unmount() + +```ts +unmount(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L126) + +The inverse of [QueryClient#mount](#mount) — called by a framework adapter's +`QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online +listeners once the mount count returns to `0`. + +#### Returns + +`void` + +#### Inherited from + +```ts +QueryCoreClient.unmount +``` diff --git a/docs/framework/solid/reference/classes/QueryObserver.md b/docs/framework/solid/reference/classes/QueryObserver.md new file mode 100644 index 00000000000..e572756606d --- /dev/null +++ b/docs/framework/solid/reference/classes/QueryObserver.md @@ -0,0 +1,555 @@ +--- +id: QueryObserver +title: QueryObserver +--- + +Defined in: [packages/query-core/src/queryObserver.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L57) + +A `QueryObserver` watches a single query in the `QueryCache` and computes a +`QueryObserverResult` from its state, recomputing and notifying subscribers +whenever the underlying query (or the observer's options) changes. It is +the primitive that framework adapters (e.g. `useQuery`) build their hooks +on top of, but it can also be used directly to observe and switch between +queries outside of any framework. + +## Example + +```ts +const observer = new QueryObserver(queryClient, { + queryKey: ['posts'], + queryFn: fetchPosts, +}) + +const unsubscribe = observer.subscribe((result) => { + console.log(result.data) +}) +``` + +## Extends + +- `Subscribable`\<`QueryObserverListener`\<`TData`, `TError`\>\> + +## Extended by + +- [`InfiniteQueryObserver`](InfiniteQueryObserver.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Constructors + +### Constructor + +```ts +new QueryObserver(client, options): QueryObserver; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L87) + +#### Parameters + +##### client + +`QueryClient` + +##### options + +`QueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`QueryObserver`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Overrides + +```ts +Subscribable>.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +*** + +### options + +```ts +options: QueryObserverOptions; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L89) + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L106) + +#### Returns + +`void` + +*** + +### createResult() + +```ts +protected createResult(query, options): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:559](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L559) + +#### Parameters + +##### query + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> + +##### options + +`QueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L161) + +Stops observing the current query: clears all listeners, cancels the +stale and refetch-interval timers, and removes this observer from the +query it was observing. + +#### Returns + +`void` + +*** + +### fetch() + +```ts +protected fetch(fetchOptions): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L448) + +#### Parameters + +##### fetchOptions + +`ObserverFetchOptions` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchOptimistic() + +```ts +fetchOptimistic(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:395](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L395) + +Fetches a query defined by the given options without affecting this +observer's own tracked query or result, and returns a promise that +resolves with the `QueryObserverResult` for that fetch. This is useful +for prefetching data that another observer (e.g. a query about to be +navigated to) will need, ahead of time. + +#### Parameters + +##### options + +`QueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.fetchOptimistic({ + queryKey: ['posts', 2], + queryFn: () => fetchPost(2), +}) +console.log(result.data) +``` + +*** + +### getCurrentQuery() + +```ts +getCurrentQuery(): Query; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:357](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L357) + +Returns the `Query` instance this observer is currently observing. + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L321) + +Returns the most recently computed `QueryObserverResult` for the +observed query. This is a point-in-time read; to be notified of updates +as they happen, subscribe to the observer instead (its inherited +`subscribe` method). + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +#### Example + +```ts +const result = observer.getCurrentResult() +console.log(result.status, result.data) +``` + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(options): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L272) + +Computes the result the observer would produce for the given (already-defaulted) options +right now, building the underlying `Query` if it doesn't exist yet, without waiting for a +subscription callback. Called by framework adapters on every render (e.g. `useQuery`) so the +returned value is available synchronously, ahead of `setOptions` triggering an actual fetch. + +#### Parameters + +##### options + +[`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L110) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L124) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### refetch() + +```ts +refetch(__namedParameters): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L371) + +Refetches the observed query and returns a promise that resolves with +the resulting `QueryObserverResult`. + +#### Parameters + +##### \_\_namedParameters + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.refetch({ cancelRefetch: false }) +console.log(result.data) +``` + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L182) + +Updates the observer's options. This will re-resolve the query being +observed (switching to a different query if the `queryKey` changed), +trigger a fetch if the new options require one and the observer has +subscribers, recompute the current result, and reschedule the stale and +refetch-interval timers as needed. + +#### Parameters + +##### options + +`QueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setOptions({ queryKey: ['posts', 1], queryFn: () => fetchPost(1) }) +// later: switch to a different query, reusing the same observer +observer.setOptions({ queryKey: ['posts', 2], queryFn: () => fetchPost(2) }) +``` + +*** + +### shouldFetchOnReconnect() + +```ts +shouldFetchOnReconnect(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L135) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnReconnect` option) to refetch when the network +reconnects. + +#### Returns + +`boolean` + +*** + +### shouldFetchOnWindowFocus() + +```ts +shouldFetchOnWindowFocus(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L148) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnWindowFocus` option) to refetch when the window +regains focus. + +#### Returns + +`boolean` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueryObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` + +*** + +### trackProp() + +```ts +trackProp(key): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:350](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L350) + +Records that the given `QueryObserverResult` property was read, so a subsequent update only +notifies this observer if a tracked property actually changed. Normally called indirectly via +[QueryObserver#trackResult](#trackresult)'s proxy; exposed directly for adapters that track property +access themselves (e.g. through their own reactivity system) instead of via the proxy. + +#### Parameters + +##### key + +`"error"` | `"data"` | `"isError"` | `"isPending"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isSuccess"` | `"isPlaceholderData"` | `"status"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` + +#### Returns + +`void` + +*** + +### trackResult() + +```ts +trackResult(result, onPropTracked?): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:331](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L331) + +Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via +[QueryObserver#trackProp](#trackprop) (and an optional `onPropTracked` callback). Used by framework +adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on +properties you actually read" behavior. + +#### Parameters + +##### result + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +##### onPropTracked? + +(`key`) => `void` + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### updateResult() + +```ts +updateResult(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L735) + +Recomputes and stores the current result from the current query/options, notifying listeners +if it changed. Framework adapters call this right after subscribing to make sure no query +update was missed in the gap between creating the observer and subscribing to it. + +#### Returns + +`void` diff --git a/docs/framework/solid/reference/functions/QueryClientProvider.md b/docs/framework/solid/reference/functions/QueryClientProvider.md index d0262e5304a..d849b88f87f 100644 --- a/docs/framework/solid/reference/functions/QueryClientProvider.md +++ b/docs/framework/solid/reference/functions/QueryClientProvider.md @@ -7,7 +7,7 @@ title: QueryClientProvider function QueryClientProvider(props): Element; ``` -Defined in: [QueryClientProvider.tsx:95](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClientProvider.tsx#L95) +Defined in: [packages/solid-query/src/QueryClientProvider.tsx:95](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClientProvider.tsx#L95) Use the `QueryClientProvider` component to connect and provide a `QueryClient` to your application. Also calls `client.mount()`/`client.unmount()` as this component mounts/unmounts, which subscribes the client to diff --git a/docs/framework/solid/reference/functions/defaultShouldDehydrateMutation.md b/docs/framework/solid/reference/functions/defaultShouldDehydrateMutation.md new file mode 100644 index 00000000000..095ccf36e7c --- /dev/null +++ b/docs/framework/solid/reference/functions/defaultShouldDehydrateMutation.md @@ -0,0 +1,23 @@ +--- +id: defaultShouldDehydrateMutation +title: defaultShouldDehydrateMutation +--- + +```ts +function defaultShouldDehydrateMutation(mutation): boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L180) + +The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are +currently paused (e.g. paused by `networkMode` while offline). + +## Parameters + +### mutation + +[`Mutation`](../classes/Mutation.md) + +## Returns + +`boolean` diff --git a/docs/framework/solid/reference/functions/defaultShouldDehydrateQuery.md b/docs/framework/solid/reference/functions/defaultShouldDehydrateQuery.md new file mode 100644 index 00000000000..06afc29d670 --- /dev/null +++ b/docs/framework/solid/reference/functions/defaultShouldDehydrateQuery.md @@ -0,0 +1,23 @@ +--- +id: defaultShouldDehydrateQuery +title: defaultShouldDehydrateQuery +--- + +```ts +function defaultShouldDehydrateQuery(query): boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:188](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L188) + +The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is +`'success'`. + +## Parameters + +### query + +[`Query`](../classes/Query.md) + +## Returns + +`boolean` diff --git a/docs/framework/solid/reference/functions/dehydrate.md b/docs/framework/solid/reference/functions/dehydrate.md new file mode 100644 index 00000000000..451c558858c --- /dev/null +++ b/docs/framework/solid/reference/functions/dehydrate.md @@ -0,0 +1,43 @@ +--- +id: dehydrate +title: dehydrate +--- + +```ts +function dehydrate(client, options): DehydratedState; +``` + +Defined in: [packages/query-core/src/hydration.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L210) + +Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`, +typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`. +Which queries/mutations are included, and how their data/errors are transformed, is controlled by `options`, +falling back to the client's `dehydrate` default options, and finally to `defaultShouldDehydrateQuery` / +`defaultShouldDehydrateMutation`. + +## Parameters + +### client + +`QueryClient` + +### options + +[`DehydrateOptions`](../interfaces/DehydrateOptions.md) = `{}` + +## Returns + +[`DehydratedState`](../interfaces/DehydratedState.md) + +## Example + +```ts +const queryClient = new QueryClient() + +await queryClient.prefetchQuery({ + queryKey: ['posts'], + queryFn: getPosts, +}) + +const dehydratedState = dehydrate(queryClient) +``` diff --git a/docs/framework/solid/reference/functions/dehydrateQuery.md b/docs/framework/solid/reference/functions/dehydrateQuery.md new file mode 100644 index 00000000000..2827d2ebb45 --- /dev/null +++ b/docs/framework/solid/reference/functions/dehydrateQuery.md @@ -0,0 +1,43 @@ +--- +id: dehydrateQuery +title: dehydrateQuery +--- + +```ts +function dehydrateQuery( + query, + serializeData?, + shouldRedactErrors?): DehydratedQuery; +``` + +Defined in: [packages/query-core/src/hydration.ts:151](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L151) + +Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g. +`queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the +de/rehydrated data, typically with `useQuery` on the client. If the query is still `pending`, its in-flight +promise is dehydrated too so it can be resumed on the other side instead of re-fetched. + +## Parameters + +### query + +[`Query`](../classes/Query.md) + +The query to dehydrate. + +### serializeData? + +`TransformerFn` + +Optional transform applied to `query.state.data` before it is included in the snapshot. + +### shouldRedactErrors? + +(`error`) => `boolean` + +Optional predicate; if it returns `false` for the promise's rejection error, that +error is kept as-is instead of being redacted. + +## Returns + +`DehydratedQuery` diff --git a/docs/framework/solid/reference/functions/experimental_streamedQuery.md b/docs/framework/solid/reference/functions/experimental_streamedQuery.md new file mode 100644 index 00000000000..afd44df7c5f --- /dev/null +++ b/docs/framework/solid/reference/functions/experimental_streamedQuery.md @@ -0,0 +1,52 @@ +--- +id: experimental_streamedQuery +title: experimental_streamedQuery +--- + +```ts +function experimental_streamedQuery(queryFn): QueryFunction; +``` + +Defined in: [packages/query-core/src/streamedQuery.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L60) + +This is a helper function to create a query function that streams data from an AsyncIterable. +Data will be an Array of all the chunks received. +The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. +The query will stay in fetchStatus 'fetching' until the stream ends. + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TData + +`TData` = `TQueryFnData`[] + +### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +## Parameters + +### queryFn + +`StreamedQueryParams`\<`TQueryFnData`, `TData`, `TQueryKey`\> + +The function that returns an AsyncIterable to stream data from. + +## Returns + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TData`, `TQueryKey`\> + +## Example + +```ts +await queryClient.query({ + queryKey: ['data'], + queryFn: streamedQuery({ + streamFn: fetchDataInChunks, + }), +}) +``` diff --git a/docs/framework/solid/reference/functions/hashKey.md b/docs/framework/solid/reference/functions/hashKey.md new file mode 100644 index 00000000000..9e7844aa09d --- /dev/null +++ b/docs/framework/solid/reference/functions/hashKey.md @@ -0,0 +1,30 @@ +--- +id: hashKey +title: hashKey +--- + +```ts +function hashKey(queryKey): string; +``` + +Defined in: [packages/query-core/src/utils.ts:282](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L282) + +Default query & mutation keys hash function. +Hashes the value into a stable hash. + +## Parameters + +### queryKey + +readonly `unknown`[] + +## Returns + +`string` + +## Example + +```ts +// Object keys are sorted, so key order doesn't affect the hash: +hashKey(['todos', { page: 1, filter: 'done' }]) // === '["todos",{"filter":"done","page":1}]' +``` diff --git a/docs/framework/solid/reference/functions/hydrate.md b/docs/framework/solid/reference/functions/hydrate.md new file mode 100644 index 00000000000..1b9ad8025a4 --- /dev/null +++ b/docs/framework/solid/reference/functions/hydrate.md @@ -0,0 +1,49 @@ +--- +id: hydrate +title: hydrate +--- + +```ts +function hydrate( + client, + dehydratedState, + options?): void; +``` + +Defined in: [packages/query-core/src/hydration.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L267) + +Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the +client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`. +Queries not yet in the cache are built from the dehydrated snapshot; queries that already exist are only updated +when the dehydrated data is newer than what's already cached. Newly built queries have their `fetchStatus` reset +to `'idle'` so they don't hydrate stuck in a fetching state. If a dehydrated query still had an in-flight +promise, it is resumed via `query.fetch()` (reusing that promise as `initialPromise`) rather than re-invoking +`queryFn`. + +## Parameters + +### client + +`QueryClient` + +### dehydratedState + +`Partial`\<[`DehydratedState`](../interfaces/DehydratedState.md)\> + +### options? + +[`HydrateOptions`](../interfaces/HydrateOptions.md) + +## Returns + +`void` + +## Example + +```ts +// dehydratedState was produced by `dehydrate` on the server +// and sent to the client, e.g. embedded in server-rendered markup. +const queryClient = new QueryClient() + +hydrate(queryClient, dehydratedState) +``` diff --git a/docs/framework/solid/reference/functions/infiniteQueryOptions.md b/docs/framework/solid/reference/functions/infiniteQueryOptions.md index c2082f957d1..6104be4928c 100644 --- a/docs/framework/solid/reference/functions/infiniteQueryOptions.md +++ b/docs/framework/solid/reference/functions/infiniteQueryOptions.md @@ -11,7 +11,7 @@ redirect_from: function infiniteQueryOptions(options): InfiniteQueryOptions & object & QueryKeyWithDataTag, TError>; ``` -Defined in: [infiniteQueryOptions.ts:105](https://github.com/TanStack/query/blob/main/packages/solid-query/src/infiniteQueryOptions.ts#L105) +Defined in: [packages/solid-query/src/infiniteQueryOptions.ts:105](https://github.com/TanStack/query/blob/main/packages/solid-query/src/infiniteQueryOptions.ts#L105) You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`. @@ -31,7 +31,7 @@ This overload is selected when `initialData` is set. #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -51,7 +51,7 @@ The [DefinedInitialDataInfiniteOptions](../type-aliases/DefinedInitialDataInfini ### Returns -[`InfiniteQueryOptions`](../interfaces/InfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `object` & `QueryKeyWithDataTag`\<`TQueryKey`, `InfiniteData`\<`TQueryFnData`, `unknown`\>, `TError`\> +[`InfiniteQueryOptions`](../interfaces/InfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `object` & [`QueryKeyWithDataTag`](../type-aliases/QueryKeyWithDataTag.md)\<`TQueryKey`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>, `TError`\> The same options object, typed so that `queryKey` carries the inferred data type. @@ -97,7 +97,7 @@ function Projects() { function infiniteQueryOptions(options): InfiniteQueryOptions & object & QueryKeyWithDataTag, TError>; ``` -Defined in: [infiniteQueryOptions.ts:174](https://github.com/TanStack/query/blob/main/packages/solid-query/src/infiniteQueryOptions.ts#L174) +Defined in: [packages/solid-query/src/infiniteQueryOptions.ts:174](https://github.com/TanStack/query/blob/main/packages/solid-query/src/infiniteQueryOptions.ts#L174) You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`. @@ -115,7 +115,7 @@ These options can be shared across hooks and imperative APIs such as `queryClien #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -135,7 +135,7 @@ The [UndefinedInitialDataInfiniteOptions](../type-aliases/UndefinedInitialDataIn ### Returns -[`InfiniteQueryOptions`](../interfaces/InfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `object` & `QueryKeyWithDataTag`\<`TQueryKey`, `InfiniteData`\<`TQueryFnData`, `unknown`\>, `TError`\> +[`InfiniteQueryOptions`](../interfaces/InfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `object` & [`QueryKeyWithDataTag`](../type-aliases/QueryKeyWithDataTag.md)\<`TQueryKey`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>, `TError`\> The same options object, typed so that `queryKey` carries the inferred data type. diff --git a/docs/framework/solid/reference/functions/isCancelledError.md b/docs/framework/solid/reference/functions/isCancelledError.md new file mode 100644 index 00000000000..c8f57c4b94d --- /dev/null +++ b/docs/framework/solid/reference/functions/isCancelledError.md @@ -0,0 +1,24 @@ +--- +id: isCancelledError +title: isCancelledError +--- + +```ts +function isCancelledError(value): value is CancelledError; +``` + +Defined in: [packages/query-core/src/retryer.ts:90](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L90) + +## Parameters + +### value + +`any` + +## Returns + +`value is CancelledError` + +## Deprecated + +Use instanceof `CancelledError` instead. diff --git a/docs/framework/solid/reference/functions/keepPreviousData.md b/docs/framework/solid/reference/functions/keepPreviousData.md new file mode 100644 index 00000000000..d41c7d7c726 --- /dev/null +++ b/docs/framework/solid/reference/functions/keepPreviousData.md @@ -0,0 +1,40 @@ +--- +id: keepPreviousData +title: keepPreviousData +--- + +```ts +function keepPreviousData(previousData): T | undefined; +``` + +Defined in: [packages/query-core/src/utils.ts:491](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L491) + +Intended to be passed as a query's `placeholderData` option, for example +`placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new +query key is fetching, it keeps displaying the previously fetched data until the new data arrives. + +## Type Parameters + +### T + +`T` + +## Parameters + +### previousData + +`T` | `undefined` + +## Returns + +`T` \| `undefined` + +## Example + +```ts +new QueryObserver(queryClient, { + queryKey: ['posts', page], + queryFn: () => fetchPosts(page), + placeholderData: keepPreviousData, +}) +``` diff --git a/docs/framework/solid/reference/functions/matchMutation.md b/docs/framework/solid/reference/functions/matchMutation.md new file mode 100644 index 00000000000..79468dcfad9 --- /dev/null +++ b/docs/framework/solid/reference/functions/matchMutation.md @@ -0,0 +1,38 @@ +--- +id: matchMutation +title: matchMutation +--- + +```ts +function matchMutation(filters, mutation): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:235](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L235) + +Checks whether a mutation matches the given [MutationFilters](../interfaces/MutationFilters.md). +Every filter that is specified must match; filters that are left unspecified are ignored. +If a `mutationKey` filter is provided but the mutation has no `mutationKey` of its own, it does not match. + +## Parameters + +### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) + +### mutation + +[`Mutation`](../classes/Mutation.md)\<`any`, `any`\> + +## Returns + +`boolean` + +## Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const matchingMutations = mutationCache + .getAll() + .filter((mutation) => matchMutation({ mutationKey: ['addPost'] }, mutation)) +``` diff --git a/docs/framework/solid/reference/functions/matchQuery.md b/docs/framework/solid/reference/functions/matchQuery.md new file mode 100644 index 00000000000..f98fe5f3537 --- /dev/null +++ b/docs/framework/solid/reference/functions/matchQuery.md @@ -0,0 +1,37 @@ +--- +id: matchQuery +title: matchQuery +--- + +```ts +function matchQuery(filters, query): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L173) + +Checks whether a query matches the given [QueryFilters](../interfaces/QueryFilters.md). +Every filter that is specified must match; filters that are left unspecified are ignored. + +## Parameters + +### filters + +[`QueryFilters`](../interfaces/QueryFilters.md) + +### query + +[`Query`](../classes/Query.md)\<`any`, `any`, `any`, `any`\> + +## Returns + +`boolean` + +## Example + +```ts +const queryCache = queryClient.getQueryCache() + +const matchingQueries = queryCache + .getAll() + .filter((query) => matchQuery({ queryKey: ['posts'] }, query)) +``` diff --git a/docs/framework/solid/reference/functions/mutationOptions.md b/docs/framework/solid/reference/functions/mutationOptions.md index a766fabe9b2..a378539e67b 100644 --- a/docs/framework/solid/reference/functions/mutationOptions.md +++ b/docs/framework/solid/reference/functions/mutationOptions.md @@ -11,7 +11,7 @@ redirect_from: function mutationOptions(options): WithRequired, "mutationKey">; ``` -Defined in: [mutationOptions.ts:33](https://github.com/TanStack/query/blob/main/packages/solid-query/src/mutationOptions.ts#L33) +Defined in: [packages/solid-query/src/mutationOptions.ts:33](https://github.com/TanStack/query/blob/main/packages/solid-query/src/mutationOptions.ts#L33) You can generally pass everything to `mutationOptions` that you can also pass to `useMutation`. A `mutationKey` is required on this overload so the mutation can be looked up later, e.g. with @@ -39,14 +39,14 @@ You can generally pass everything to `mutationOptions` that you can also pass to #### options -`WithRequired`\<[`MutationOptions`](../interfaces/MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> +[`WithRequired`](../type-aliases/WithRequired.md)\<[`MutationOptions`](../interfaces/MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> The mutation options to use, identical to what you'd pass to `useMutation`, with a required `mutationKey`. ### Returns -`WithRequired`\<[`MutationOptions`](../interfaces/MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> +[`WithRequired`](../type-aliases/WithRequired.md)\<[`MutationOptions`](../interfaces/MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> The same options object, unchanged. @@ -80,7 +80,7 @@ function SavingIndicator() { function mutationOptions(options): Omit, "mutationKey">; ``` -Defined in: [mutationOptions.ts:73](https://github.com/TanStack/query/blob/main/packages/solid-query/src/mutationOptions.ts#L73) +Defined in: [packages/solid-query/src/mutationOptions.ts:73](https://github.com/TanStack/query/blob/main/packages/solid-query/src/mutationOptions.ts#L73) You can generally pass everything to `mutationOptions` that you can also pass to `useMutation`. No `mutationKey` is required on this overload — use this when you don't need to target the mutation via a diff --git a/docs/framework/solid/reference/functions/noop.md b/docs/framework/solid/reference/functions/noop.md new file mode 100644 index 00000000000..fd1b8dc2ad0 --- /dev/null +++ b/docs/framework/solid/reference/functions/noop.md @@ -0,0 +1,32 @@ +--- +id: noop +title: noop +--- + +## Call Signature + +```ts +function noop(): void; +``` + +Defined in: [packages/query-core/src/utils.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L117) + +A function that does nothing. + +### Returns + +`void` + +## Call Signature + +```ts +function noop(): undefined; +``` + +Defined in: [packages/query-core/src/utils.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L118) + +A function that does nothing. + +### Returns + +`undefined` diff --git a/docs/framework/solid/reference/functions/partialMatchKey.md b/docs/framework/solid/reference/functions/partialMatchKey.md new file mode 100644 index 00000000000..3795de85b95 --- /dev/null +++ b/docs/framework/solid/reference/functions/partialMatchKey.md @@ -0,0 +1,26 @@ +--- +id: partialMatchKey +title: partialMatchKey +--- + +```ts +function partialMatchKey(a, b): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L298) + +Checks if key `b` partially matches with key `a`. + +## Parameters + +### a + +readonly `unknown`[] + +### b + +readonly `unknown`[] + +## Returns + +`boolean` diff --git a/docs/framework/solid/reference/functions/queryOptions.md b/docs/framework/solid/reference/functions/queryOptions.md index 10447972e7a..ca783a42fd0 100644 --- a/docs/framework/solid/reference/functions/queryOptions.md +++ b/docs/framework/solid/reference/functions/queryOptions.md @@ -11,7 +11,7 @@ redirect_from: function queryOptions(options): QueryOptions & object & QueryKeyWithDataTag; ``` -Defined in: [queryOptions.ts:89](https://github.com/TanStack/query/blob/main/packages/solid-query/src/queryOptions.ts#L89) +Defined in: [packages/solid-query/src/queryOptions.ts:89](https://github.com/TanStack/query/blob/main/packages/solid-query/src/queryOptions.ts#L89) You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and @@ -47,7 +47,7 @@ The [DefinedInitialDataOptions](../type-aliases/DefinedInitialDataOptions.md) to ### Returns -[`QueryOptions`](../interfaces/QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> & `object` & `QueryKeyWithDataTag`\<`TQueryKey`, `TQueryFnData`, `TError`\> +[`QueryOptions`](../interfaces/QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> & `object` & [`QueryKeyWithDataTag`](../type-aliases/QueryKeyWithDataTag.md)\<`TQueryKey`, `TQueryFnData`, `TError`\> The same options object, typed so that `queryKey` carries the inferred data type. @@ -89,7 +89,7 @@ function Posts() { function queryOptions(options): QueryOptions & object & QueryKeyWithDataTag; ``` -Defined in: [queryOptions.ts:139](https://github.com/TanStack/query/blob/main/packages/solid-query/src/queryOptions.ts#L139) +Defined in: [packages/solid-query/src/queryOptions.ts:139](https://github.com/TanStack/query/blob/main/packages/solid-query/src/queryOptions.ts#L139) You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and @@ -123,7 +123,7 @@ The [UndefinedInitialDataOptions](../type-aliases/UndefinedInitialDataOptions.md ### Returns -[`QueryOptions`](../interfaces/QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> & `object` & `QueryKeyWithDataTag`\<`TQueryKey`, `TQueryFnData`, `TError`\> +[`QueryOptions`](../interfaces/QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> & `object` & [`QueryKeyWithDataTag`](../type-aliases/QueryKeyWithDataTag.md)\<`TQueryKey`, `TQueryFnData`, `TError`\> The same options object, typed so that `queryKey` carries the inferred data type. diff --git a/docs/framework/solid/reference/functions/replaceEqualDeep.md b/docs/framework/solid/reference/functions/replaceEqualDeep.md new file mode 100644 index 00000000000..77a393196ef --- /dev/null +++ b/docs/framework/solid/reference/functions/replaceEqualDeep.md @@ -0,0 +1,41 @@ +--- +id: replaceEqualDeep +title: replaceEqualDeep +--- + +```ts +function replaceEqualDeep( + a, + b, + depth?): T; +``` + +Defined in: [packages/query-core/src/utils.ts:337](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L337) + +This function returns `a` if `b` is deeply equal. +If not, it will replace any deeply equal children of `b` with those of `a`. +This can be used for structural sharing between JSON values for example. + +## Type Parameters + +### T + +`T` + +## Parameters + +### a + +`unknown` + +### b + +`T` + +### depth? + +`number` + +## Returns + +`T` diff --git a/docs/framework/solid/reference/functions/shouldThrowError.md b/docs/framework/solid/reference/functions/shouldThrowError.md new file mode 100644 index 00000000000..3146617391e --- /dev/null +++ b/docs/framework/solid/reference/functions/shouldThrowError.md @@ -0,0 +1,45 @@ +--- +id: shouldThrowError +title: shouldThrowError +--- + +```ts +function shouldThrowError(throwOnError, params): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L574) + +Resolves a `throwOnError` option to a boolean. +If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller, +additional context such as the query or mutation) and its result is returned, allowing the throwing +behavior to be decided per error. Otherwise, `throwOnError` itself is coerced to a boolean (`undefined` +resolves to `false`). + +## Type Parameters + +### T + +`T` *extends* (...`args`) => `boolean` + +## Parameters + +### throwOnError + +`boolean` | `T` | `undefined` + +### params + +`Parameters`\<`T`\> + +## Returns + +`boolean` + +## Example + +```ts +const throwOnError = + query.state.error && typeof options.throwOnError === 'function' + ? shouldThrowError(options.throwOnError, [query.state.error, query]) + : options.throwOnError +``` diff --git a/docs/framework/solid/reference/functions/useInfiniteQuery.md b/docs/framework/solid/reference/functions/useInfiniteQuery.md index bf7f9687992..7fb3ab2654a 100644 --- a/docs/framework/solid/reference/functions/useInfiniteQuery.md +++ b/docs/framework/solid/reference/functions/useInfiniteQuery.md @@ -11,7 +11,7 @@ redirect_from: function useInfiniteQuery(options, queryClient?): DefinedUseInfiniteQueryResult; ``` -Defined in: [useInfiniteQuery.ts:70](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useInfiniteQuery.ts#L70) +Defined in: [packages/solid-query/src/useInfiniteQuery.ts:70](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useInfiniteQuery.ts#L70) The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`. @@ -30,7 +30,7 @@ This overload is selected when `initialData` is set. #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -111,7 +111,7 @@ function Projects() { function useInfiniteQuery(options, queryClient?): UseInfiniteQueryResult; ``` -Defined in: [useInfiniteQuery.ts:189](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useInfiniteQuery.ts#L189) +Defined in: [packages/solid-query/src/useInfiniteQuery.ts:189](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useInfiniteQuery.ts#L189) The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`. @@ -128,7 +128,7 @@ The options for `useInfiniteQuery` are identical to `useQuery`, with the additio #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey diff --git a/docs/framework/solid/reference/functions/useIsFetching.md b/docs/framework/solid/reference/functions/useIsFetching.md index 26aa2be7f6f..0e2005f6078 100644 --- a/docs/framework/solid/reference/functions/useIsFetching.md +++ b/docs/framework/solid/reference/functions/useIsFetching.md @@ -9,7 +9,7 @@ redirect_from: function useIsFetching(filters?, queryClient?): Accessor; ``` -Defined in: [useIsFetching.ts:29](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useIsFetching.ts#L29) +Defined in: [packages/solid-query/src/useIsFetching.ts:29](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useIsFetching.ts#L29) The `useIsFetching` hook returns the `number` of the queries that your application is loading or fetching in the background (useful for app-wide loading indicators). @@ -18,9 +18,9 @@ in the background (useful for app-wide loading indicators). ### filters? -`Accessor`\<`QueryFilters`\\> +`Accessor`\<[`QueryFilters`](../interfaces/QueryFilters.md)\\> -An accessor returning the QueryFilters to narrow down the matched queries. +An accessor returning the [QueryFilters](../interfaces/QueryFilters.md) to narrow down the matched queries. ### queryClient? diff --git a/docs/framework/solid/reference/functions/useIsMutating.md b/docs/framework/solid/reference/functions/useIsMutating.md index 041fb1b93e4..5885712474d 100644 --- a/docs/framework/solid/reference/functions/useIsMutating.md +++ b/docs/framework/solid/reference/functions/useIsMutating.md @@ -9,7 +9,7 @@ redirect_from: function useIsMutating(filters?, queryClient?): Accessor; ``` -Defined in: [useIsMutating.ts:28](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useIsMutating.ts#L28) +Defined in: [packages/solid-query/src/useIsMutating.ts:28](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useIsMutating.ts#L28) The `useIsMutating` hook returns the `number` of mutations that your application currently has `pending` (useful for app-wide loading indicators). @@ -18,9 +18,9 @@ The `useIsMutating` hook returns the `number` of mutations that your application ### filters? -`Accessor`\<`MutationFilters`\<`unknown`, `Error`, `unknown`, `unknown`\>\> +`Accessor`\<[`MutationFilters`](../interfaces/MutationFilters.md)\<`unknown`, `Error`, `unknown`, `unknown`\>\> -An accessor returning the MutationFilters to narrow down the matched mutations. +An accessor returning the [MutationFilters](../interfaces/MutationFilters.md) to narrow down the matched mutations. ### queryClient? diff --git a/docs/framework/solid/reference/functions/useIsRestoring.md b/docs/framework/solid/reference/functions/useIsRestoring.md index ee789d94aab..1cd2ab60ad3 100644 --- a/docs/framework/solid/reference/functions/useIsRestoring.md +++ b/docs/framework/solid/reference/functions/useIsRestoring.md @@ -7,7 +7,7 @@ title: useIsRestoring function useIsRestoring(): Accessor; ``` -Defined in: [isRestoring.ts:13](https://github.com/TanStack/query/blob/main/packages/solid-query/src/isRestoring.ts#L13) +Defined in: [packages/solid-query/src/isRestoring.ts:13](https://github.com/TanStack/query/blob/main/packages/solid-query/src/isRestoring.ts#L13) If you are using `PersistQueryClientProvider`, you can also use the `useIsRestoring` hook alongside it to check if a restore is currently in progress. `useQuery` and friends also check this internally to avoid diff --git a/docs/framework/solid/reference/functions/useMutation.md b/docs/framework/solid/reference/functions/useMutation.md index 472cb852825..2594a8a03c5 100644 --- a/docs/framework/solid/reference/functions/useMutation.md +++ b/docs/framework/solid/reference/functions/useMutation.md @@ -9,7 +9,7 @@ redirect_from: function useMutation(options, queryClient?): UseMutationResult; ``` -Defined in: [useMutation.ts:173](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useMutation.ts#L173) +Defined in: [packages/solid-query/src/useMutation.ts:173](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useMutation.ts#L173) ## Type Parameters diff --git a/docs/framework/solid/reference/functions/useMutationState.md b/docs/framework/solid/reference/functions/useMutationState.md index f6fa24851c8..266ee912360 100644 --- a/docs/framework/solid/reference/functions/useMutationState.md +++ b/docs/framework/solid/reference/functions/useMutationState.md @@ -9,21 +9,21 @@ redirect_from: function useMutationState(options, queryClient?): Accessor; ``` -Defined in: [useMutationState.ts:124](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useMutationState.ts#L124) +Defined in: [packages/solid-query/src/useMutationState.ts:124](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useMutationState.ts#L124) `useMutationState` is a hook that gives you access to all mutations in the `MutationCache`. You can pass -`filters` (MutationFilters) to narrow down your mutations, and `select` to transform the mutation +`filters` ([MutationFilters](../interfaces/MutationFilters.md)) to narrow down your mutations, and `select` to transform the mutation state. ## Type Parameters ### TResult -`TResult` = `MutationState`\<`unknown`, `Error`, `unknown`, `unknown`\> +`TResult` = [`MutationState`](../interfaces/MutationState.md)\<`unknown`, `Error`, `unknown`, `unknown`\> ### TMutation -`TMutation` *extends* `Mutation`\<`any`, `any`, `any`, `any`\> = `MutationTypeFromResult`\<`TResult`\> +`TMutation` *extends* [`Mutation`](../classes/Mutation.md)\<`any`, `any`, `any`, `any`\> = `MutationTypeFromResult`\<`TResult`\> ## Parameters diff --git a/docs/framework/solid/reference/functions/useQueries.md b/docs/framework/solid/reference/functions/useQueries.md index a8f163d5bab..949fb4c72c5 100644 --- a/docs/framework/solid/reference/functions/useQueries.md +++ b/docs/framework/solid/reference/functions/useQueries.md @@ -9,7 +9,7 @@ redirect_from: function useQueries(queriesOptions, queryClient?): TCombinedResult; ``` -Defined in: [useQueries.ts:274](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useQueries.ts#L274) +Defined in: [packages/solid-query/src/useQueries.ts:274](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useQueries.ts#L274) The `useQueries` hook can be used to fetch a variable number of queries. @@ -38,31 +38,31 @@ previously rendered queries, because the number of queries can differ between re `TCombinedResult` *extends* \| \[\] \| \[ - \| `QueryObserverRefetchErrorResult`\<`unknown`, `Error`\> - \| `QueryObserverSuccessResult`\<`unknown`, `Error`\> - \| `QueryObserverLoadingErrorResult`\<`unknown`, `Error`\> - \| `QueryObserverLoadingResult`\<`unknown`, `Error`\> - \| `QueryObserverPendingResult`\<`unknown`, `Error`\> - \| `QueryObserverPlaceholderResult`\<`unknown`, `Error`\> - \| `QueryObserverRefetchErrorResult`\<`unknown`, `unknown`\> - \| `QueryObserverSuccessResult`\<`unknown`, `unknown`\> - \| `QueryObserverLoadingErrorResult`\<`unknown`, `unknown`\> - \| `QueryObserverLoadingResult`\<`unknown`, `unknown`\> - \| `QueryObserverPendingResult`\<`unknown`, `unknown`\> - \| `QueryObserverPlaceholderResult`\<`unknown`, `unknown`\>\] + \| [`QueryObserverRefetchErrorResult`](../interfaces/QueryObserverRefetchErrorResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverSuccessResult`](../interfaces/QueryObserverSuccessResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverLoadingErrorResult`](../interfaces/QueryObserverLoadingErrorResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverLoadingResult`](../interfaces/QueryObserverLoadingResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverPendingResult`](../interfaces/QueryObserverPendingResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverPlaceholderResult`](../interfaces/QueryObserverPlaceholderResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverRefetchErrorResult`](../interfaces/QueryObserverRefetchErrorResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverSuccessResult`](../interfaces/QueryObserverSuccessResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverLoadingErrorResult`](../interfaces/QueryObserverLoadingErrorResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverLoadingResult`](../interfaces/QueryObserverLoadingResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverPendingResult`](../interfaces/QueryObserverPendingResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverPlaceholderResult`](../interfaces/QueryObserverPlaceholderResult.md)\<`unknown`, `unknown`\>\] \| ( - \| `QueryObserverRefetchErrorResult`\<`unknown`, `Error`\> - \| `QueryObserverSuccessResult`\<`unknown`, `Error`\> - \| `QueryObserverLoadingErrorResult`\<`unknown`, `Error`\> - \| `QueryObserverLoadingResult`\<`unknown`, `Error`\> - \| `QueryObserverPendingResult`\<`unknown`, `Error`\> - \| `QueryObserverPlaceholderResult`\<`unknown`, `Error`\> - \| `QueryObserverRefetchErrorResult`\<`unknown`, `unknown`\> - \| `QueryObserverSuccessResult`\<`unknown`, `unknown`\> - \| `QueryObserverLoadingErrorResult`\<`unknown`, `unknown`\> - \| `QueryObserverLoadingResult`\<`unknown`, `unknown`\> - \| `QueryObserverPendingResult`\<`unknown`, `unknown`\> - \| `QueryObserverPlaceholderResult`\<`unknown`, `unknown`\>)[] = `T` *extends* \[\] ? \[\] : `T` *extends* \[`Head`\] ? \[`GetResults`\<`Head`\>\] : `T` *extends* \[`Head`, `...Tail[]`\] ? \[`...Tail[]`\] *extends* \[\] ? \[\] : \[`...Tail[]`\] *extends* \[`Head`\] ? \[`GetResults`\<`Head`\>, `GetResults`\<`Head`\>\] : \[`...Tail[]`\] *extends* \[`Head`, `...Tail[]`\] ? \[`...Tail[]`\] *extends* \[\] ? \[\] : \[`...Tail[]`\] *extends* \[`Head`\] ? \[`GetResults`\<`Head`\>, `GetResults`\<`Head`\>, `GetResults`\<`Head`\>\] : \[`...Tail[]`\] *extends* \[`Head`, `...Tail[]`\] ? \[`...(...)[]`\] *extends* \[\] ? \[\] : ... *extends* ... ? ... : ... : \[`...{ [K in (...)]: (...) }[]`\] : \[...\{ \[K in string \| number \| symbol\]: GetResults\\]\> \}\[\]\] : \{ \[K in string \| number \| symbol\]: GetResults\\]\> \} + \| [`QueryObserverRefetchErrorResult`](../interfaces/QueryObserverRefetchErrorResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverSuccessResult`](../interfaces/QueryObserverSuccessResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverLoadingErrorResult`](../interfaces/QueryObserverLoadingErrorResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverLoadingResult`](../interfaces/QueryObserverLoadingResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverPendingResult`](../interfaces/QueryObserverPendingResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverPlaceholderResult`](../interfaces/QueryObserverPlaceholderResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverRefetchErrorResult`](../interfaces/QueryObserverRefetchErrorResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverSuccessResult`](../interfaces/QueryObserverSuccessResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverLoadingErrorResult`](../interfaces/QueryObserverLoadingErrorResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverLoadingResult`](../interfaces/QueryObserverLoadingResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverPendingResult`](../interfaces/QueryObserverPendingResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverPlaceholderResult`](../interfaces/QueryObserverPlaceholderResult.md)\<`unknown`, `unknown`\>)[] = `T` *extends* \[\] ? \[\] : `T` *extends* \[`Head`\] ? \[`GetResults`\<`Head`\>\] : `T` *extends* \[`Head`, `...Tail[]`\] ? \[`...Tail[]`\] *extends* \[\] ? \[\] : \[`...Tail[]`\] *extends* \[`Head`\] ? \[`GetResults`\<`Head`\>, `GetResults`\<`Head`\>\] : \[`...Tail[]`\] *extends* \[`Head`, `...Tail[]`\] ? \[`...Tail[]`\] *extends* \[\] ? \[\] : \[`...Tail[]`\] *extends* \[`Head`\] ? \[`GetResults`\<`Head`\>, `GetResults`\<`Head`\>, `GetResults`\<`Head`\>\] : \[`...Tail[]`\] *extends* \[`Head`, `...Tail[]`\] ? \[`...(...)[]`\] *extends* \[\] ? \[\] : ... *extends* ... ? ... : ... : \[`...{ [K in (...)]: (...) }[]`\] : \[...\{ \[K in string \| number \| symbol\]: GetResults\\]\> \}\[\]\] : \{ \[K in string \| number \| symbol\]: GetResults\\]\> \} ## Parameters diff --git a/docs/framework/solid/reference/functions/useQuery.md b/docs/framework/solid/reference/functions/useQuery.md index c92dfc92424..e4b3f8b0e49 100644 --- a/docs/framework/solid/reference/functions/useQuery.md +++ b/docs/framework/solid/reference/functions/useQuery.md @@ -11,7 +11,7 @@ redirect_from: function useQuery(options, queryClient?): UseQueryResult; ``` -Defined in: [useQuery.ts:178](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useQuery.ts#L178) +Defined in: [packages/solid-query/src/useQuery.ts:178](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useQuery.ts#L178) ### Type Parameters @@ -212,7 +212,7 @@ function Posts() { function useQuery(options, queryClient?): DefinedUseQueryResult; ``` -Defined in: [useQuery.ts:226](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useQuery.ts#L226) +Defined in: [packages/solid-query/src/useQuery.ts:226](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useQuery.ts#L226) This overload is selected when `initialData` is set, so the resulting `data` is never `undefined`. diff --git a/docs/framework/solid/reference/functions/useQueryClient.md b/docs/framework/solid/reference/functions/useQueryClient.md index 08f58f974bc..7aa8ddbe675 100644 --- a/docs/framework/solid/reference/functions/useQueryClient.md +++ b/docs/framework/solid/reference/functions/useQueryClient.md @@ -7,7 +7,7 @@ title: useQueryClient function useQueryClient(queryClient?): QueryClient; ``` -Defined in: [QueryClientProvider.tsx:28](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClientProvider.tsx#L28) +Defined in: [packages/solid-query/src/QueryClientProvider.tsx:28](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClientProvider.tsx#L28) The `useQueryClient` hook returns the current `QueryClient` instance. diff --git a/docs/framework/solid/reference/index.md b/docs/framework/solid/reference/index.md index 72ac491bd8e..d95777b39bc 100644 --- a/docs/framework/solid/reference/index.md +++ b/docs/framework/solid/reference/index.md @@ -5,29 +5,145 @@ title: "@tanstack/solid-query" ## Classes +- [CancelledError](classes/CancelledError.md) +- [InfiniteQueryObserver](classes/InfiniteQueryObserver.md) +- [Mutation](classes/Mutation.md) +- [MutationCache](classes/MutationCache.md) +- [MutationObserver](classes/MutationObserver.md) +- [QueriesObserver](classes/QueriesObserver.md) +- [Query](classes/Query.md) +- [QueryCache](classes/QueryCache.md) - [QueryClient](classes/QueryClient.md) +- [QueryObserver](classes/QueryObserver.md) ## Interfaces +- [CancelOptions](interfaces/CancelOptions.md) - [DefaultOptions](interfaces/DefaultOptions.md) +- [DehydratedState](interfaces/DehydratedState.md) +- [DehydrateOptions](interfaces/DehydrateOptions.md) +- [~~EnsureQueryDataOptions~~](interfaces/EnsureQueryDataOptions.md) +- [FetchNextPageOptions](interfaces/FetchNextPageOptions.md) +- [FetchPreviousPageOptions](interfaces/FetchPreviousPageOptions.md) +- [~~FetchQueryOptions~~](interfaces/FetchQueryOptions.md) +- [HydrateOptions](interfaces/HydrateOptions.md) +- [InfiniteData](interfaces/InfiniteData.md) +- [InfiniteQueryObserverBaseResult](interfaces/InfiniteQueryObserverBaseResult.md) +- [InfiniteQueryObserverLoadingErrorResult](interfaces/InfiniteQueryObserverLoadingErrorResult.md) +- [InfiniteQueryObserverLoadingResult](interfaces/InfiniteQueryObserverLoadingResult.md) - [InfiniteQueryObserverOptions](interfaces/InfiniteQueryObserverOptions.md) +- [InfiniteQueryObserverPendingResult](interfaces/InfiniteQueryObserverPendingResult.md) +- [InfiniteQueryObserverPlaceholderResult](interfaces/InfiniteQueryObserverPlaceholderResult.md) +- [InfiniteQueryObserverRefetchErrorResult](interfaces/InfiniteQueryObserverRefetchErrorResult.md) +- [InfiniteQueryObserverSuccessResult](interfaces/InfiniteQueryObserverSuccessResult.md) - [InfiniteQueryOptions](interfaces/InfiniteQueryOptions.md) +- [InfiniteQueryPageParamsOptions](interfaces/InfiniteQueryPageParamsOptions.md) +- [InitialPageParam](interfaces/InitialPageParam.md) +- [InvalidateOptions](interfaces/InvalidateOptions.md) +- [InvalidateQueryFilters](interfaces/InvalidateQueryFilters.md) +- [MutateOptions](interfaces/MutateOptions.md) +- [MutationCacheConfig](interfaces/MutationCacheConfig.md) +- [MutationFilters](interfaces/MutationFilters.md) +- [MutationObserverBaseResult](interfaces/MutationObserverBaseResult.md) +- [MutationObserverErrorResult](interfaces/MutationObserverErrorResult.md) +- [MutationObserverIdleResult](interfaces/MutationObserverIdleResult.md) +- [MutationObserverLoadingResult](interfaces/MutationObserverLoadingResult.md) +- [MutationObserverOptions](interfaces/MutationObserverOptions.md) +- [MutationObserverSuccessResult](interfaces/MutationObserverSuccessResult.md) - [MutationOptions](interfaces/MutationOptions.md) +- [MutationState](interfaces/MutationState.md) +- [NotifyEvent](interfaces/NotifyEvent.md) +- [QueriesObserverOptions](interfaces/QueriesObserverOptions.md) +- [QueryCacheConfig](interfaces/QueryCacheConfig.md) - [QueryClientConfig](interfaces/QueryClientConfig.md) +- [QueryExecuteOptions](interfaces/QueryExecuteOptions.md) +- [QueryFilters](interfaces/QueryFilters.md) +- [QueryObserverBaseResult](interfaces/QueryObserverBaseResult.md) +- [QueryObserverLoadingErrorResult](interfaces/QueryObserverLoadingErrorResult.md) +- [QueryObserverLoadingResult](interfaces/QueryObserverLoadingResult.md) - [QueryObserverOptions](interfaces/QueryObserverOptions.md) +- [QueryObserverPendingResult](interfaces/QueryObserverPendingResult.md) +- [QueryObserverPlaceholderResult](interfaces/QueryObserverPlaceholderResult.md) +- [QueryObserverRefetchErrorResult](interfaces/QueryObserverRefetchErrorResult.md) +- [QueryObserverSuccessResult](interfaces/QueryObserverSuccessResult.md) - [QueryOptions](interfaces/QueryOptions.md) +- [QueryState](interfaces/QueryState.md) +- [RefetchOptions](interfaces/RefetchOptions.md) +- [RefetchQueryFilters](interfaces/RefetchQueryFilters.md) +- [Register](interfaces/Register.md) +- [ResetOptions](interfaces/ResetOptions.md) +- [ResultOptions](interfaces/ResultOptions.md) +- [SetDataOptions](interfaces/SetDataOptions.md) - [UseBaseQueryOptions](interfaces/UseBaseQueryOptions.md) ## Type Aliases +- [AnyDataTag](type-aliases/AnyDataTag.md) +- [DataTag](type-aliases/DataTag.md) +- [dataTagErrorSymbol](type-aliases/dataTagErrorSymbol.md) +- [dataTagSymbol](type-aliases/dataTagSymbol.md) +- [DefaultedInfiniteQueryObserverOptions](type-aliases/DefaultedInfiniteQueryObserverOptions.md) +- [DefaultedQueryObserverOptions](type-aliases/DefaultedQueryObserverOptions.md) +- [DefaultError](type-aliases/DefaultError.md) +- [DefinedInfiniteQueryObserverResult](type-aliases/DefinedInfiniteQueryObserverResult.md) - [DefinedInitialDataInfiniteOptions](type-aliases/DefinedInitialDataInfiniteOptions.md) - [DefinedInitialDataOptions](type-aliases/DefinedInitialDataOptions.md) +- [DefinedQueryObserverResult](type-aliases/DefinedQueryObserverResult.md) - [DefinedUseBaseQueryResult](type-aliases/DefinedUseBaseQueryResult.md) - [DefinedUseInfiniteQueryResult](type-aliases/DefinedUseInfiniteQueryResult.md) - [DefinedUseQueryResult](type-aliases/DefinedUseQueryResult.md) +- [DistributiveOmit](type-aliases/DistributiveOmit.md) +- [~~EnsureInfiniteQueryDataOptions~~](type-aliases/EnsureInfiniteQueryDataOptions.md) +- [~~FetchInfiniteQueryOptions~~](type-aliases/FetchInfiniteQueryOptions.md) +- [FetchStatus](type-aliases/FetchStatus.md) +- [GetNextPageParamFunction](type-aliases/GetNextPageParamFunction.md) +- [GetPreviousPageParamFunction](type-aliases/GetPreviousPageParamFunction.md) +- [InferDataFromTag](type-aliases/InferDataFromTag.md) +- [InferErrorFromTag](type-aliases/InferErrorFromTag.md) +- [InfiniteQueryExecuteOptions](type-aliases/InfiniteQueryExecuteOptions.md) +- [InfiniteQueryObserverResult](type-aliases/InfiniteQueryObserverResult.md) +- [InitialDataFunction](type-aliases/InitialDataFunction.md) +- [ManagedTimerId](type-aliases/ManagedTimerId.md) +- [MutateFunction](type-aliases/MutateFunction.md) +- [MutateFunctionRest](type-aliases/MutateFunctionRest.md) +- [MutationCacheNotifyEvent](type-aliases/MutationCacheNotifyEvent.md) +- [MutationFunction](type-aliases/MutationFunction.md) +- [MutationFunctionContext](type-aliases/MutationFunctionContext.md) +- [MutationKey](type-aliases/MutationKey.md) +- [MutationMeta](type-aliases/MutationMeta.md) +- [MutationObserverResult](type-aliases/MutationObserverResult.md) +- [MutationScope](type-aliases/MutationScope.md) +- [MutationStatus](type-aliases/MutationStatus.md) +- [NetworkMode](type-aliases/NetworkMode.md) +- [NonUndefinedGuard](type-aliases/NonUndefinedGuard.md) +- [NotifyEventType](type-aliases/NotifyEventType.md) +- [NotifyOnChangeProps](type-aliases/NotifyOnChangeProps.md) +- [OmitKeyof](type-aliases/OmitKeyof.md) +- [Override](type-aliases/Override.md) +- [PlaceholderDataFunction](type-aliases/PlaceholderDataFunction.md) +- [QueriesPlaceholderDataFunction](type-aliases/QueriesPlaceholderDataFunction.md) +- [QueryBooleanOption](type-aliases/QueryBooleanOption.md) +- [QueryCacheNotifyEvent](type-aliases/QueryCacheNotifyEvent.md) - [QueryClientProviderProps](type-aliases/QueryClientProviderProps.md) +- [QueryFunction](type-aliases/QueryFunction.md) +- [QueryFunctionContext](type-aliases/QueryFunctionContext.md) +- [QueryKey](type-aliases/QueryKey.md) +- [QueryKeyHashFunction](type-aliases/QueryKeyHashFunction.md) +- [QueryKeyWithDataTag](type-aliases/QueryKeyWithDataTag.md) +- [QueryMeta](type-aliases/QueryMeta.md) +- [QueryObserverResult](type-aliases/QueryObserverResult.md) +- [QueryPersister](type-aliases/QueryPersister.md) +- [QueryStatus](type-aliases/QueryStatus.md) +- [SkipToken](type-aliases/SkipToken.md) +- [StaleTime](type-aliases/StaleTime.md) +- [StaleTimeFunction](type-aliases/StaleTimeFunction.md) +- [ThrowOnError](type-aliases/ThrowOnError.md) +- [TimeoutCallback](type-aliases/TimeoutCallback.md) +- [TimeoutProvider](type-aliases/TimeoutProvider.md) - [UndefinedInitialDataInfiniteOptions](type-aliases/UndefinedInitialDataInfiniteOptions.md) - [UndefinedInitialDataOptions](type-aliases/UndefinedInitialDataOptions.md) +- [UnsetMarker](type-aliases/UnsetMarker.md) +- [Updater](type-aliases/Updater.md) - [UseBaseMutationResult](type-aliases/UseBaseMutationResult.md) - [UseBaseQueryResult](type-aliases/UseBaseQueryResult.md) - [UseInfiniteQueryOptions](type-aliases/UseInfiniteQueryOptions.md) @@ -38,6 +154,7 @@ title: "@tanstack/solid-query" - [UseMutationResult](type-aliases/UseMutationResult.md) - [UseQueryOptions](type-aliases/UseQueryOptions.md) - [UseQueryResult](type-aliases/UseQueryResult.md) +- [WithRequired](type-aliases/WithRequired.md) ## Variables @@ -45,15 +162,41 @@ title: "@tanstack/solid-query" - [createMutation](variables/createMutation.md) - [createQueries](variables/createQueries.md) - [createQuery](variables/createQuery.md) +- [dataTagErrorSymbol](variables/dataTagErrorSymbol.md) +- [dataTagSymbol](variables/dataTagSymbol.md) +- [defaultScheduler](variables/defaultScheduler.md) +- [environmentManager](variables/environmentManager.md) +- [focusManager](variables/focusManager.md) - [IsRestoringProvider](variables/IsRestoringProvider.md) +- [~~isServer~~](variables/isServer.md) +- [notifyManager](variables/notifyManager.md) +- [onlineManager](variables/onlineManager.md) - [QueryClientContext](variables/QueryClientContext.md) +- [skipToken](variables/skipToken.md) +- [timeoutManager](variables/timeoutManager.md) +- [unsetMarker](variables/unsetMarker.md) ## Functions +- [defaultShouldDehydrateMutation](functions/defaultShouldDehydrateMutation.md) +- [defaultShouldDehydrateQuery](functions/defaultShouldDehydrateQuery.md) +- [dehydrate](functions/dehydrate.md) +- [dehydrateQuery](functions/dehydrateQuery.md) +- [experimental\_streamedQuery](functions/experimental_streamedQuery.md) +- [hashKey](functions/hashKey.md) +- [hydrate](functions/hydrate.md) - [infiniteQueryOptions](functions/infiniteQueryOptions.md) +- [~~isCancelledError~~](functions/isCancelledError.md) +- [keepPreviousData](functions/keepPreviousData.md) +- [matchMutation](functions/matchMutation.md) +- [matchQuery](functions/matchQuery.md) - [mutationOptions](functions/mutationOptions.md) +- [noop](functions/noop.md) +- [partialMatchKey](functions/partialMatchKey.md) - [QueryClientProvider](functions/QueryClientProvider.md) - [queryOptions](functions/queryOptions.md) +- [replaceEqualDeep](functions/replaceEqualDeep.md) +- [shouldThrowError](functions/shouldThrowError.md) - [useInfiniteQuery](functions/useInfiniteQuery.md) - [useIsFetching](functions/useIsFetching.md) - [useIsMutating](functions/useIsMutating.md) diff --git a/docs/framework/solid/reference/interfaces/CancelOptions.md b/docs/framework/solid/reference/interfaces/CancelOptions.md new file mode 100644 index 00000000000..2b9293712d2 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/CancelOptions.md @@ -0,0 +1,26 @@ +--- +id: CancelOptions +title: CancelOptions +--- + +Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) + +## Properties + +### revert? + +```ts +optional revert: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1444) + +*** + +### silent? + +```ts +optional silent: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1445](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1445) diff --git a/docs/framework/solid/reference/interfaces/DefaultOptions.md b/docs/framework/solid/reference/interfaces/DefaultOptions.md index 50e7ba42e2d..cfd8f46c3e9 100644 --- a/docs/framework/solid/reference/interfaces/DefaultOptions.md +++ b/docs/framework/solid/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [QueryClient.ts:96](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L96) +Defined in: [packages/solid-query/src/QueryClient.ts:96](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L96) The default options a `QueryClient` applies to every query, with Solid's `reconcile` option added to `queries`. @@ -16,19 +16,91 @@ The default options a `QueryClient` applies to every query, with Solid's `reconc ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The default type of errors thrown by queries and mutations using this `QueryClient`. ## Properties +### dehydrate? + +```ts +optional dehydrate: DehydrateOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) + +#### Inherited from + +```ts +CoreDefaultOptions.dehydrate +``` + +*** + +### hydrate? + +```ts +optional hydrate: object; +``` + +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) + +#### deserializeData? + +```ts +optional deserializeData: TransformerFn; +``` + +Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. + +#### mutations? + +```ts +optional mutations: MutationOptions; +``` + +Default options merged into every mutation restored from the dehydrated state. + +#### queries? + +```ts +optional queries: QueryOptions; +``` + +Default options merged into every query restored from the dehydrated state. + +#### Inherited from + +```ts +CoreDefaultOptions.hydrate +``` + +*** + +### mutations? + +```ts +optional mutations: MutationObserverOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) + +#### Inherited from + +```ts +CoreDefaultOptions.mutations +``` + +*** + ### queries? ```ts optional queries: OmitKeyof, "queryKey">; ``` -Defined in: [QueryClient.ts:99](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L99) +Defined in: [packages/solid-query/src/QueryClient.ts:99](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L99) #### Overrides diff --git a/docs/framework/solid/reference/interfaces/DehydrateOptions.md b/docs/framework/solid/reference/interfaces/DehydrateOptions.md new file mode 100644 index 00000000000..e862ae88b43 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/DehydrateOptions.md @@ -0,0 +1,89 @@ +--- +id: DehydrateOptions +title: DehydrateOptions +--- + +Defined in: [packages/query-core/src/hydration.ts:42](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L42) + +Options for `dehydrate`, controlling which queries/mutations are included in the resulting `DehydratedState` and +how their data/errors are transformed before being serialized (e.g. for embedding in server-rendered markup). + +## Properties + +### serializeData? + +```ts +optional serializeData: TransformerFn; +``` + +Defined in: [packages/query-core/src/hydration.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L44) + +Transforms a query's `data` before it is dehydrated. Useful for non-JSON-serializable data. + +*** + +### shouldDehydrateMutation()? + +```ts +optional shouldDehydrateMutation: (mutation) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:46](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L46) + +Predicate to decide whether a given `Mutation` should be dehydrated. Defaults to `defaultShouldDehydrateMutation`. + +#### Parameters + +##### mutation + +[`Mutation`](../classes/Mutation.md) + +#### Returns + +`boolean` + +*** + +### shouldDehydrateQuery()? + +```ts +optional shouldDehydrateQuery: (query) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:48](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L48) + +Predicate to decide whether a given `Query` should be dehydrated. Defaults to `defaultShouldDehydrateQuery`. + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +*** + +### shouldRedactErrors()? + +```ts +optional shouldRedactErrors: (error) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L54) + +Predicate to decide whether a query's error should be redacted before dehydration. Errors are redacted +(replaced with a generic `Error('redacted')`) unless this function is provided and returns `false` for the +given error, in which case the original error is kept. + +#### Parameters + +##### error + +`unknown` + +#### Returns + +`boolean` diff --git a/docs/framework/solid/reference/interfaces/DehydratedState.md b/docs/framework/solid/reference/interfaces/DehydratedState.md new file mode 100644 index 00000000000..7edce60a00d --- /dev/null +++ b/docs/framework/solid/reference/interfaces/DehydratedState.md @@ -0,0 +1,30 @@ +--- +id: DehydratedState +title: DehydratedState +--- + +Defined in: [packages/query-core/src/hydration.ts:97](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L97) + +A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically +transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data +that has already been fetched, avoiding a redundant fetch on the client. + +## Properties + +### mutations + +```ts +mutations: DehydratedMutation[]; +``` + +Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L98) + +*** + +### queries + +```ts +queries: DehydratedQuery[]; +``` + +Defined in: [packages/query-core/src/hydration.ts:99](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L99) diff --git a/docs/framework/solid/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/solid/reference/interfaces/EnsureQueryDataOptions.md new file mode 100644 index 00000000000..d7b4751a9d3 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/EnsureQueryDataOptions.md @@ -0,0 +1,343 @@ +--- +id: EnsureQueryDataOptions +title: EnsureQueryDataOptions +--- + +Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) + +## Deprecated + +## Extends + +- [`FetchQueryOptions`](FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### ~~gcTime?~~ + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`gcTime`](FetchQueryOptions.md#gctime) + +*** + +### ~~initialData?~~ + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialData`](FetchQueryOptions.md#initialdata) + +*** + +### ~~initialDataUpdatedAt?~~ + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialDataUpdatedAt`](FetchQueryOptions.md#initialdataupdatedat) + +*** + +### ~~initialPageParam?~~ + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialPageParam`](FetchQueryOptions.md#initialpageparam) + +*** + +### ~~maxPages?~~ + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`maxPages`](FetchQueryOptions.md#maxpages) + +*** + +### ~~meta?~~ + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`meta`](FetchQueryOptions.md#meta) + +*** + +### ~~networkMode?~~ + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`networkMode`](FetchQueryOptions.md#networkmode) + +*** + +### ~~persister?~~ + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`persister`](FetchQueryOptions.md#persister) + +*** + +### ~~queryFn?~~ + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryFn`](FetchQueryOptions.md#queryfn) + +*** + +### ~~queryHash?~~ + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryHash`](FetchQueryOptions.md#queryhash) + +*** + +### ~~queryKey~~ + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryKey`](FetchQueryOptions.md#querykey) + +*** + +### ~~queryKeyHashFn?~~ + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryKeyHashFn`](FetchQueryOptions.md#querykeyhashfn) + +*** + +### ~~retry?~~ + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`retry`](FetchQueryOptions.md#retry) + +*** + +### ~~retryDelay?~~ + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`retryDelay`](FetchQueryOptions.md#retrydelay) + +*** + +### ~~revalidateIfStale?~~ + +```ts +optional revalidateIfStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L608) + +*** + +### ~~staleTime?~~ + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`staleTime`](FetchQueryOptions.md#staletime) + +*** + +### ~~structuralSharing?~~ + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`structuralSharing`](FetchQueryOptions.md#structuralsharing) diff --git a/docs/framework/solid/reference/interfaces/FetchNextPageOptions.md b/docs/framework/solid/reference/interfaces/FetchNextPageOptions.md new file mode 100644 index 00000000000..fefe7f30c13 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/FetchNextPageOptions.md @@ -0,0 +1,41 @@ +--- +id: FetchNextPageOptions +title: FetchNextPageOptions +--- + +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) + +If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, +whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + +If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/solid/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/solid/reference/interfaces/FetchPreviousPageOptions.md new file mode 100644 index 00000000000..ad3c3c736c9 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/FetchPreviousPageOptions.md @@ -0,0 +1,41 @@ +--- +id: FetchPreviousPageOptions +title: FetchPreviousPageOptions +--- + +Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) + +If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, +whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + +If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/solid/reference/interfaces/FetchQueryOptions.md b/docs/framework/solid/reference/interfaces/FetchQueryOptions.md new file mode 100644 index 00000000000..27d7aa63d3d --- /dev/null +++ b/docs/framework/solid/reference/interfaces/FetchQueryOptions.md @@ -0,0 +1,357 @@ +--- +id: FetchQueryOptions +title: FetchQueryOptions +--- + +Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L576) + +## Deprecated + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<`QueryOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Extended by + +- [`EnsureQueryDataOptions`](EnsureQueryDataOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### ~~gcTime?~~ + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### ~~initialData?~~ + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### ~~initialDataUpdatedAt?~~ + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### ~~initialPageParam?~~ + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) + +*** + +### ~~maxPages?~~ + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### ~~meta?~~ + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### ~~networkMode?~~ + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### ~~persister?~~ + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### ~~queryFn?~~ + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### ~~queryHash?~~ + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### ~~queryKey~~ + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### ~~queryKeyHashFn?~~ + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### ~~retry?~~ + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### ~~retryDelay?~~ + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### ~~staleTime?~~ + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +*** + +### ~~structuralSharing?~~ + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` diff --git a/docs/framework/solid/reference/interfaces/HydrateOptions.md b/docs/framework/solid/reference/interfaces/HydrateOptions.md new file mode 100644 index 00000000000..fe8b92317e3 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/HydrateOptions.md @@ -0,0 +1,43 @@ +--- +id: HydrateOptions +title: HydrateOptions +--- + +Defined in: [packages/query-core/src/hydration.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L61) + +Options for `hydrate`, controlling the default options applied to queries/mutations restored from a +`DehydratedState`, and how to reverse any transformation applied by `DehydrateOptions.serializeData`. + +## Properties + +### defaultOptions? + +```ts +optional defaultOptions: object; +``` + +Defined in: [packages/query-core/src/hydration.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L62) + +#### deserializeData? + +```ts +optional deserializeData: TransformerFn; +``` + +Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. + +#### mutations? + +```ts +optional mutations: MutationOptions; +``` + +Default options merged into every mutation restored from the dehydrated state. + +#### queries? + +```ts +optional queries: QueryOptions; +``` + +Default options merged into every query restored from the dehydrated state. diff --git a/docs/framework/solid/reference/interfaces/InfiniteData.md b/docs/framework/solid/reference/interfaces/InfiniteData.md new file mode 100644 index 00000000000..4d7ad595c2d --- /dev/null +++ b/docs/framework/solid/reference/interfaces/InfiniteData.md @@ -0,0 +1,36 @@ +--- +id: InfiniteData +title: InfiniteData +--- + +Defined in: [packages/query-core/src/types.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L210) + +## Type Parameters + +### TData + +`TData` + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### pageParams + +```ts +pageParams: TPageParam[]; +``` + +Defined in: [packages/query-core/src/types.ts:212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L212) + +*** + +### pages + +```ts +pages: TData[]; +``` + +Defined in: [packages/query-core/src/types.ts:211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L211) diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverBaseResult.md new file mode 100644 index 00000000000..94347ea2e40 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -0,0 +1,577 @@ +--- +id: InfiniteQueryObserverBaseResult +title: InfiniteQueryObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Extended by + +- [`InfiniteQueryObserverPendingResult`](InfiniteQueryObserverPendingResult.md) +- [`InfiniteQueryObserverLoadingResult`](InfiniteQueryObserverLoadingResult.md) +- [`InfiniteQueryObserverLoadingErrorResult`](InfiniteQueryObserverLoadingErrorResult.md) +- [`InfiniteQueryObserverRefetchErrorResult`](InfiniteQueryObserverRefetchErrorResult.md) +- [`InfiniteQueryObserverSuccessResult`](InfiniteQueryObserverSuccessResult.md) +- [`InfiniteQueryObserverPlaceholderResult`](InfiniteQueryObserverPlaceholderResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) + +The last successfully resolved data for the query. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) + +Will be `true` if the query failed while fetching the next page. + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) + +Will be `true` if the query failed while fetching the previous page. + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) + +Will be `true` if the query failed while fetching for the first time. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) + +Will be `true` if the data shown is the placeholder data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) + +Will be `true` if the query failed while refetching. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md new file mode 100644 index 00000000000..3e0d3a79fa1 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverLoadingErrorResult +title: InfiniteQueryObserverLoadingErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult.md new file mode 100644 index 00000000000..f6400f44b52 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverLoadingResult +title: InfiniteQueryObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: true; +``` + +Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverOptions.md index dfd2f69f412..0427ea694eb 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverOptions.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverOptions.md @@ -3,13 +3,13 @@ id: InfiniteQueryObserverOptions title: InfiniteQueryObserverOptions --- -Defined in: [QueryClient.ts:62](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L62) +Defined in: [packages/solid-query/src/QueryClient.ts:62](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L62) The core `InfiniteQueryObserverOptions`, with Solid's `reconcile` option added. ## Extends -- `OmitKeyof`\<`QueryCoreInfiniteQueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"structuralSharing"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<`QueryCoreInfiniteQueryObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"structuralSharing"`\> ## Type Parameters @@ -21,7 +21,7 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. @@ -33,7 +33,7 @@ The type `data` ends up as after `select` runs. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. @@ -45,15 +45,618 @@ The type of the parameter passed to `queryFn` to fetch a given page. ## Properties +### enabled? + +```ts +optional enabled: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.enabled +``` + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`gcTime`](QueryExecuteOptions.md#gctime) + +*** + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +#### Inherited from + +```ts +OmitKeyof.getNextPageParam +``` + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +#### Inherited from + +```ts +OmitKeyof.getPreviousPageParam +``` + +*** + +### initialData? + +```ts +optional initialData: + | InfiniteData +| InitialDataFunction>; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +OmitKeyof.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +OmitKeyof.initialDataUpdatedAt +``` + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +```ts +OmitKeyof.initialPageParam +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`maxPages`](QueryExecuteOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`meta`](QueryExecuteOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`networkMode`](QueryExecuteOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +```ts +OmitKeyof.notifyOnChangeProps +``` + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +OmitKeyof.persister +``` + +*** + +### placeholderData? + +```ts +optional placeholderData: + | InfiniteData +| PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +```ts +OmitKeyof.placeholderData +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +OmitKeyof.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`queryHash`](QueryExecuteOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +OmitKeyof.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +OmitKeyof.queryKeyHashFn +``` + +*** + ### reconcile? ```ts optional reconcile: string | false | (oldData, newData) => TData; ``` -Defined in: [QueryClient.ts:84](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L84) +Defined in: [packages/solid-query/src/QueryClient.ts:84](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L84) Set this to a reconciliation key to enable reconciliation between query results. Set this to `false` to disable reconciliation between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom reconciliation logic. Defaults reconciliation to false. + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchInterval +``` + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchIntervalInBackground +``` + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnMount +``` + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnReconnect +``` + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnWindowFocus +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.retryOnMount +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +[`InfiniteData`](InfiniteData.md) + +#### Returns + +`TData` + +#### Inherited from + +```ts +OmitKeyof.select +``` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +```ts +OmitKeyof.staleTime +``` + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.suspense +``` + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.throwOnError +``` diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult.md new file mode 100644 index 00000000000..53d910f545d --- /dev/null +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverPendingResult +title: InfiniteQueryObserverPendingResult +--- + +Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1009) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1013](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1013) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1017](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1017) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1016](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1016) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1021](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1021) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1023](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1023) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md new file mode 100644 index 00000000000..5949179bc6f --- /dev/null +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverPlaceholderResult +title: InfiniteQueryObserverPlaceholderResult +--- + +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: true; +``` + +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md new file mode 100644 index 00000000000..e299e60ddc3 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverRefetchErrorResult +title: InfiniteQueryObserverRefetchErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) + +Will be `true` if the query failed while fetching the next page. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) + +Will be `true` if the query failed while fetching the previous page. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult.md new file mode 100644 index 00000000000..7b550e0a90b --- /dev/null +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverSuccessResult +title: InfiniteQueryObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryOptions.md b/docs/framework/solid/reference/interfaces/InfiniteQueryOptions.md index 1b0803cef0d..5b5270a618d 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryOptions.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryOptions.md @@ -3,13 +3,13 @@ id: InfiniteQueryOptions title: InfiniteQueryOptions --- -Defined in: [types.ts:157](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L157) +Defined in: [packages/solid-query/src/types.ts:157](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L157) The options accepted by `useInfiniteQuery`. ## Extends -- `OmitKeyof`\<[`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"queryKey"` \| `"suspense"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"queryKey"` \| `"suspense"`\> ## Type Parameters @@ -21,7 +21,7 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. @@ -33,7 +33,7 @@ The type `data` ends up as after `select` runs. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. @@ -51,7 +51,7 @@ The type of the parameter passed to `queryFn` to fetch a given page. optional deferStream: boolean; ``` -Defined in: [types.ts:180](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L180) +Defined in: [packages/solid-query/src/types.ts:180](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L180) Only applicable while rendering queries on the server with streaming. Set `deferStream` to `true` to wait for the query to resolve on the server before flushing the stream. @@ -60,13 +60,327 @@ Defaults to `false`. *** +### enabled? + +```ts +optional enabled: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.enabled +``` + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`gcTime`](QueryExecuteOptions.md#gctime) + +*** + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +#### Inherited from + +```ts +OmitKeyof.getNextPageParam +``` + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +#### Inherited from + +```ts +OmitKeyof.getPreviousPageParam +``` + +*** + +### initialData? + +```ts +optional initialData: + | InfiniteData +| InitialDataFunction>; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +OmitKeyof.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +OmitKeyof.initialDataUpdatedAt +``` + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +```ts +OmitKeyof.initialPageParam +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`maxPages`](QueryExecuteOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`meta`](QueryExecuteOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`networkMode`](QueryExecuteOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +```ts +OmitKeyof.notifyOnChangeProps +``` + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +OmitKeyof.persister +``` + +*** + +### placeholderData? + +```ts +optional placeholderData: + | InfiniteData +| PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +```ts +OmitKeyof.placeholderData +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +OmitKeyof.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`queryHash`](QueryExecuteOptions.md#queryhash) + +*** + ### queryKey ```ts queryKey: TQueryKey; ``` -Defined in: [types.ts:173](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L173) +Defined in: [packages/solid-query/src/types.ts:173](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L173) + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +OmitKeyof.queryKeyHashFn +``` *** @@ -76,7 +390,7 @@ Defined in: [types.ts:173](https://github.com/TanStack/query/blob/main/packages/ optional reconcile: string | false | (oldData, newData) => TData; ``` -Defined in: [QueryClient.ts:84](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L84) +Defined in: [packages/solid-query/src/QueryClient.ts:84](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L84) Set this to a reconciliation key to enable reconciliation between query results. Set this to `false` to disable reconciliation between query results. @@ -91,16 +405,262 @@ OmitKeyof.reconcile *** +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchInterval +``` + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchIntervalInBackground +``` + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnMount +``` + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnReconnect +``` + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnWindowFocus +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.retryOnMount +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +[`InfiniteData`](InfiniteData.md) + +#### Returns + +`TData` + +#### Inherited from + +```ts +OmitKeyof.select +``` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +```ts +OmitKeyof.staleTime +``` + +*** + ### ~~suspense?~~ ```ts optional suspense: boolean; ``` -Defined in: [types.ts:186](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L186) +Defined in: [packages/solid-query/src/types.ts:186](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L186) #### Deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version. The `data` property on useInfiniteQuery is a SolidJS resource and will automatically suspend when the data is loading. Setting `suspense` to `false` will be a no-op. + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.throwOnError +``` diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/solid/reference/interfaces/InfiniteQueryPageParamsOptions.md new file mode 100644 index 00000000000..fe9de05a51e --- /dev/null +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -0,0 +1,60 @@ +--- +id: InfiniteQueryPageParamsOptions +title: InfiniteQueryPageParamsOptions +--- + +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) + +## Extends + +- [`InitialPageParam`](InitialPageParam.md)\<`TPageParam`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +[`InitialPageParam`](InitialPageParam.md).[`initialPageParam`](InitialPageParam.md#initialpageparam) diff --git a/docs/framework/solid/reference/interfaces/InitialPageParam.md b/docs/framework/solid/reference/interfaces/InitialPageParam.md new file mode 100644 index 00000000000..ffbf32ae0d6 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/InitialPageParam.md @@ -0,0 +1,26 @@ +--- +id: InitialPageParam +title: InitialPageParam +--- + +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) + +## Extended by + +- [`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md) + +## Type Parameters + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) diff --git a/docs/framework/solid/reference/interfaces/InvalidateOptions.md b/docs/framework/solid/reference/interfaces/InvalidateOptions.md new file mode 100644 index 00000000000..494afe1c465 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/InvalidateOptions.md @@ -0,0 +1,44 @@ +--- +id: InvalidateOptions +title: InvalidateOptions +--- + +Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L700) + +## Extends + +- [`RefetchOptions`](RefetchOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`cancelRefetch`](RefetchOptions.md#cancelrefetch) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`throwOnError`](RefetchOptions.md#throwonerror) diff --git a/docs/framework/solid/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/solid/reference/interfaces/InvalidateQueryFilters.md new file mode 100644 index 00000000000..4824d80d910 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/InvalidateQueryFilters.md @@ -0,0 +1,135 @@ +--- +id: InvalidateQueryFilters +title: InvalidateQueryFilters +--- + +Defined in: [packages/query-core/src/types.ts:690](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L690) + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extends + +- [`QueryFilters`](QueryFilters.md)\<`TQueryKey`\> + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`exact`](QueryFilters.md#exact) + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`fetchStatus`](QueryFilters.md#fetchstatus) + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`predicate`](QueryFilters.md#predicate) + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`queryKey`](QueryFilters.md#querykey) + +*** + +### refetchType? + +```ts +optional refetchType: QueryTypeFilter | "none"; +``` + +Defined in: [packages/query-core/src/types.ts:693](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L693) + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`stale`](QueryFilters.md#stale) + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/solid/reference/interfaces/MutateOptions.md b/docs/framework/solid/reference/interfaces/MutateOptions.md new file mode 100644 index 00000000000..a0af091a997 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/MutateOptions.md @@ -0,0 +1,124 @@ +--- +id: MutateOptions +title: MutateOptions +--- + +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1228) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1234) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1222](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1222) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` diff --git a/docs/framework/solid/reference/interfaces/MutationCacheConfig.md b/docs/framework/solid/reference/interfaces/MutationCacheConfig.md new file mode 100644 index 00000000000..c38d2dc26f4 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/MutationCacheConfig.md @@ -0,0 +1,161 @@ +--- +id: MutationCacheConfig +title: MutationCacheConfig +--- + +Defined in: [packages/query-core/src/mutationCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L26) + +Global callbacks that fire for every mutation handled by a `MutationCache`, regardless of which +component or observer triggered it. They differ from the `defaultOptions` provided to a +`QueryClient` in two ways: `defaultOptions` can be overridden by each mutation, while these +callbacks are always called, and `onMutate` here does not allow returning a result. + +If a callback returns a promise, it will be awaited before the mutation continues. + +## Properties + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L28) + +Called when any mutation in the cache encounters an error. + +#### Parameters + +##### error + +`Error` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L44) + +Called before any mutation in the cache executes. + +#### Parameters + +##### variables + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:50](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L50) + +Called when any mutation in the cache is settled, either successfully or with an error. + +#### Parameters + +##### data + +`unknown` + +##### error + +`Error` | `null` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:36](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L36) + +Called when any mutation in the cache is successful. + +#### Parameters + +##### data + +`unknown` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` diff --git a/docs/framework/solid/reference/interfaces/MutationFilters.md b/docs/framework/solid/reference/interfaces/MutationFilters.md new file mode 100644 index 00000000000..378a411bfe5 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/MutationFilters.md @@ -0,0 +1,85 @@ +--- +id: MutationFilters +title: MutationFilters +--- + +Defined in: [packages/query-core/src/utils.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L62) + +Filters used to select mutations, for example in `mutationCache.findAll` or `queryClient.isMutating`. +All provided filters must match; filters that are left unspecified are ignored. + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L71) + +Match mutation key exactly + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/utils.ts:81](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L81) + +Include mutations matching this mutation key + +*** + +### predicate()? + +```ts +optional predicate: (mutation) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L75) + +Include mutations matching this predicate function + +#### Parameters + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`boolean` + +*** + +### status? + +```ts +optional status: MutationStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L85) + +Filter by mutation status diff --git a/docs/framework/solid/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/solid/reference/interfaces/MutationObserverBaseResult.md new file mode 100644 index 00000000000..98810323966 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/MutationObserverBaseResult.md @@ -0,0 +1,291 @@ +--- +id: MutationObserverBaseResult +title: MutationObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationState`](MutationState.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Extended by + +- [`MutationObserverIdleResult`](MutationObserverIdleResult.md) +- [`MutationObserverLoadingResult`](MutationObserverLoadingResult.md) +- [`MutationObserverErrorResult`](MutationObserverErrorResult.md) +- [`MutationObserverSuccessResult`](MutationObserverSuccessResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationState`](MutationState.md).[`context`](MutationState.md#context) + +*** + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationState`](MutationState.md).[`data`](MutationState.md#data) + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:1285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1285) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationState`](MutationState.md).[`error`](MutationState.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationState`](MutationState.md).[`failureCount`](MutationState.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationState`](MutationState.md).[`failureReason`](MutationState.md#failurereason) + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +*** + +### isIdle + +```ts +isIdle: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1295) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationState`](MutationState.md).[`isPaused`](MutationState.md#ispaused) + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1300](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1300) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1305](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1305) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +*** + +### status + +```ts +status: MutationStatus; +``` + +Defined in: [packages/query-core/src/types.ts:1314](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1314) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationState`](MutationState.md).[`status`](MutationState.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationState`](MutationState.md).[`submittedAt`](MutationState.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationState`](MutationState.md).[`variables`](MutationState.md#variables) diff --git a/docs/framework/solid/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/solid/reference/interfaces/MutationObserverErrorResult.md new file mode 100644 index 00000000000..d61f244ced4 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/MutationObserverErrorResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverErrorResult +title: MutationObserverErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1374](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1374) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1385](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1385) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1386](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1386) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1388](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1388) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1389](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1389) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1390) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/solid/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/solid/reference/interfaces/MutationObserverIdleResult.md new file mode 100644 index 00000000000..93655da0aa5 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/MutationObserverIdleResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverIdleResult +title: MutationObserverIdleResult +--- + +Defined in: [packages/query-core/src/types.ts:1332](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1332) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1346](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1346) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: true; +``` + +Defined in: [packages/query-core/src/types.ts:1347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1347) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1349) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "idle"; +``` + +Defined in: [packages/query-core/src/types.ts:1350](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1350) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/solid/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/solid/reference/interfaces/MutationObserverLoadingResult.md new file mode 100644 index 00000000000..de146c45f5c --- /dev/null +++ b/docs/framework/solid/reference/interfaces/MutationObserverLoadingResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverLoadingResult +title: MutationObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1364](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1364) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1367](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1367) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1369](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1369) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1370](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1370) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1371](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1371) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1365) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/solid/reference/interfaces/MutationObserverOptions.md b/docs/framework/solid/reference/interfaces/MutationObserverOptions.md new file mode 100644 index 00000000000..f1f16d6931b --- /dev/null +++ b/docs/framework/solid/reference/interfaces/MutationObserverOptions.md @@ -0,0 +1,314 @@ +--- +id: MutationObserverOptions +title: MutationObserverOptions +--- + +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) + +## Extends + +- `MutationOptions`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) + +#### Inherited from + +```ts +MutationOptions.gcTime +``` + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) + +#### Inherited from + +```ts +MutationOptions.meta +``` + +*** + +### mutationFn? + +```ts +optional mutationFn: MutationFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) + +#### Inherited from + +```ts +MutationOptions.mutationFn +``` + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) + +#### Inherited from + +```ts +MutationOptions.mutationKey +``` + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) + +#### Inherited from + +```ts +MutationOptions.networkMode +``` + +*** + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +MutationOptions.onError +``` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, context) => TOnMutateResult | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) + +#### Parameters + +##### variables + +`TVariables` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`TOnMutateResult` \| `Promise`\<`TOnMutateResult`\> + +#### Inherited from + +```ts +MutationOptions.onMutate +``` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +MutationOptions.onSettled +``` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +MutationOptions.onSuccess +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) + +#### Inherited from + +```ts +MutationOptions.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) + +#### Inherited from + +```ts +MutationOptions.retryDelay +``` + +*** + +### scope? + +```ts +optional scope: MutationScope; +``` + +Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) + +#### Inherited from + +```ts +MutationOptions.scope +``` + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean | (error) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) diff --git a/docs/framework/solid/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/solid/reference/interfaces/MutationObserverSuccessResult.md new file mode 100644 index 00000000000..b50ec4ab6f1 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/MutationObserverSuccessResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverSuccessResult +title: MutationObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1406](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1406) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1407) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1409) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1410](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1410) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/solid/reference/interfaces/MutationOptions.md b/docs/framework/solid/reference/interfaces/MutationOptions.md index de6ae1a0fc3..a7c20b5ae10 100644 --- a/docs/framework/solid/reference/interfaces/MutationOptions.md +++ b/docs/framework/solid/reference/interfaces/MutationOptions.md @@ -3,13 +3,13 @@ id: MutationOptions title: MutationOptions --- -Defined in: [types.ts:241](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L241) +Defined in: [packages/solid-query/src/types.ts:241](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L241) The options accepted by `useMutation` and `mutationOptions`. ## Extends -- `OmitKeyof`\<`MutationObserverOptions`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"_defaulted"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"_defaulted"`\> ## Type Parameters @@ -21,7 +21,7 @@ The type your `mutationFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `mutationFn` may throw. @@ -36,3 +36,285 @@ The type of the variables your `mutationFn` accepts. `TOnMutateResult` = `unknown` The type returned by `onMutate`, passed on to `onSuccess`/`onError`/`onSettled`. + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) + +#### Inherited from + +[`MutationObserverOptions`](MutationObserverOptions.md).[`gcTime`](MutationObserverOptions.md#gctime) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) + +#### Inherited from + +[`MutationObserverOptions`](MutationObserverOptions.md).[`meta`](MutationObserverOptions.md#meta) + +*** + +### mutationFn? + +```ts +optional mutationFn: MutationFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) + +#### Inherited from + +```ts +OmitKeyof.mutationFn +``` + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) + +#### Inherited from + +[`MutationObserverOptions`](MutationObserverOptions.md).[`mutationKey`](MutationObserverOptions.md#mutationkey) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) + +#### Inherited from + +[`MutationObserverOptions`](MutationObserverOptions.md).[`networkMode`](MutationObserverOptions.md#networkmode) + +*** + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +OmitKeyof.onError +``` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, context) => TOnMutateResult | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) + +#### Parameters + +##### variables + +`TVariables` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`TOnMutateResult` \| `Promise`\<`TOnMutateResult`\> + +#### Inherited from + +```ts +OmitKeyof.onMutate +``` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +OmitKeyof.onSettled +``` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +OmitKeyof.onSuccess +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### scope? + +```ts +optional scope: MutationScope; +``` + +Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) + +#### Inherited from + +[`MutationObserverOptions`](MutationObserverOptions.md).[`scope`](MutationObserverOptions.md#scope) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean | (error) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) + +#### Inherited from + +```ts +OmitKeyof.throwOnError +``` diff --git a/docs/framework/solid/reference/interfaces/MutationState.md b/docs/framework/solid/reference/interfaces/MutationState.md new file mode 100644 index 00000000000..bec050ec1d3 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/MutationState.md @@ -0,0 +1,142 @@ +--- +id: MutationState +title: MutationState +--- + +Defined in: [packages/query-core/src/mutation.ts:30](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L30) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extended by + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +*** + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L44) + +The last successfully resolved data for the mutation. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L49) + +The error object for the mutation, if the last attempt resulted in an error. +- Defaults to `null`. + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +*** + +### status + +```ts +status: MutationStatus; +``` + +Defined in: [packages/query-core/src/mutation.ts:66](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L66) + +The status of the mutation. + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +*** + +### variables + +```ts +variables: TVariables | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L70) + +The variables the mutation was last called with. diff --git a/docs/framework/solid/reference/interfaces/NotifyEvent.md b/docs/framework/solid/reference/interfaces/NotifyEvent.md new file mode 100644 index 00000000000..1dc93464df1 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/NotifyEvent.md @@ -0,0 +1,16 @@ +--- +id: NotifyEvent +title: NotifyEvent +--- + +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) + +## Properties + +### type + +```ts +type: NotifyEventType; +``` + +Defined in: [packages/query-core/src/types.ts:1462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1462) diff --git a/docs/framework/solid/reference/interfaces/QueriesObserverOptions.md b/docs/framework/solid/reference/interfaces/QueriesObserverOptions.md new file mode 100644 index 00000000000..16035c45714 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/QueriesObserverOptions.md @@ -0,0 +1,27 @@ +--- +id: QueriesObserverOptions +title: QueriesObserverOptions +--- + +Defined in: [packages/query-core/src/queriesObserver.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L23) + +## Type Parameters + +### TCombinedResult + +`TCombinedResult` = [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +## Properties + +### combine? + +```ts +optional combine: CombineFn; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L32) + +A function that combines the array of `QueryObserverResult`s (one per +observed query) into a single value. The combined value is memoized and +only recomputed when one of the underlying results, the query hashes, or +the `combine` function itself changes. diff --git a/docs/framework/solid/reference/interfaces/QueryCacheConfig.md b/docs/framework/solid/reference/interfaces/QueryCacheConfig.md new file mode 100644 index 00000000000..69ea600366c --- /dev/null +++ b/docs/framework/solid/reference/interfaces/QueryCacheConfig.md @@ -0,0 +1,92 @@ +--- +id: QueryCacheConfig +title: QueryCacheConfig +--- + +Defined in: [packages/query-core/src/queryCache.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L24) + +Global callbacks that fire for every query handled by a `QueryCache`, regardless of which +component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can +override, these callbacks are always called. + +## Properties + +### onError()? + +```ts +optional onError: (error, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L26) + +Called when any query in the cache encounters an error. + +#### Parameters + +##### error + +`Error` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L33) + +Called when any query in the cache is settled, either successfully or with an error. + +#### Parameters + +##### data + +`unknown` + +##### error + +`Error` | `null` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L31) + +Called when any query in the cache is successful. + +#### Parameters + +##### data + +`unknown` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` diff --git a/docs/framework/solid/reference/interfaces/QueryClientConfig.md b/docs/framework/solid/reference/interfaces/QueryClientConfig.md index f5843d70667..f326a6fb128 100644 --- a/docs/framework/solid/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/solid/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [QueryClient.ts:105](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L105) +Defined in: [packages/solid-query/src/QueryClient.ts:105](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L105) The config accepted by `new QueryClient(config)`, with Solid's extended [DefaultOptions](DefaultOptions.md). @@ -19,10 +19,42 @@ The config accepted by `new QueryClient(config)`, with Solid's extended [Default optional defaultOptions: DefaultOptions; ``` -Defined in: [QueryClient.ts:106](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L106) +Defined in: [packages/solid-query/src/QueryClient.ts:106](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L106) #### Overrides ```ts QueryCoreClientConfig.defaultOptions ``` + +*** + +### mutationCache? + +```ts +optional mutationCache: MutationCache; +``` + +Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) + +#### Inherited from + +```ts +QueryCoreClientConfig.mutationCache +``` + +*** + +### queryCache? + +```ts +optional queryCache: QueryCache; +``` + +Defined in: [packages/query-core/src/types.ts:1428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1428) + +#### Inherited from + +```ts +QueryCoreClientConfig.queryCache +``` diff --git a/docs/framework/solid/reference/interfaces/QueryExecuteOptions.md b/docs/framework/solid/reference/interfaces/QueryExecuteOptions.md new file mode 100644 index 00000000000..ce40aa09805 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/QueryExecuteOptions.md @@ -0,0 +1,375 @@ +--- +id: QueryExecuteOptions +title: QueryExecuteOptions +--- + +Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L555) + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<`QueryOptions`\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### initialPageParam? + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L567) + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:572](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L572) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` diff --git a/docs/framework/solid/reference/interfaces/QueryFilters.md b/docs/framework/solid/reference/interfaces/QueryFilters.md new file mode 100644 index 00000000000..6b177d93aa5 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/QueryFilters.md @@ -0,0 +1,102 @@ +--- +id: QueryFilters +title: QueryFilters +--- + +Defined in: [packages/query-core/src/utils.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L31) + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extended by + +- [`InvalidateQueryFilters`](InvalidateQueryFilters.md) +- [`RefetchQueryFilters`](RefetchQueryFilters.md) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries diff --git a/docs/framework/solid/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/solid/reference/interfaces/QueryObserverBaseResult.md new file mode 100644 index 00000000000..2840be27e27 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/QueryObserverBaseResult.md @@ -0,0 +1,358 @@ +--- +id: QueryObserverBaseResult +title: QueryObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) + +## Extended by + +- [`QueryObserverPendingResult`](QueryObserverPendingResult.md) +- [`QueryObserverLoadingResult`](QueryObserverLoadingResult.md) +- [`QueryObserverLoadingErrorResult`](QueryObserverLoadingErrorResult.md) +- [`QueryObserverRefetchErrorResult`](QueryObserverRefetchErrorResult.md) +- [`QueryObserverSuccessResult`](QueryObserverSuccessResult.md) +- [`QueryObserverPlaceholderResult`](QueryObserverPlaceholderResult.md) +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) + +The last successfully resolved data for the query. + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +*** + +### isLoadingError + +```ts +isLoadingError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) + +Will be `true` if the query failed while fetching for the first time. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) + +Will be `true` if the data shown is the placeholder data. + +*** + +### isRefetchError + +```ts +isRefetchError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) + +Will be `true` if the query failed while refetching. + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. diff --git a/docs/framework/solid/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/solid/reference/interfaces/QueryObserverLoadingErrorResult.md new file mode 100644 index 00000000000..97d5d5125a7 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverLoadingErrorResult +title: QueryObserverLoadingErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: true; +``` + +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/solid/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/solid/reference/interfaces/QueryObserverLoadingResult.md new file mode 100644 index 00000000000..1f442f18130 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/QueryObserverLoadingResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverLoadingResult +title: QueryObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L873) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: true; +``` + +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:885](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L885) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:884](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L884) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/solid/reference/interfaces/QueryObserverOptions.md b/docs/framework/solid/reference/interfaces/QueryObserverOptions.md index 7d5c95448ab..6d15caaee3e 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverOptions.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverOptions.md @@ -3,13 +3,13 @@ id: QueryObserverOptions title: QueryObserverOptions --- -Defined in: [QueryClient.ts:23](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L23) +Defined in: [packages/solid-query/src/QueryClient.ts:23](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L23) The core `QueryObserverOptions`, with Solid's `reconcile` option added. ## Extends -- `OmitKeyof`\<`QueryCoreObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\>, `"structuralSharing"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<`QueryCoreObserverOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\>, `"structuralSharing"`\> ## Type Parameters @@ -21,7 +21,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. @@ -39,7 +39,7 @@ The type of the data actually held in the query cache. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. @@ -52,15 +52,564 @@ is shared with an infinite query's observer options. Defaults to `never` for reg ## Properties +### enabled? + +```ts +optional enabled: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.enabled +``` + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`gcTime`](QueryExecuteOptions.md#gctime) + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +OmitKeyof.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +OmitKeyof.initialDataUpdatedAt +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`maxPages`](QueryExecuteOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`meta`](QueryExecuteOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`networkMode`](QueryExecuteOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +```ts +OmitKeyof.notifyOnChangeProps +``` + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +OmitKeyof.persister +``` + +*** + +### placeholderData? + +```ts +optional placeholderData: + | NonFunctionGuard +| PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +```ts +OmitKeyof.placeholderData +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +OmitKeyof.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`queryHash`](QueryExecuteOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +OmitKeyof.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +OmitKeyof.queryKeyHashFn +``` + +*** + ### reconcile? ```ts optional reconcile: string | false | (oldData, newData) => TData; ``` -Defined in: [QueryClient.ts:47](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L47) +Defined in: [packages/solid-query/src/QueryClient.ts:47](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L47) Set this to a reconciliation key to enable reconciliation between query results. Set this to `false` to disable reconciliation between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom reconciliation logic. Defaults reconciliation to false. + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchInterval +``` + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchIntervalInBackground +``` + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnMount +``` + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnReconnect +``` + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnWindowFocus +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.retryOnMount +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +#### Inherited from + +```ts +OmitKeyof.select +``` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +```ts +OmitKeyof.staleTime +``` + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.suspense +``` + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.throwOnError +``` diff --git a/docs/framework/solid/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/solid/reference/interfaces/QueryObserverPendingResult.md new file mode 100644 index 00000000000..ad040ff9cc5 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/QueryObserverPendingResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverPendingResult +title: QueryObserverPendingResult +--- + +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:862](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L862) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:864](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L864) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:866](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L866) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:865](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L865) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:869](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L869) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:870](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L870) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/solid/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/solid/reference/interfaces/QueryObserverPlaceholderResult.md new file mode 100644 index 00000000000..8a1ae61dee9 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/QueryObserverPlaceholderResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverPlaceholderResult +title: QueryObserverPlaceholderResult +--- + +Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: true; +``` + +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/solid/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/solid/reference/interfaces/QueryObserverRefetchErrorResult.md new file mode 100644 index 00000000000..c8d5274697a --- /dev/null +++ b/docs/framework/solid/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverRefetchErrorResult +title: QueryObserverRefetchErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: true; +``` + +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/solid/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/solid/reference/interfaces/QueryObserverSuccessResult.md new file mode 100644 index 00000000000..e3c834e6c3a --- /dev/null +++ b/docs/framework/solid/reference/interfaces/QueryObserverSuccessResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverSuccessResult +title: QueryObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/solid/reference/interfaces/QueryOptions.md b/docs/framework/solid/reference/interfaces/QueryOptions.md index 83f5cc4093d..0dfd58c29a3 100644 --- a/docs/framework/solid/reference/interfaces/QueryOptions.md +++ b/docs/framework/solid/reference/interfaces/QueryOptions.md @@ -3,7 +3,7 @@ id: QueryOptions title: QueryOptions --- -Defined in: [types.ts:68](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L68) +Defined in: [packages/solid-query/src/types.ts:68](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L68) The options accepted by `useQuery` and `queryOptions`. @@ -21,7 +21,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. @@ -34,7 +34,7 @@ The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` when ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. @@ -46,7 +46,7 @@ The type of your `queryKey`. optional deferStream: boolean; ``` -Defined in: [types.ts:50](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L50) +Defined in: [packages/solid-query/src/types.ts:50](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L50) Only applicable while rendering queries on the server with streaming. Set `deferStream` to `true` to wait for the query to resolve on the server before flushing the stream. @@ -59,13 +59,322 @@ Defaults to `false`. *** +### enabled? + +```ts +optional enabled: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`enabled`](UseBaseQueryOptions.md#enabled) + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`gcTime`](QueryExecuteOptions.md#gctime) + +*** + +### initialData? + +```ts +optional initialData: + | TQueryFnData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`initialData`](UseBaseQueryOptions.md#initialdata) + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`initialDataUpdatedAt`](UseBaseQueryOptions.md#initialdataupdatedat) + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`maxPages`](QueryExecuteOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`meta`](QueryExecuteOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`networkMode`](QueryExecuteOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`notifyOnChangeProps`](UseBaseQueryOptions.md#notifyonchangeprops) + +*** + +### persister()? + +```ts +optional persister: (queryFn, context, query) => TQueryFnData | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Parameters + +##### queryFn + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TQueryFnData`, `NoInfer`\<`TQueryKey`\>, `never`\> + +##### context + +###### client + +`QueryClient` + +###### direction? + +`unknown` + +**Deprecated** + +if you want access to the direction, you can add it to the pageParam + +###### meta + +`Record`\<`string`, `unknown`\> \| `undefined` + +###### pageParam? + +`unknown` + +###### queryKey + +`NoInfer`\<`TQueryKey`\> + +###### signal + +`AbortSignal` + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`TQueryFnData` \| `Promise`\<`TQueryFnData`\> + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`persister`](UseBaseQueryOptions.md#persister) + +*** + +### placeholderData? + +```ts +optional placeholderData: + | NonFunctionGuard +| PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`placeholderData`](UseBaseQueryOptions.md#placeholderdata) + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`queryFn`](UseBaseQueryOptions.md#queryfn) + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`queryHash`](QueryExecuteOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`queryKey`](UseBaseQueryOptions.md#querykey) + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`queryKeyHashFn`](UseBaseQueryOptions.md#querykeyhashfn) + +*** + ### reconcile? ```ts optional reconcile: string | false | (oldData, newData) => TData; ``` -Defined in: [QueryClient.ts:47](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L47) +Defined in: [packages/solid-query/src/QueryClient.ts:47](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L47) Set this to a reconciliation key to enable reconciliation between query results. Set this to `false` to disable reconciliation between query results. @@ -78,13 +387,217 @@ Defaults reconciliation to false. *** +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`refetchInterval`](UseBaseQueryOptions.md#refetchinterval) + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`refetchIntervalInBackground`](UseBaseQueryOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`refetchOnMount`](UseBaseQueryOptions.md#refetchonmount) + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`refetchOnReconnect`](UseBaseQueryOptions.md#refetchonreconnect) + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`refetchOnWindowFocus`](UseBaseQueryOptions.md#refetchonwindowfocus) + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`retry`](UseBaseQueryOptions.md#retry) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`retryDelay`](UseBaseQueryOptions.md#retrydelay) + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`retryOnMount`](UseBaseQueryOptions.md#retryonmount) + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryFnData` + +#### Returns + +`TData` + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`select`](UseBaseQueryOptions.md#select) + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`staleTime`](UseBaseQueryOptions.md#staletime) + +*** + ### ~~suspense?~~ ```ts optional suspense: boolean; ``` -Defined in: [types.ts:56](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L56) +Defined in: [packages/solid-query/src/types.ts:56](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L56) #### Deprecated @@ -95,3 +608,23 @@ Setting `suspense` to `false` will be a no-op. #### Inherited from [`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`suspense`](UseBaseQueryOptions.md#suspense) + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +[`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`throwOnError`](UseBaseQueryOptions.md#throwonerror) diff --git a/docs/framework/solid/reference/interfaces/QueryState.md b/docs/framework/solid/reference/interfaces/QueryState.md new file mode 100644 index 00000000000..7dce476d743 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/QueryState.md @@ -0,0 +1,175 @@ +--- +id: QueryState +title: QueryState +--- + +Defined in: [packages/query-core/src/query.ts:52](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L52) + +The raw state stored on a `Query` instance. This is the underlying state +that observer results (e.g. `QueryObserverResult`) are derived from. + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:56](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L56) + +The last successfully resolved data for the query. + +*** + +### dataUpdateCount + +```ts +dataUpdateCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L60) + +The number of times the query has successfully resolved. + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/query.ts:64](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L64) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/query.ts:69](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L69) + +The error object for the query, if the last attempt resulted in an error. +- Defaults to `null`. + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:73](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L73) + +The sum of all errors, incremented every time the query resolves with an error. + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/query.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L77) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +*** + +### fetchFailureCount + +```ts +fetchFailureCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L83) + +The failure count for the current fetch. +- Incremented every time the fetch fails. +- Reset to `0` when the fetch succeeds. + +*** + +### fetchFailureReason + +```ts +fetchFailureReason: TError | null; +``` + +Defined in: [packages/query-core/src/query.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L88) + +The reason the current fetch failed, as reported by the retryer. +- Reset to `null` when the fetch succeeds. + +*** + +### fetchMeta + +```ts +fetchMeta: FetchMeta | null; +``` + +Defined in: [packages/query-core/src/query.ts:93](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L93) + +Metadata passed to the currently in-flight (or most recent) fetch, e.g. the +`fetchMore` direction for infinite queries. + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/query.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L112) + +The fetch status of the query. +- `fetching`: the `queryFn` is currently executing. +- `paused`: a fetch wanted to run but has been paused (see network mode). +- `idle`: the query is not fetching. + +*** + +### isInvalidated + +```ts +isInvalidated: boolean; +``` + +Defined in: [packages/query-core/src/query.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L98) + +Whether the query has been marked as invalidated via `invalidate()`. +- Reset to `false` whenever the query resolves successfully. + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/query.ts:105](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L105) + +The status of the query. +- `pending` if there's no cached data and no attempt was finished yet. +- `error` if the last attempt resulted in an error. +- `success` if the query has data. diff --git a/docs/framework/solid/reference/interfaces/RefetchOptions.md b/docs/framework/solid/reference/interfaces/RefetchOptions.md new file mode 100644 index 00000000000..a3db94b1674 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/RefetchOptions.md @@ -0,0 +1,45 @@ +--- +id: RefetchOptions +title: RefetchOptions +--- + +Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L679) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Extended by + +- [`InvalidateOptions`](InvalidateOptions.md) +- [`ResetOptions`](ResetOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/solid/reference/interfaces/RefetchQueryFilters.md b/docs/framework/solid/reference/interfaces/RefetchQueryFilters.md new file mode 100644 index 00000000000..f2b6b287875 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/RefetchQueryFilters.md @@ -0,0 +1,125 @@ +--- +id: RefetchQueryFilters +title: RefetchQueryFilters +--- + +Defined in: [packages/query-core/src/types.ts:696](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L696) + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extends + +- [`QueryFilters`](QueryFilters.md)\<`TQueryKey`\> + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`exact`](QueryFilters.md#exact) + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`fetchStatus`](QueryFilters.md#fetchstatus) + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`predicate`](QueryFilters.md#predicate) + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`queryKey`](QueryFilters.md#querykey) + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`stale`](QueryFilters.md#stale) + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/solid/reference/interfaces/Register.md b/docs/framework/solid/reference/interfaces/Register.md new file mode 100644 index 00000000000..4f442442b48 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/Register.md @@ -0,0 +1,6 @@ +--- +id: Register +title: Register +--- + +Defined in: [packages/query-core/src/types.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L37) diff --git a/docs/framework/solid/reference/interfaces/ResetOptions.md b/docs/framework/solid/reference/interfaces/ResetOptions.md new file mode 100644 index 00000000000..bfa931717f8 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/ResetOptions.md @@ -0,0 +1,44 @@ +--- +id: ResetOptions +title: ResetOptions +--- + +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) + +## Extends + +- [`RefetchOptions`](RefetchOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`cancelRefetch`](RefetchOptions.md#cancelrefetch) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`throwOnError`](RefetchOptions.md#throwonerror) diff --git a/docs/framework/solid/reference/interfaces/ResultOptions.md b/docs/framework/solid/reference/interfaces/ResultOptions.md new file mode 100644 index 00000000000..dbf00d6c67e --- /dev/null +++ b/docs/framework/solid/reference/interfaces/ResultOptions.md @@ -0,0 +1,22 @@ +--- +id: ResultOptions +title: ResultOptions +--- + +Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) + +## Extended by + +- [`RefetchOptions`](RefetchOptions.md) +- [`FetchNextPageOptions`](FetchNextPageOptions.md) +- [`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +## Properties + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) diff --git a/docs/framework/solid/reference/interfaces/SetDataOptions.md b/docs/framework/solid/reference/interfaces/SetDataOptions.md new file mode 100644 index 00000000000..5fcbcfdf7cd --- /dev/null +++ b/docs/framework/solid/reference/interfaces/SetDataOptions.md @@ -0,0 +1,16 @@ +--- +id: SetDataOptions +title: SetDataOptions +--- + +Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1448) + +## Properties + +### updatedAt? + +```ts +optional updatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) diff --git a/docs/framework/solid/reference/interfaces/UseBaseQueryOptions.md b/docs/framework/solid/reference/interfaces/UseBaseQueryOptions.md index c26094dfd33..6f68c56b4c3 100644 --- a/docs/framework/solid/reference/interfaces/UseBaseQueryOptions.md +++ b/docs/framework/solid/reference/interfaces/UseBaseQueryOptions.md @@ -3,14 +3,14 @@ id: UseBaseQueryOptions title: UseBaseQueryOptions --- -Defined in: [types.ts:34](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L34) +Defined in: [packages/solid-query/src/types.ts:34](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L34) The options accepted by `useQuery`. Extends [QueryObserverOptions](QueryObserverOptions.md) from `@tanstack/query-core` with the `solid-query`-specific `deferStream` and `suspense` options. ## Extends -- `OmitKeyof`\<[`QueryObserverOptions`](QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\>, `"suspense"`\> +- [`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`QueryObserverOptions`](QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\>, `"suspense"`\> ## Extended by @@ -26,7 +26,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) The type of errors your `queryFn` may throw. @@ -46,7 +46,7 @@ The type of the data actually held in the query cache — the input to `select` ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) The type of your `queryKey`. @@ -58,7 +58,7 @@ The type of your `queryKey`. optional deferStream: boolean; ``` -Defined in: [types.ts:50](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L50) +Defined in: [packages/solid-query/src/types.ts:50](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L50) Only applicable while rendering queries on the server with streaming. Set `deferStream` to `true` to wait for the query to resolve on the server before flushing the stream. @@ -67,13 +67,340 @@ Defaults to `false`. *** +### enabled? + +```ts +optional enabled: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.enabled +``` + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`gcTime`](QueryExecuteOptions.md#gctime) + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +OmitKeyof.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +OmitKeyof.initialDataUpdatedAt +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`maxPages`](QueryExecuteOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`meta`](QueryExecuteOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`networkMode`](QueryExecuteOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +```ts +OmitKeyof.notifyOnChangeProps +``` + +*** + +### persister()? + +```ts +optional persister: (queryFn, context, query) => TQueryFnData | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Parameters + +##### queryFn + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TQueryFnData`, `NoInfer`\<`TQueryKey`\>, `never`\> + +##### context + +###### client + +`QueryClient` + +###### direction? + +`unknown` + +**Deprecated** + +if you want access to the direction, you can add it to the pageParam + +###### meta + +`Record`\<`string`, `unknown`\> \| `undefined` + +###### pageParam? + +`unknown` + +###### queryKey + +`NoInfer`\<`TQueryKey`\> + +###### signal + +`AbortSignal` + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`TQueryFnData` \| `Promise`\<`TQueryFnData`\> + +#### Inherited from + +```ts +OmitKeyof.persister +``` + +*** + +### placeholderData? + +```ts +optional placeholderData: + | NonFunctionGuard +| PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +```ts +OmitKeyof.placeholderData +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +OmitKeyof.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryExecuteOptions`](QueryExecuteOptions.md).[`queryHash`](QueryExecuteOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +OmitKeyof.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +OmitKeyof.queryKeyHashFn +``` + +*** + ### reconcile? ```ts optional reconcile: string | false | (oldData, newData) => TData; ``` -Defined in: [QueryClient.ts:47](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L47) +Defined in: [packages/solid-query/src/QueryClient.ts:47](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L47) Set this to a reconciliation key to enable reconciliation between query results. Set this to `false` to disable reconciliation between query results. @@ -88,16 +415,262 @@ OmitKeyof.reconcile *** +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchInterval +``` + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.refetchIntervalInBackground +``` + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnMount +``` + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnReconnect +``` + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.refetchOnWindowFocus +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +OmitKeyof.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +OmitKeyof.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +```ts +OmitKeyof.retryOnMount +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +#### Inherited from + +```ts +OmitKeyof.select +``` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +```ts +OmitKeyof.staleTime +``` + +*** + ### ~~suspense?~~ ```ts optional suspense: boolean; ``` -Defined in: [types.ts:56](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L56) +Defined in: [packages/solid-query/src/types.ts:56](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L56) #### Deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version. The `data` property on useQuery is a SolidJS resource and will automatically suspend when the data is loading. Setting `suspense` to `false` will be a no-op. + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +```ts +OmitKeyof.throwOnError +``` diff --git a/docs/framework/solid/reference/type-aliases/AnyDataTag.md b/docs/framework/solid/reference/type-aliases/AnyDataTag.md new file mode 100644 index 00000000000..d3d5e33bb3e --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/AnyDataTag.md @@ -0,0 +1,30 @@ +--- +id: AnyDataTag +title: AnyDataTag +--- + +```ts +type AnyDataTag = object; +``` + +Defined in: [packages/query-core/src/types.ts:67](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L67) + +## Properties + +### \[dataTagErrorSymbol\] + +```ts +[dataTagErrorSymbol]: any; +``` + +Defined in: [packages/query-core/src/types.ts:69](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L69) + +*** + +### \[dataTagSymbol\] + +```ts +[dataTagSymbol]: any; +``` + +Defined in: [packages/query-core/src/types.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L68) diff --git a/docs/framework/solid/reference/type-aliases/DataTag.md b/docs/framework/solid/reference/type-aliases/DataTag.md new file mode 100644 index 00000000000..904ca124464 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/DataTag.md @@ -0,0 +1,24 @@ +--- +id: DataTag +title: DataTag +--- + +```ts +type DataTag = TType extends AnyDataTag ? TType : TType & object; +``` + +Defined in: [packages/query-core/src/types.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L71) + +## Type Parameters + +### TType + +`TType` + +### TValue + +`TValue` + +### TError + +`TError` = [`UnsetMarker`](UnsetMarker.md) diff --git a/docs/framework/solid/reference/type-aliases/DefaultError.md b/docs/framework/solid/reference/type-aliases/DefaultError.md new file mode 100644 index 00000000000..da9f615482f --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/DefaultError.md @@ -0,0 +1,10 @@ +--- +id: DefaultError +title: DefaultError +--- + +```ts +type DefaultError = Register extends object ? TError : Error; +``` + +Defined in: [packages/query-core/src/types.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L45) diff --git a/docs/framework/solid/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/solid/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md new file mode 100644 index 00000000000..733a1a5ad75 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -0,0 +1,32 @@ +--- +id: DefaultedInfiniteQueryObserverOptions +title: DefaultedInfiniteQueryObserverOptions +--- + +```ts +type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; +``` + +Defined in: [packages/query-core/src/types.ts:538](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L538) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` diff --git a/docs/framework/solid/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/solid/reference/type-aliases/DefaultedQueryObserverOptions.md new file mode 100644 index 00000000000..1b4309f150c --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -0,0 +1,32 @@ +--- +id: DefaultedQueryObserverOptions +title: DefaultedQueryObserverOptions +--- + +```ts +type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; +``` + +Defined in: [packages/query-core/src/types.ts:509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L509) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult.md new file mode 100644 index 00000000000..ced8e568299 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -0,0 +1,22 @@ +--- +id: DefinedInfiniteQueryObserverResult +title: DefinedInfiniteQueryObserverResult +--- + +```ts +type DefinedInfiniteQueryObserverResult = + | InfiniteQueryObserverRefetchErrorResult +| InfiniteQueryObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/solid/reference/type-aliases/DefinedInitialDataInfiniteOptions.md b/docs/framework/solid/reference/type-aliases/DefinedInitialDataInfiniteOptions.md index e01fb72d53a..bf0beab741b 100644 --- a/docs/framework/solid/reference/type-aliases/DefinedInitialDataInfiniteOptions.md +++ b/docs/framework/solid/reference/type-aliases/DefinedInitialDataInfiniteOptions.md @@ -7,7 +7,7 @@ title: DefinedInitialDataInfiniteOptions type DefinedInitialDataInfiniteOptions = Accessor & object>; ``` -Defined in: [infiniteQueryOptions.ts:48](https://github.com/TanStack/query/blob/main/packages/solid-query/src/infiniteQueryOptions.ts#L48) +Defined in: [packages/solid-query/src/infiniteQueryOptions.ts:48](https://github.com/TanStack/query/blob/main/packages/solid-query/src/infiniteQueryOptions.ts#L48) The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is set — `data` is never `undefined`. @@ -22,20 +22,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/solid/reference/type-aliases/DefinedInitialDataOptions.md b/docs/framework/solid/reference/type-aliases/DefinedInitialDataOptions.md index 0a0a224bf42..5579090e80f 100644 --- a/docs/framework/solid/reference/type-aliases/DefinedInitialDataOptions.md +++ b/docs/framework/solid/reference/type-aliases/DefinedInitialDataOptions.md @@ -7,7 +7,7 @@ title: DefinedInitialDataOptions type DefinedInitialDataOptions = Accessor & object>; ``` -Defined in: [queryOptions.ts:40](https://github.com/TanStack/query/blob/main/packages/solid-query/src/queryOptions.ts#L40) +Defined in: [packages/solid-query/src/queryOptions.ts:40](https://github.com/TanStack/query/blob/main/packages/solid-query/src/queryOptions.ts#L40) The options accepted by the `queryOptions` overload selected when `initialData` is set — `data` is never `undefined`. @@ -22,7 +22,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -34,6 +34,6 @@ The type `data` ends up as after `select` runs. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/solid/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/solid/reference/type-aliases/DefinedQueryObserverResult.md new file mode 100644 index 00000000000..7afdbfd38bc --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/DefinedQueryObserverResult.md @@ -0,0 +1,22 @@ +--- +id: DefinedQueryObserverResult +title: DefinedQueryObserverResult +--- + +```ts +type DefinedQueryObserverResult = + | QueryObserverRefetchErrorResult +| QueryObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/solid/reference/type-aliases/DefinedUseBaseQueryResult.md b/docs/framework/solid/reference/type-aliases/DefinedUseBaseQueryResult.md index b26b9bc63e3..1d7a5f4708e 100644 --- a/docs/framework/solid/reference/type-aliases/DefinedUseBaseQueryResult.md +++ b/docs/framework/solid/reference/type-aliases/DefinedUseBaseQueryResult.md @@ -7,7 +7,7 @@ title: DefinedUseBaseQueryResult type DefinedUseBaseQueryResult = DefinedQueryObserverResult; ``` -Defined in: [types.ts:131](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L131) +Defined in: [packages/solid-query/src/types.ts:131](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L131) The object `useQuery` returns when `initialData` guarantees `data` is never `undefined`. @@ -21,6 +21,6 @@ The type `data` ends up as, after `select` runs (if set). ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors this query may hold. diff --git a/docs/framework/solid/reference/type-aliases/DefinedUseInfiniteQueryResult.md b/docs/framework/solid/reference/type-aliases/DefinedUseInfiniteQueryResult.md index b854a75b36f..e3418a348e1 100644 --- a/docs/framework/solid/reference/type-aliases/DefinedUseInfiniteQueryResult.md +++ b/docs/framework/solid/reference/type-aliases/DefinedUseInfiniteQueryResult.md @@ -7,7 +7,7 @@ title: DefinedUseInfiniteQueryResult type DefinedUseInfiniteQueryResult = DefinedInfiniteQueryObserverResult; ``` -Defined in: [types.ts:227](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L227) +Defined in: [packages/solid-query/src/types.ts:227](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L227) The object `useInfiniteQuery` returns when `initialData` guarantees `data` is never `undefined`. @@ -21,6 +21,6 @@ The type `data` ends up as, after `select` runs (if set). ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors this query may hold. diff --git a/docs/framework/solid/reference/type-aliases/DefinedUseQueryResult.md b/docs/framework/solid/reference/type-aliases/DefinedUseQueryResult.md index c903601dd43..01c93853303 100644 --- a/docs/framework/solid/reference/type-aliases/DefinedUseQueryResult.md +++ b/docs/framework/solid/reference/type-aliases/DefinedUseQueryResult.md @@ -7,7 +7,7 @@ title: DefinedUseQueryResult type DefinedUseQueryResult = DefinedUseBaseQueryResult; ``` -Defined in: [types.ts:142](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L142) +Defined in: [packages/solid-query/src/types.ts:142](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L142) The object `useQuery` returns when `initialData` guarantees `data` is never `undefined`. @@ -21,6 +21,6 @@ The type `data` ends up as, after `select` runs (if set). ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors this query may hold. diff --git a/docs/framework/solid/reference/type-aliases/DistributiveOmit.md b/docs/framework/solid/reference/type-aliases/DistributiveOmit.md new file mode 100644 index 00000000000..33b87a5cd6e --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/DistributiveOmit.md @@ -0,0 +1,20 @@ +--- +id: DistributiveOmit +title: DistributiveOmit +--- + +```ts +type DistributiveOmit = TObject extends any ? Omit : never; +``` + +Defined in: [packages/query-core/src/types.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L14) + +## Type Parameters + +### TObject + +`TObject` + +### TKey + +`TKey` *extends* keyof `TObject` diff --git a/docs/framework/solid/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/solid/reference/type-aliases/EnsureInfiniteQueryDataOptions.md new file mode 100644 index 00000000000..305eef94893 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -0,0 +1,42 @@ +--- +id: EnsureInfiniteQueryDataOptions +title: EnsureInfiniteQueryDataOptions +--- + +```ts +type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; +``` + +Defined in: [packages/query-core/src/types.ts:612](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L612) + +## Type Declaration + +### ~~revalidateIfStale?~~ + +```ts +optional revalidateIfStale: boolean; +``` + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Deprecated diff --git a/docs/framework/solid/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/solid/reference/type-aliases/FetchInfiniteQueryOptions.md new file mode 100644 index 00000000000..1ee1470b14a --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -0,0 +1,34 @@ +--- +id: FetchInfiniteQueryOptions +title: FetchInfiniteQueryOptions +--- + +```ts +type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; +``` + +Defined in: [packages/query-core/src/types.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L656) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Deprecated diff --git a/docs/framework/solid/reference/type-aliases/FetchStatus.md b/docs/framework/solid/reference/type-aliases/FetchStatus.md new file mode 100644 index 00000000000..4dae9444af6 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/FetchStatus.md @@ -0,0 +1,10 @@ +--- +id: FetchStatus +title: FetchStatus +--- + +```ts +type FetchStatus = "fetching" | "paused" | "idle"; +``` + +Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) diff --git a/docs/framework/solid/reference/type-aliases/GetNextPageParamFunction.md b/docs/framework/solid/reference/type-aliases/GetNextPageParamFunction.md new file mode 100644 index 00000000000..81d1a1544ab --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/GetNextPageParamFunction.md @@ -0,0 +1,42 @@ +--- +id: GetNextPageParamFunction +title: GetNextPageParamFunction +--- + +```ts +type GetNextPageParamFunction = (lastPage, allPages, lastPageParam, allPageParams) => TPageParam | undefined | null; +``` + +Defined in: [packages/query-core/src/types.ts:203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L203) + +## Type Parameters + +### TPageParam + +`TPageParam` + +### TQueryFnData + +`TQueryFnData` = `unknown` + +## Parameters + +### lastPage + +`TQueryFnData` + +### allPages + +`TQueryFnData`[] + +### lastPageParam + +`TPageParam` + +### allPageParams + +`TPageParam`[] + +## Returns + +`TPageParam` \| `undefined` \| `null` diff --git a/docs/framework/solid/reference/type-aliases/GetPreviousPageParamFunction.md b/docs/framework/solid/reference/type-aliases/GetPreviousPageParamFunction.md new file mode 100644 index 00000000000..5a6d9b93d7e --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/GetPreviousPageParamFunction.md @@ -0,0 +1,42 @@ +--- +id: GetPreviousPageParamFunction +title: GetPreviousPageParamFunction +--- + +```ts +type GetPreviousPageParamFunction = (firstPage, allPages, firstPageParam, allPageParams) => TPageParam | undefined | null; +``` + +Defined in: [packages/query-core/src/types.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L196) + +## Type Parameters + +### TPageParam + +`TPageParam` + +### TQueryFnData + +`TQueryFnData` = `unknown` + +## Parameters + +### firstPage + +`TQueryFnData` + +### allPages + +`TQueryFnData`[] + +### firstPageParam + +`TPageParam` + +### allPageParams + +`TPageParam`[] + +## Returns + +`TPageParam` \| `undefined` \| `null` diff --git a/docs/framework/solid/reference/type-aliases/InferDataFromTag.md b/docs/framework/solid/reference/type-aliases/InferDataFromTag.md new file mode 100644 index 00000000000..09a15ca4b1c --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/InferDataFromTag.md @@ -0,0 +1,20 @@ +--- +id: InferDataFromTag +title: InferDataFromTag +--- + +```ts +type InferDataFromTag = TTaggedQueryKey extends DataTag ? TaggedValue : TQueryFnData; +``` + +Defined in: [packages/query-core/src/types.ts:90](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L90) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` + +### TTaggedQueryKey + +`TTaggedQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/solid/reference/type-aliases/InferErrorFromTag.md b/docs/framework/solid/reference/type-aliases/InferErrorFromTag.md new file mode 100644 index 00000000000..cd94e4b5c3f --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/InferErrorFromTag.md @@ -0,0 +1,20 @@ +--- +id: InferErrorFromTag +title: InferErrorFromTag +--- + +```ts +type InferErrorFromTag = TTaggedQueryKey extends DataTag ? TaggedError extends UnsetMarker ? TError : TaggedError : TError; +``` + +Defined in: [packages/query-core/src/types.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L95) + +## Type Parameters + +### TError + +`TError` + +### TTaggedQueryKey + +`TTaggedQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/solid/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/solid/reference/type-aliases/InfiniteQueryExecuteOptions.md new file mode 100644 index 00000000000..29c974cfddf --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -0,0 +1,32 @@ +--- +id: InfiniteQueryExecuteOptions +title: InfiniteQueryExecuteOptions +--- + +```ts +type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; +``` + +Defined in: [packages/query-core/src/types.ts:635](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L635) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` diff --git a/docs/framework/solid/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/solid/reference/type-aliases/InfiniteQueryObserverResult.md new file mode 100644 index 00000000000..95fda780d1d --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/InfiniteQueryObserverResult.md @@ -0,0 +1,25 @@ +--- +id: InfiniteQueryObserverResult +title: InfiniteQueryObserverResult +--- + +```ts +type InfiniteQueryObserverResult = + | DefinedInfiniteQueryObserverResult + | InfiniteQueryObserverLoadingErrorResult + | InfiniteQueryObserverLoadingResult + | InfiniteQueryObserverPendingResult +| InfiniteQueryObserverPlaceholderResult; +``` + +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/solid/reference/type-aliases/InitialDataFunction.md b/docs/framework/solid/reference/type-aliases/InitialDataFunction.md new file mode 100644 index 00000000000..6ba4aaabe61 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/InitialDataFunction.md @@ -0,0 +1,20 @@ +--- +id: InitialDataFunction +title: InitialDataFunction +--- + +```ts +type InitialDataFunction = () => T | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L173) + +## Type Parameters + +### T + +`T` + +## Returns + +`T` \| `undefined` diff --git a/docs/framework/solid/reference/type-aliases/ManagedTimerId.md b/docs/framework/solid/reference/type-aliases/ManagedTimerId.md new file mode 100644 index 00000000000..d7833e3e4f0 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/ManagedTimerId.md @@ -0,0 +1,19 @@ +--- +id: ManagedTimerId +title: ManagedTimerId +--- + +```ts +type ManagedTimerId = + | number + | { + [toPrimitive]: () => number; +}; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:17](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L17) + +Wrapping `setTimeout` is awkward from a typing perspective because platform +typings may extend the return type of `setTimeout`. For example, NodeJS +typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be +able to return such a type. diff --git a/docs/framework/solid/reference/type-aliases/MutateFunction.md b/docs/framework/solid/reference/type-aliases/MutateFunction.md new file mode 100644 index 00000000000..f574ca7f8ca --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/MutateFunction.md @@ -0,0 +1,38 @@ +--- +id: MutateFunction +title: MutateFunction +--- + +```ts +type MutateFunction = (...rest) => Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1258) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Parameters + +### rest + +...[`MutateFunctionRest`](MutateFunctionRest.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Returns + +`Promise`\<`TData`\> diff --git a/docs/framework/solid/reference/type-aliases/MutateFunctionRest.md b/docs/framework/solid/reference/type-aliases/MutateFunctionRest.md new file mode 100644 index 00000000000..aef21572aeb --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/MutateFunctionRest.md @@ -0,0 +1,28 @@ +--- +id: MutateFunctionRest +title: MutateFunctionRest +--- + +```ts +type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; +``` + +Defined in: [packages/query-core/src/types.ts:1243](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1243) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` diff --git a/docs/framework/solid/reference/type-aliases/MutationCacheNotifyEvent.md b/docs/framework/solid/reference/type-aliases/MutationCacheNotifyEvent.md new file mode 100644 index 00000000000..aa5e196bc72 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/MutationCacheNotifyEvent.md @@ -0,0 +1,20 @@ +--- +id: MutationCacheNotifyEvent +title: MutationCacheNotifyEvent +--- + +```ts +type MutationCacheNotifyEvent = + | NotifyEventMutationAdded + | NotifyEventMutationRemoved + | NotifyEventMutationObserverAdded + | NotifyEventMutationObserverRemoved + | NotifyEventMutationObserverOptionsUpdated + | NotifyEventMutationUpdated; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L98) + +The event passed to a `MutationCache` subscriber. Fired whenever a mutation is added or removed +from the cache, its state is updated, or one of its observers is added, removed, or has its +options updated. diff --git a/docs/framework/solid/reference/type-aliases/MutationFunction.md b/docs/framework/solid/reference/type-aliases/MutationFunction.md new file mode 100644 index 00000000000..e306a5f1a48 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/MutationFunction.md @@ -0,0 +1,34 @@ +--- +id: MutationFunction +title: MutationFunction +--- + +```ts +type MutationFunction = (variables, context) => Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1161](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1161) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TVariables + +`TVariables` = `unknown` + +## Parameters + +### variables + +`TVariables` + +### context + +[`MutationFunctionContext`](MutationFunctionContext.md) + +## Returns + +`Promise`\<`TData`\> diff --git a/docs/framework/solid/reference/type-aliases/MutationFunctionContext.md b/docs/framework/solid/reference/type-aliases/MutationFunctionContext.md new file mode 100644 index 00000000000..b29a54df298 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/MutationFunctionContext.md @@ -0,0 +1,40 @@ +--- +id: MutationFunctionContext +title: MutationFunctionContext +--- + +```ts +type MutationFunctionContext = object; +``` + +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) + +## Properties + +### client + +```ts +client: QueryClient; +``` + +Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) + +*** + +### meta + +```ts +meta: MutationMeta | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) + +*** + +### mutationKey? + +```ts +optional mutationKey: MutationKey; +``` + +Defined in: [packages/query-core/src/types.ts:1158](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1158) diff --git a/docs/framework/solid/reference/type-aliases/MutationKey.md b/docs/framework/solid/reference/type-aliases/MutationKey.md new file mode 100644 index 00000000000..f89c6959883 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/MutationKey.md @@ -0,0 +1,10 @@ +--- +id: MutationKey +title: MutationKey +--- + +```ts +type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; +``` + +Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) diff --git a/docs/framework/solid/reference/type-aliases/MutationMeta.md b/docs/framework/solid/reference/type-aliases/MutationMeta.md new file mode 100644 index 00000000000..e1d481cdcf1 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/MutationMeta.md @@ -0,0 +1,10 @@ +--- +id: MutationMeta +title: MutationMeta +--- + +```ts +type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; +``` + +Defined in: [packages/query-core/src/types.ts:1147](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1147) diff --git a/docs/framework/solid/reference/type-aliases/MutationObserverResult.md b/docs/framework/solid/reference/type-aliases/MutationObserverResult.md new file mode 100644 index 00000000000..cbd07f40537 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/MutationObserverResult.md @@ -0,0 +1,32 @@ +--- +id: MutationObserverResult +title: MutationObserverResult +--- + +```ts +type MutationObserverResult = + | MutationObserverIdleResult + | MutationObserverLoadingResult + | MutationObserverErrorResult +| MutationObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` diff --git a/docs/framework/solid/reference/type-aliases/MutationScope.md b/docs/framework/solid/reference/type-aliases/MutationScope.md new file mode 100644 index 00000000000..6ec14643477 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/MutationScope.md @@ -0,0 +1,20 @@ +--- +id: MutationScope +title: MutationScope +--- + +```ts +type MutationScope = object; +``` + +Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) + +## Properties + +### id + +```ts +id: string; +``` + +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) diff --git a/docs/framework/solid/reference/type-aliases/MutationStatus.md b/docs/framework/solid/reference/type-aliases/MutationStatus.md new file mode 100644 index 00000000000..eedf0fb979a --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/MutationStatus.md @@ -0,0 +1,10 @@ +--- +id: MutationStatus +title: MutationStatus +--- + +```ts +type MutationStatus = "idle" | "pending" | "success" | "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) diff --git a/docs/framework/solid/reference/type-aliases/NetworkMode.md b/docs/framework/solid/reference/type-aliases/NetworkMode.md new file mode 100644 index 00000000000..94ae0ba76ed --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/NetworkMode.md @@ -0,0 +1,10 @@ +--- +id: NetworkMode +title: NetworkMode +--- + +```ts +type NetworkMode = "online" | "always" | "offlineFirst"; +``` + +Defined in: [packages/query-core/src/types.ts:223](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L223) diff --git a/docs/framework/solid/reference/type-aliases/NonUndefinedGuard.md b/docs/framework/solid/reference/type-aliases/NonUndefinedGuard.md new file mode 100644 index 00000000000..4aaf208013b --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/NonUndefinedGuard.md @@ -0,0 +1,16 @@ +--- +id: NonUndefinedGuard +title: NonUndefinedGuard +--- + +```ts +type NonUndefinedGuard = T extends undefined ? never : T; +``` + +Defined in: [packages/query-core/src/types.ts:12](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L12) + +## Type Parameters + +### T + +`T` diff --git a/docs/framework/solid/reference/type-aliases/NotifyEventType.md b/docs/framework/solid/reference/type-aliases/NotifyEventType.md new file mode 100644 index 00000000000..7b788ced7af --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/NotifyEventType.md @@ -0,0 +1,17 @@ +--- +id: NotifyEventType +title: NotifyEventType +--- + +```ts +type NotifyEventType = + | "added" + | "removed" + | "updated" + | "observerAdded" + | "observerRemoved" + | "observerResultsUpdated" + | "observerOptionsUpdated"; +``` + +Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) diff --git a/docs/framework/solid/reference/type-aliases/NotifyOnChangeProps.md b/docs/framework/solid/reference/type-aliases/NotifyOnChangeProps.md new file mode 100644 index 00000000000..7de194fa10b --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/NotifyOnChangeProps.md @@ -0,0 +1,17 @@ +--- +id: NotifyOnChangeProps +title: NotifyOnChangeProps +--- + +```ts +type NotifyOnChangeProps = + | keyof InfiniteQueryObserverResult[] + | "all" + | undefined + | () => + | keyof InfiniteQueryObserverResult[] + | "all" + | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L225) diff --git a/docs/framework/solid/reference/type-aliases/OmitKeyof.md b/docs/framework/solid/reference/type-aliases/OmitKeyof.md new file mode 100644 index 00000000000..690a7b0a5d2 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/OmitKeyof.md @@ -0,0 +1,28 @@ +--- +id: OmitKeyof +title: OmitKeyof +--- + +```ts +type OmitKeyof = Omit; +``` + +Defined in: [packages/query-core/src/types.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L19) + +## Type Parameters + +### TObject + +`TObject` + +### TKey + +`TKey` *extends* `TStrictly` *extends* `"safely"` ? + \| keyof `TObject` + \| `string` & `Record`\<`never`, `never`\> + \| `number` & `Record`\<`never`, `never`\> + \| `symbol` & `Record`\<`never`, `never`\> : keyof `TObject` + +### TStrictly + +`TStrictly` *extends* `"strictly"` \| `"safely"` = `"strictly"` diff --git a/docs/framework/solid/reference/type-aliases/Override.md b/docs/framework/solid/reference/type-aliases/Override.md new file mode 100644 index 00000000000..8abcecd1e1b --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/Override.md @@ -0,0 +1,20 @@ +--- +id: Override +title: Override +--- + +```ts +type Override = { [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey] }; +``` + +Defined in: [packages/query-core/src/types.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L31) + +## Type Parameters + +### TTargetA + +`TTargetA` + +### TTargetB + +`TTargetB` diff --git a/docs/framework/solid/reference/type-aliases/PlaceholderDataFunction.md b/docs/framework/solid/reference/type-aliases/PlaceholderDataFunction.md new file mode 100644 index 00000000000..cd40f28b41e --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/PlaceholderDataFunction.md @@ -0,0 +1,42 @@ +--- +id: PlaceholderDataFunction +title: PlaceholderDataFunction +--- + +```ts +type PlaceholderDataFunction = (previousData, previousQuery) => TQueryData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:177](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L177) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +## Parameters + +### previousData + +`TQueryData` | `undefined` + +### previousQuery + +[`Query`](../classes/Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> | `undefined` + +## Returns + +`TQueryData` \| `undefined` diff --git a/docs/framework/solid/reference/type-aliases/QueriesPlaceholderDataFunction.md b/docs/framework/solid/reference/type-aliases/QueriesPlaceholderDataFunction.md new file mode 100644 index 00000000000..5d3fca8c9e0 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/QueriesPlaceholderDataFunction.md @@ -0,0 +1,30 @@ +--- +id: QueriesPlaceholderDataFunction +title: QueriesPlaceholderDataFunction +--- + +```ts +type QueriesPlaceholderDataFunction = (previousData, previousQuery) => TQueryData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L187) + +## Type Parameters + +### TQueryData + +`TQueryData` + +## Parameters + +### previousData + +`undefined` + +### previousQuery + +`undefined` + +## Returns + +`TQueryData` \| `undefined` diff --git a/docs/framework/solid/reference/type-aliases/QueryBooleanOption.md b/docs/framework/solid/reference/type-aliases/QueryBooleanOption.md new file mode 100644 index 00000000000..9759e3ddb42 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/QueryBooleanOption.md @@ -0,0 +1,28 @@ +--- +id: QueryBooleanOption +title: QueryBooleanOption +--- + +```ts +type QueryBooleanOption = boolean | (query) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L119) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/solid/reference/type-aliases/QueryCacheNotifyEvent.md b/docs/framework/solid/reference/type-aliases/QueryCacheNotifyEvent.md new file mode 100644 index 00000000000..8e52da9e279 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/QueryCacheNotifyEvent.md @@ -0,0 +1,21 @@ +--- +id: QueryCacheNotifyEvent +title: QueryCacheNotifyEvent +--- + +```ts +type QueryCacheNotifyEvent = + | NotifyEventQueryAdded + | NotifyEventQueryRemoved + | NotifyEventQueryUpdated + | NotifyEventQueryObserverAdded + | NotifyEventQueryObserverRemoved + | NotifyEventQueryObserverResultsUpdated + | NotifyEventQueryObserverOptionsUpdated; +``` + +Defined in: [packages/query-core/src/queryCache.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L84) + +The event passed to a `QueryCache` subscriber. Fired whenever a query is added or removed from +the cache, its state is updated (e.g. via `query.setState` or `queryClient.removeQueries`), or +one of its observers is added, removed, or has its results or options updated. diff --git a/docs/framework/solid/reference/type-aliases/QueryClientProviderProps.md b/docs/framework/solid/reference/type-aliases/QueryClientProviderProps.md index 9aa87546767..cd42ea26950 100644 --- a/docs/framework/solid/reference/type-aliases/QueryClientProviderProps.md +++ b/docs/framework/solid/reference/type-aliases/QueryClientProviderProps.md @@ -7,7 +7,7 @@ title: QueryClientProviderProps type QueryClientProviderProps = object; ``` -Defined in: [QueryClientProvider.tsx:63](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClientProvider.tsx#L63) +Defined in: [packages/solid-query/src/QueryClientProvider.tsx:63](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClientProvider.tsx#L63) The props accepted by `QueryClientProvider`. @@ -19,7 +19,7 @@ The props accepted by `QueryClientProvider`. optional children: JSX.Element; ``` -Defined in: [QueryClientProvider.tsx:73](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClientProvider.tsx#L73) +Defined in: [packages/solid-query/src/QueryClientProvider.tsx:73](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClientProvider.tsx#L73) The components that get access to the provided `QueryClient`. @@ -31,7 +31,7 @@ The components that get access to the provided `QueryClient`. client: QueryClient; ``` -Defined in: [QueryClientProvider.tsx:69](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClientProvider.tsx#L69) +Defined in: [packages/solid-query/src/QueryClientProvider.tsx:69](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClientProvider.tsx#L69) **Required** diff --git a/docs/framework/solid/reference/type-aliases/QueryFunction.md b/docs/framework/solid/reference/type-aliases/QueryFunction.md new file mode 100644 index 00000000000..306367388a1 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/QueryFunction.md @@ -0,0 +1,34 @@ +--- +id: QueryFunction +title: QueryFunction +--- + +```ts +type QueryFunction = (context) => T | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L102) + +## Type Parameters + +### T + +`T` = `unknown` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Parameters + +### context + +[`QueryFunctionContext`](QueryFunctionContext.md)\<`TQueryKey`, `TPageParam`\> + +## Returns + +`T` \| `Promise`\<`T`\> diff --git a/docs/framework/solid/reference/type-aliases/QueryFunctionContext.md b/docs/framework/solid/reference/type-aliases/QueryFunctionContext.md new file mode 100644 index 00000000000..d2c9fe3e2b2 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/QueryFunctionContext.md @@ -0,0 +1,20 @@ +--- +id: QueryFunctionContext +title: QueryFunctionContext +--- + +```ts +type QueryFunctionContext = [TPageParam] extends [never] ? object : object; +``` + +Defined in: [packages/query-core/src/types.ts:144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L144) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` diff --git a/docs/framework/solid/reference/type-aliases/QueryKey.md b/docs/framework/solid/reference/type-aliases/QueryKey.md new file mode 100644 index 00000000000..1a3f34cde18 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/QueryKey.md @@ -0,0 +1,10 @@ +--- +id: QueryKey +title: QueryKey +--- + +```ts +type QueryKey = Register extends object ? TQueryKey extends ReadonlyArray ? TQueryKey : TQueryKey extends unknown[] ? TQueryKey : ReadonlyArray : ReadonlyArray; +``` + +Defined in: [packages/query-core/src/types.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L51) diff --git a/docs/framework/solid/reference/type-aliases/QueryKeyHashFunction.md b/docs/framework/solid/reference/type-aliases/QueryKeyHashFunction.md new file mode 100644 index 00000000000..feda96373cc --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/QueryKeyHashFunction.md @@ -0,0 +1,26 @@ +--- +id: QueryKeyHashFunction +title: QueryKeyHashFunction +--- + +```ts +type QueryKeyHashFunction = (queryKey) => string; +``` + +Defined in: [packages/query-core/src/types.ts:192](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L192) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) + +## Parameters + +### queryKey + +`TQueryKey` + +## Returns + +`string` diff --git a/docs/framework/solid/reference/type-aliases/QueryKeyWithDataTag.md b/docs/framework/solid/reference/type-aliases/QueryKeyWithDataTag.md new file mode 100644 index 00000000000..6613f74be9e --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/QueryKeyWithDataTag.md @@ -0,0 +1,34 @@ +--- +id: QueryKeyWithDataTag +title: QueryKeyWithDataTag +--- + +```ts +type QueryKeyWithDataTag = object; +``` + +Defined in: [packages/query-core/src/types.ts:82](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L82) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +## Properties + +### queryKey + +```ts +queryKey: DataTag; +``` + +Defined in: [packages/query-core/src/types.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L87) diff --git a/docs/framework/solid/reference/type-aliases/QueryMeta.md b/docs/framework/solid/reference/type-aliases/QueryMeta.md new file mode 100644 index 00000000000..c12917b2cce --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/QueryMeta.md @@ -0,0 +1,10 @@ +--- +id: QueryMeta +title: QueryMeta +--- + +```ts +type QueryMeta = Register extends object ? TQueryMeta extends Record ? TQueryMeta : Record : Record; +``` + +Defined in: [packages/query-core/src/types.ts:215](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L215) diff --git a/docs/framework/solid/reference/type-aliases/QueryObserverResult.md b/docs/framework/solid/reference/type-aliases/QueryObserverResult.md new file mode 100644 index 00000000000..f6c4118a978 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/QueryObserverResult.md @@ -0,0 +1,25 @@ +--- +id: QueryObserverResult +title: QueryObserverResult +--- + +```ts +type QueryObserverResult = + | DefinedQueryObserverResult + | QueryObserverLoadingErrorResult + | QueryObserverLoadingResult + | QueryObserverPendingResult +| QueryObserverPlaceholderResult; +``` + +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/solid/reference/type-aliases/QueryPersister.md b/docs/framework/solid/reference/type-aliases/QueryPersister.md new file mode 100644 index 00000000000..72e80165b0d --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/QueryPersister.md @@ -0,0 +1,24 @@ +--- +id: QueryPersister +title: QueryPersister +--- + +```ts +type QueryPersister = [TPageParam] extends [never] ? (queryFn, context, query) => T | Promise : (queryFn, context, query) => T | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L128) + +## Type Parameters + +### T + +`T` = `unknown` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` diff --git a/docs/framework/solid/reference/type-aliases/QueryStatus.md b/docs/framework/solid/reference/type-aliases/QueryStatus.md new file mode 100644 index 00000000000..ed6059e03ec --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/QueryStatus.md @@ -0,0 +1,10 @@ +--- +id: QueryStatus +title: QueryStatus +--- + +```ts +type QueryStatus = "pending" | "error" | "success"; +``` + +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) diff --git a/docs/framework/solid/reference/type-aliases/SkipToken.md b/docs/framework/solid/reference/type-aliases/SkipToken.md new file mode 100644 index 00000000000..176c23830d2 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/SkipToken.md @@ -0,0 +1,12 @@ +--- +id: SkipToken +title: SkipToken +--- + +```ts +type SkipToken = typeof skipToken; +``` + +Defined in: [packages/query-core/src/utils.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L524) + +The type of the [skipToken](../variables/skipToken.md) sentinel value. diff --git a/docs/framework/solid/reference/type-aliases/StaleTime.md b/docs/framework/solid/reference/type-aliases/StaleTime.md new file mode 100644 index 00000000000..3e7e21608be --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/StaleTime.md @@ -0,0 +1,10 @@ +--- +id: StaleTime +title: StaleTime +--- + +```ts +type StaleTime = number | "static"; +``` + +Defined in: [packages/query-core/src/types.ts:108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L108) diff --git a/docs/framework/solid/reference/type-aliases/StaleTimeFunction.md b/docs/framework/solid/reference/type-aliases/StaleTimeFunction.md new file mode 100644 index 00000000000..b1c541fa64e --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/StaleTimeFunction.md @@ -0,0 +1,28 @@ +--- +id: StaleTimeFunction +title: StaleTimeFunction +--- + +```ts +type StaleTimeFunction = StaleTime | (query) => StaleTime; +``` + +Defined in: [packages/query-core/src/types.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L110) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/solid/reference/type-aliases/ThrowOnError.md b/docs/framework/solid/reference/type-aliases/ThrowOnError.md new file mode 100644 index 00000000000..60ad44c1cd1 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/ThrowOnError.md @@ -0,0 +1,28 @@ +--- +id: ThrowOnError +title: ThrowOnError +--- + +```ts +type ThrowOnError = boolean | (error, query) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L361) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` + +### TError + +`TError` + +### TQueryData + +`TQueryData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/solid/reference/type-aliases/TimeoutCallback.md b/docs/framework/solid/reference/type-aliases/TimeoutCallback.md new file mode 100644 index 00000000000..387fb1238f3 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/TimeoutCallback.md @@ -0,0 +1,27 @@ +--- +id: TimeoutCallback +title: TimeoutCallback +--- + +```ts +type TimeoutCallback = (_) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:9](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L9) + +TimeoutManager does not support passing arguments to the callback. + +`(_: void)` is the argument type inferred by TypeScript's default typings for +`setTimeout(cb, number)`. +If we don't accept a single void argument, then +`new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. + +## Parameters + +### \_ + +`void` + +## Returns + +`void` diff --git a/docs/framework/solid/reference/type-aliases/TimeoutProvider.md b/docs/framework/solid/reference/type-aliases/TimeoutProvider.md new file mode 100644 index 00000000000..6416fe4c557 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/TimeoutProvider.md @@ -0,0 +1,106 @@ +--- +id: TimeoutProvider +title: TimeoutProvider +--- + +```ts +type TimeoutProvider = object; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:22](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L22) + +Backend for timer functions. + +## Type Parameters + +### TTimerId + +`TTimerId` *extends* [`ManagedTimerId`](ManagedTimerId.md) = [`ManagedTimerId`](ManagedTimerId.md) + +## Properties + +### clearInterval() + +```ts +readonly clearInterval: (intervalId) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) + +#### Parameters + +##### intervalId + +`TTimerId` | `undefined` + +#### Returns + +`void` + +*** + +### clearTimeout() + +```ts +readonly clearTimeout: (timeoutId) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L25) + +#### Parameters + +##### timeoutId + +`TTimerId` | `undefined` + +#### Returns + +`void` + +*** + +### setInterval() + +```ts +readonly setInterval: (callback, delay) => TTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L27) + +#### Parameters + +##### callback + +[`TimeoutCallback`](TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +`TTimerId` + +*** + +### setTimeout() + +```ts +readonly setTimeout: (callback, delay) => TTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L24) + +#### Parameters + +##### callback + +[`TimeoutCallback`](TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +`TTimerId` diff --git a/docs/framework/solid/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md b/docs/framework/solid/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md index 477c66c2506..760dda9cacf 100644 --- a/docs/framework/solid/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md +++ b/docs/framework/solid/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md @@ -7,7 +7,7 @@ title: UndefinedInitialDataInfiniteOptions type UndefinedInitialDataInfiniteOptions = Accessor & object>; ``` -Defined in: [infiniteQueryOptions.ts:25](https://github.com/TanStack/query/blob/main/packages/solid-query/src/infiniteQueryOptions.ts#L25) +Defined in: [packages/solid-query/src/infiniteQueryOptions.ts:25](https://github.com/TanStack/query/blob/main/packages/solid-query/src/infiniteQueryOptions.ts#L25) The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set — `data` may be `undefined` while the query is `pending`. `infiniteQueryOptions` itself accepts and returns a plain @@ -25,20 +25,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/solid/reference/type-aliases/UndefinedInitialDataOptions.md b/docs/framework/solid/reference/type-aliases/UndefinedInitialDataOptions.md index d74fedfa95b..0455c38e371 100644 --- a/docs/framework/solid/reference/type-aliases/UndefinedInitialDataOptions.md +++ b/docs/framework/solid/reference/type-aliases/UndefinedInitialDataOptions.md @@ -7,7 +7,7 @@ title: UndefinedInitialDataOptions type UndefinedInitialDataOptions = Accessor & object>; ``` -Defined in: [queryOptions.ts:20](https://github.com/TanStack/query/blob/main/packages/solid-query/src/queryOptions.ts#L20) +Defined in: [packages/solid-query/src/queryOptions.ts:20](https://github.com/TanStack/query/blob/main/packages/solid-query/src/queryOptions.ts#L20) The options accepted by the `queryOptions` overload selected when no `initialData` is set — `data` may be `undefined` while the query is `pending`. `queryOptions` itself accepts and returns a plain object (its @@ -24,7 +24,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -36,6 +36,6 @@ The type `data` ends up as after `select` runs. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/solid/reference/type-aliases/UnsetMarker.md b/docs/framework/solid/reference/type-aliases/UnsetMarker.md new file mode 100644 index 00000000000..8b9c14e1907 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/UnsetMarker.md @@ -0,0 +1,10 @@ +--- +id: UnsetMarker +title: UnsetMarker +--- + +```ts +type UnsetMarker = typeof unsetMarker; +``` + +Defined in: [packages/query-core/src/types.ts:66](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L66) diff --git a/docs/framework/solid/reference/type-aliases/Updater.md b/docs/framework/solid/reference/type-aliases/Updater.md new file mode 100644 index 00000000000..b6a29ccc5fc --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/Updater.md @@ -0,0 +1,35 @@ +--- +id: Updater +title: Updater +--- + +```ts +type Updater = TOutput | (input) => TOutput; +``` + +Defined in: [packages/query-core/src/utils.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L103) + +Either a plain value of type `TOutput`, or a function that receives `TInput` and returns `TOutput`. +Used for example by `setQueryData`-style updaters, which accept either the new data directly or a +function that computes it from the previous data. See functionalUpdate. + +## Type Parameters + +### TInput + +`TInput` + +### TOutput + +`TOutput` + +## Example + +```ts +queryClient.setQueryData(['posts'], newPosts) + +// Or, using an updater function that receives the current data: +queryClient.setQueryData(['posts'], (oldPosts) => + oldPosts ? [...oldPosts, newPost] : oldPosts, +) +``` diff --git a/docs/framework/solid/reference/type-aliases/UseBaseMutationResult.md b/docs/framework/solid/reference/type-aliases/UseBaseMutationResult.md index 7b3cd4a91ab..e0ea96077c4 100644 --- a/docs/framework/solid/reference/type-aliases/UseBaseMutationResult.md +++ b/docs/framework/solid/reference/type-aliases/UseBaseMutationResult.md @@ -9,9 +9,9 @@ type UseBaseMutationResult = Overrid }> & object; ``` -Defined in: [types.ts:305](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L305) +Defined in: [packages/solid-query/src/types.ts:305](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L305) -The result of `useMutation`. Same as MutationObserverResult from `@tanstack/query-core`, with +The result of `useMutation`. Same as [MutationObserverResult](MutationObserverResult.md) from `@tanstack/query-core`, with `mutate` narrowed to the fire-and-forget [UseMutateFunction](UseMutateFunction.md) signature, plus the added `mutateAsync`. ## Type Declaration @@ -34,7 +34,7 @@ The type your `mutationFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `mutationFn` may throw. diff --git a/docs/framework/solid/reference/type-aliases/UseBaseQueryResult.md b/docs/framework/solid/reference/type-aliases/UseBaseQueryResult.md index 25f70f23438..4bd3f539d41 100644 --- a/docs/framework/solid/reference/type-aliases/UseBaseQueryResult.md +++ b/docs/framework/solid/reference/type-aliases/UseBaseQueryResult.md @@ -7,10 +7,10 @@ title: UseBaseQueryResult type UseBaseQueryResult = QueryObserverResult; ``` -Defined in: [types.ts:108](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L108) +Defined in: [packages/solid-query/src/types.ts:108](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L108) The object `useQuery` returns when `initialData` isn't set — `data`/`error` may still be `undefined`/`null` -while the query is `pending`. Re-exports QueryObserverResult from `@tanstack/query-core`. +while the query is `pending`. Re-exports [QueryObserverResult](QueryObserverResult.md) from `@tanstack/query-core`. `useInfiniteQuery` returns [UseInfiniteQueryResult](UseInfiniteQueryResult.md) instead. ## Type Parameters @@ -23,6 +23,6 @@ The type `data` ends up as, after `select` runs (if set). ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors this query may hold. diff --git a/docs/framework/solid/reference/type-aliases/UseInfiniteQueryOptions.md b/docs/framework/solid/reference/type-aliases/UseInfiniteQueryOptions.md index ea549f2c222..126aaf1c333 100644 --- a/docs/framework/solid/reference/type-aliases/UseInfiniteQueryOptions.md +++ b/docs/framework/solid/reference/type-aliases/UseInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: UseInfiniteQueryOptions type UseInfiniteQueryOptions = Accessor>; ``` -Defined in: [types.ts:199](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L199) +Defined in: [packages/solid-query/src/types.ts:199](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L199) The accessor `useInfiniteQuery` expects as its first argument — Solid re-evaluates it reactively, so `queryKey` and other options can depend on signals. @@ -22,7 +22,7 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -34,7 +34,7 @@ The type `data` ends up as after `select` runs. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/solid/reference/type-aliases/UseInfiniteQueryResult.md b/docs/framework/solid/reference/type-aliases/UseInfiniteQueryResult.md index 27bbb6af675..820e0fa6ca2 100644 --- a/docs/framework/solid/reference/type-aliases/UseInfiniteQueryResult.md +++ b/docs/framework/solid/reference/type-aliases/UseInfiniteQueryResult.md @@ -7,7 +7,7 @@ title: UseInfiniteQueryResult type UseInfiniteQueryResult = InfiniteQueryObserverResult; ``` -Defined in: [types.ts:216](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L216) +Defined in: [packages/solid-query/src/types.ts:216](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L216) The object `useInfiniteQuery` returns — `data`/`error` may still be `undefined`/`null` while the query is `pending`. @@ -22,6 +22,6 @@ The type `data` ends up as, after `select` runs (if set). ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors this query may hold. diff --git a/docs/framework/solid/reference/type-aliases/UseMutateAsyncFunction.md b/docs/framework/solid/reference/type-aliases/UseMutateAsyncFunction.md index 5c8b2b61f89..9f34bc49c3c 100644 --- a/docs/framework/solid/reference/type-aliases/UseMutateAsyncFunction.md +++ b/docs/framework/solid/reference/type-aliases/UseMutateAsyncFunction.md @@ -7,7 +7,7 @@ title: UseMutateAsyncFunction type UseMutateAsyncFunction = MutateFunction; ``` -Defined in: [types.ts:288](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L288) +Defined in: [packages/solid-query/src/types.ts:288](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L288) The type of `mutateAsync`, as returned by `useMutation`. Similar to [UseMutateFunction](UseMutateFunction.md), but returns a promise which can be awaited. @@ -22,7 +22,7 @@ The type your `mutationFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `mutationFn` may throw. diff --git a/docs/framework/solid/reference/type-aliases/UseMutateFunction.md b/docs/framework/solid/reference/type-aliases/UseMutateFunction.md index 02efe15eeac..82adc280c52 100644 --- a/docs/framework/solid/reference/type-aliases/UseMutateFunction.md +++ b/docs/framework/solid/reference/type-aliases/UseMutateFunction.md @@ -7,7 +7,7 @@ title: UseMutateFunction type UseMutateFunction = (...args) => void; ``` -Defined in: [types.ts:267](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L267) +Defined in: [packages/solid-query/src/types.ts:267](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L267) ## Type Parameters @@ -17,7 +17,7 @@ Defined in: [types.ts:267](https://github.com/TanStack/query/blob/main/packages/ ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TVariables @@ -31,7 +31,7 @@ Defined in: [types.ts:267](https://github.com/TanStack/query/blob/main/packages/ ### args -...`Parameters`\<`MutateFunction`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> +...`Parameters`\<[`MutateFunction`](MutateFunction.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> ## Returns diff --git a/docs/framework/solid/reference/type-aliases/UseMutationOptions.md b/docs/framework/solid/reference/type-aliases/UseMutationOptions.md index bf6fda35575..21fc51cfdb6 100644 --- a/docs/framework/solid/reference/type-aliases/UseMutationOptions.md +++ b/docs/framework/solid/reference/type-aliases/UseMutationOptions.md @@ -7,7 +7,7 @@ title: UseMutationOptions type UseMutationOptions = Accessor>; ``` -Defined in: [types.ts:260](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L260) +Defined in: [packages/solid-query/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L260) The accessor `useMutation` expects as its first argument — Solid re-evaluates it reactively, so callbacks and other options can depend on signals. @@ -22,7 +22,7 @@ The type your `mutationFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `mutationFn` may throw. diff --git a/docs/framework/solid/reference/type-aliases/UseMutationResult.md b/docs/framework/solid/reference/type-aliases/UseMutationResult.md index c3d1e3b4f46..ae54de7270a 100644 --- a/docs/framework/solid/reference/type-aliases/UseMutationResult.md +++ b/docs/framework/solid/reference/type-aliases/UseMutationResult.md @@ -7,7 +7,7 @@ title: UseMutationResult type UseMutationResult = UseBaseMutationResult; ``` -Defined in: [types.ts:334](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L334) +Defined in: [packages/solid-query/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L334) The result of `useMutation`. Same as [UseBaseMutationResult](UseBaseMutationResult.md). @@ -21,7 +21,7 @@ The type your `mutationFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `mutationFn` may throw. diff --git a/docs/framework/solid/reference/type-aliases/UseQueryOptions.md b/docs/framework/solid/reference/type-aliases/UseQueryOptions.md index 66e2b0e8a8e..b157698738b 100644 --- a/docs/framework/solid/reference/type-aliases/UseQueryOptions.md +++ b/docs/framework/solid/reference/type-aliases/UseQueryOptions.md @@ -7,7 +7,7 @@ title: UseQueryOptions type UseQueryOptions = Accessor>; ``` -Defined in: [types.ts:91](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L91) +Defined in: [packages/solid-query/src/types.ts:91](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L91) The accessor `useQuery` expects as its first argument — Solid re-evaluates it reactively, so `queryKey` and other options can depend on signals. @@ -22,7 +22,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -35,6 +35,6 @@ The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` when ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/solid/reference/type-aliases/UseQueryResult.md b/docs/framework/solid/reference/type-aliases/UseQueryResult.md index c88e14178ac..e5e40e942d8 100644 --- a/docs/framework/solid/reference/type-aliases/UseQueryResult.md +++ b/docs/framework/solid/reference/type-aliases/UseQueryResult.md @@ -7,7 +7,7 @@ title: UseQueryResult type UseQueryResult = UseBaseQueryResult; ``` -Defined in: [types.ts:120](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L120) +Defined in: [packages/solid-query/src/types.ts:120](https://github.com/TanStack/query/blob/main/packages/solid-query/src/types.ts#L120) The object `useQuery` returns — `data`/`error` may still be `undefined`/`null` while the query is `pending`. @@ -22,6 +22,6 @@ The type `data` ends up as, after `select` runs (if set). ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors this query may hold. diff --git a/docs/framework/solid/reference/type-aliases/WithRequired.md b/docs/framework/solid/reference/type-aliases/WithRequired.md new file mode 100644 index 00000000000..c8ef831db3c --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/WithRequired.md @@ -0,0 +1,20 @@ +--- +id: WithRequired +title: WithRequired +--- + +```ts +type WithRequired = TTarget & { [_ in TKey]: {} }; +``` + +Defined in: [packages/query-core/src/types.ts:505](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L505) + +## Type Parameters + +### TTarget + +`TTarget` + +### TKey + +`TKey` *extends* keyof `TTarget` diff --git a/docs/framework/solid/reference/type-aliases/dataTagErrorSymbol.md b/docs/framework/solid/reference/type-aliases/dataTagErrorSymbol.md new file mode 100644 index 00000000000..26148a94d6e --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/dataTagErrorSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagErrorSymbol +title: dataTagErrorSymbol +--- + +```ts +type dataTagErrorSymbol = typeof dataTagErrorSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:63](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L63) diff --git a/docs/framework/solid/reference/type-aliases/dataTagSymbol.md b/docs/framework/solid/reference/type-aliases/dataTagSymbol.md new file mode 100644 index 00000000000..0012c108cc5 --- /dev/null +++ b/docs/framework/solid/reference/type-aliases/dataTagSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagSymbol +title: dataTagSymbol +--- + +```ts +type dataTagSymbol = typeof dataTagSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L61) diff --git a/docs/framework/solid/reference/variables/IsRestoringProvider.md b/docs/framework/solid/reference/variables/IsRestoringProvider.md index 99fd1f1b78a..255f0f58b6e 100644 --- a/docs/framework/solid/reference/variables/IsRestoringProvider.md +++ b/docs/framework/solid/reference/variables/IsRestoringProvider.md @@ -7,7 +7,7 @@ title: IsRestoringProvider const IsRestoringProvider: ContextProviderComponent> = IsRestoringContext.Provider; ``` -Defined in: [isRestoring.ts:19](https://github.com/TanStack/query/blob/main/packages/solid-query/src/isRestoring.ts#L19) +Defined in: [packages/solid-query/src/isRestoring.ts:19](https://github.com/TanStack/query/blob/main/packages/solid-query/src/isRestoring.ts#L19) The Provider that `PersistQueryClientProvider` uses to signal whether a persisted client is currently being restored, read by `useIsRestoring`. diff --git a/docs/framework/solid/reference/variables/QueryClientContext.md b/docs/framework/solid/reference/variables/QueryClientContext.md index b8883f1e9fd..531b7630c2d 100644 --- a/docs/framework/solid/reference/variables/QueryClientContext.md +++ b/docs/framework/solid/reference/variables/QueryClientContext.md @@ -7,6 +7,6 @@ title: QueryClientContext const QueryClientContext: Context<() => QueryClient | undefined>; ``` -Defined in: [QueryClientProvider.tsx:13](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClientProvider.tsx#L13) +Defined in: [packages/solid-query/src/QueryClientProvider.tsx:13](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClientProvider.tsx#L13) The context that `useQueryClient` reads from. `QueryClientProvider` is the normal way to set it. diff --git a/docs/framework/solid/reference/variables/createInfiniteQuery.md b/docs/framework/solid/reference/variables/createInfiniteQuery.md index 1b388183d4b..b9cf1879ec2 100644 --- a/docs/framework/solid/reference/variables/createInfiniteQuery.md +++ b/docs/framework/solid/reference/variables/createInfiniteQuery.md @@ -10,7 +10,7 @@ const createInfiniteQuery: { } = useInfiniteQuery; ``` -Defined in: [index.ts:72](https://github.com/TanStack/query/blob/main/packages/solid-query/src/index.ts#L72) +Defined in: [packages/solid-query/src/index.ts:72](https://github.com/TanStack/query/blob/main/packages/solid-query/src/index.ts#L72) ## Call Signature @@ -35,7 +35,7 @@ This overload is selected when `initialData` is set. #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -131,7 +131,7 @@ The options for `useInfiniteQuery` are identical to `useQuery`, with the additio #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey diff --git a/docs/framework/solid/reference/variables/createMutation.md b/docs/framework/solid/reference/variables/createMutation.md index 59f2192276a..1fb965458c9 100644 --- a/docs/framework/solid/reference/variables/createMutation.md +++ b/docs/framework/solid/reference/variables/createMutation.md @@ -7,7 +7,7 @@ title: createMutation const createMutation: (options, queryClient?) => UseMutationResult = useMutation; ``` -Defined in: [index.ts:80](https://github.com/TanStack/query/blob/main/packages/solid-query/src/index.ts#L80) +Defined in: [packages/solid-query/src/index.ts:80](https://github.com/TanStack/query/blob/main/packages/solid-query/src/index.ts#L80) ## Type Parameters diff --git a/docs/framework/solid/reference/variables/createQueries.md b/docs/framework/solid/reference/variables/createQueries.md index e535e04ce29..cbda52b5bb6 100644 --- a/docs/framework/solid/reference/variables/createQueries.md +++ b/docs/framework/solid/reference/variables/createQueries.md @@ -7,7 +7,7 @@ title: createQueries const createQueries: (queriesOptions, queryClient?) => TCombinedResult = useQueries; ``` -Defined in: [index.ts:86](https://github.com/TanStack/query/blob/main/packages/solid-query/src/index.ts#L86) +Defined in: [packages/solid-query/src/index.ts:86](https://github.com/TanStack/query/blob/main/packages/solid-query/src/index.ts#L86) The `useQueries` hook can be used to fetch a variable number of queries. @@ -36,31 +36,31 @@ previously rendered queries, because the number of queries can differ between re `TCombinedResult` *extends* \| \[\] \| \[ - \| `QueryObserverRefetchErrorResult`\<`unknown`, `Error`\> - \| `QueryObserverSuccessResult`\<`unknown`, `Error`\> - \| `QueryObserverLoadingErrorResult`\<`unknown`, `Error`\> - \| `QueryObserverLoadingResult`\<`unknown`, `Error`\> - \| `QueryObserverPendingResult`\<`unknown`, `Error`\> - \| `QueryObserverPlaceholderResult`\<`unknown`, `Error`\> - \| `QueryObserverRefetchErrorResult`\<`unknown`, `unknown`\> - \| `QueryObserverSuccessResult`\<`unknown`, `unknown`\> - \| `QueryObserverLoadingErrorResult`\<`unknown`, `unknown`\> - \| `QueryObserverLoadingResult`\<`unknown`, `unknown`\> - \| `QueryObserverPendingResult`\<`unknown`, `unknown`\> - \| `QueryObserverPlaceholderResult`\<`unknown`, `unknown`\>\] + \| [`QueryObserverRefetchErrorResult`](../interfaces/QueryObserverRefetchErrorResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverSuccessResult`](../interfaces/QueryObserverSuccessResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverLoadingErrorResult`](../interfaces/QueryObserverLoadingErrorResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverLoadingResult`](../interfaces/QueryObserverLoadingResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverPendingResult`](../interfaces/QueryObserverPendingResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverPlaceholderResult`](../interfaces/QueryObserverPlaceholderResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverRefetchErrorResult`](../interfaces/QueryObserverRefetchErrorResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverSuccessResult`](../interfaces/QueryObserverSuccessResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverLoadingErrorResult`](../interfaces/QueryObserverLoadingErrorResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverLoadingResult`](../interfaces/QueryObserverLoadingResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverPendingResult`](../interfaces/QueryObserverPendingResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverPlaceholderResult`](../interfaces/QueryObserverPlaceholderResult.md)\<`unknown`, `unknown`\>\] \| ( - \| `QueryObserverRefetchErrorResult`\<`unknown`, `Error`\> - \| `QueryObserverSuccessResult`\<`unknown`, `Error`\> - \| `QueryObserverLoadingErrorResult`\<`unknown`, `Error`\> - \| `QueryObserverLoadingResult`\<`unknown`, `Error`\> - \| `QueryObserverPendingResult`\<`unknown`, `Error`\> - \| `QueryObserverPlaceholderResult`\<`unknown`, `Error`\> - \| `QueryObserverRefetchErrorResult`\<`unknown`, `unknown`\> - \| `QueryObserverSuccessResult`\<`unknown`, `unknown`\> - \| `QueryObserverLoadingErrorResult`\<`unknown`, `unknown`\> - \| `QueryObserverLoadingResult`\<`unknown`, `unknown`\> - \| `QueryObserverPendingResult`\<`unknown`, `unknown`\> - \| `QueryObserverPlaceholderResult`\<`unknown`, `unknown`\>)[] = `T` *extends* \[\] ? \[\] : `T` *extends* \[`Head`\] ? \[`GetResults`\<`Head`\>\] : `T` *extends* \[`Head`, `...Tail[]`\] ? \[`...Tail[]`\] *extends* \[\] ? \[\] : \[`...Tail[]`\] *extends* \[`Head`\] ? \[`GetResults`\<`Head`\>, `GetResults`\<`Head`\>\] : \[`...Tail[]`\] *extends* \[`Head`, `...Tail[]`\] ? \[`...Tail[]`\] *extends* \[\] ? \[\] : \[`...Tail[]`\] *extends* \[`Head`\] ? \[`GetResults`\<...\>, `GetResults`\<...\>, `GetResults`\<...\>\] : \[`...(...)[]`\] *extends* \[..., `...(...)[]`\] ? ... *extends* ... ? ... : ... : \[`...(...)[]`\] : \[...\{ \[K in string \| number \| symbol\]: GetResults\<(...)\[(...)\]\> \}\[\]\] : \{ \[K in string \| number \| symbol\]: GetResults\\]\> \} + \| [`QueryObserverRefetchErrorResult`](../interfaces/QueryObserverRefetchErrorResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverSuccessResult`](../interfaces/QueryObserverSuccessResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverLoadingErrorResult`](../interfaces/QueryObserverLoadingErrorResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverLoadingResult`](../interfaces/QueryObserverLoadingResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverPendingResult`](../interfaces/QueryObserverPendingResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverPlaceholderResult`](../interfaces/QueryObserverPlaceholderResult.md)\<`unknown`, `Error`\> + \| [`QueryObserverRefetchErrorResult`](../interfaces/QueryObserverRefetchErrorResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverSuccessResult`](../interfaces/QueryObserverSuccessResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverLoadingErrorResult`](../interfaces/QueryObserverLoadingErrorResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverLoadingResult`](../interfaces/QueryObserverLoadingResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverPendingResult`](../interfaces/QueryObserverPendingResult.md)\<`unknown`, `unknown`\> + \| [`QueryObserverPlaceholderResult`](../interfaces/QueryObserverPlaceholderResult.md)\<`unknown`, `unknown`\>)[] = `T` *extends* \[\] ? \[\] : `T` *extends* \[`Head`\] ? \[`GetResults`\<`Head`\>\] : `T` *extends* \[`Head`, `...Tail[]`\] ? \[`...Tail[]`\] *extends* \[\] ? \[\] : \[`...Tail[]`\] *extends* \[`Head`\] ? \[`GetResults`\<`Head`\>, `GetResults`\<`Head`\>\] : \[`...Tail[]`\] *extends* \[`Head`, `...Tail[]`\] ? \[`...Tail[]`\] *extends* \[\] ? \[\] : \[`...Tail[]`\] *extends* \[`Head`\] ? \[`GetResults`\<...\>, `GetResults`\<...\>, `GetResults`\<...\>\] : \[`...(...)[]`\] *extends* \[..., `...(...)[]`\] ? ... *extends* ... ? ... : ... : \[`...(...)[]`\] : \[...\{ \[K in string \| number \| symbol\]: GetResults\<(...)\[(...)\]\> \}\[\]\] : \{ \[K in string \| number \| symbol\]: GetResults\\]\> \} ## Parameters diff --git a/docs/framework/solid/reference/variables/createQuery.md b/docs/framework/solid/reference/variables/createQuery.md index 3f0810f24ad..df4c4c094b0 100644 --- a/docs/framework/solid/reference/variables/createQuery.md +++ b/docs/framework/solid/reference/variables/createQuery.md @@ -10,7 +10,7 @@ const createQuery: { } = useQuery; ``` -Defined in: [index.ts:57](https://github.com/TanStack/query/blob/main/packages/solid-query/src/index.ts#L57) +Defined in: [packages/solid-query/src/index.ts:57](https://github.com/TanStack/query/blob/main/packages/solid-query/src/index.ts#L57) ## Call Signature diff --git a/docs/framework/solid/reference/variables/dataTagErrorSymbol.md b/docs/framework/solid/reference/variables/dataTagErrorSymbol.md new file mode 100644 index 00000000000..20bab62fb01 --- /dev/null +++ b/docs/framework/solid/reference/variables/dataTagErrorSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagErrorSymbol +title: dataTagErrorSymbol +--- + +```ts +const dataTagErrorSymbol: typeof dataTagErrorSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:63](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L63) diff --git a/docs/framework/solid/reference/variables/dataTagSymbol.md b/docs/framework/solid/reference/variables/dataTagSymbol.md new file mode 100644 index 00000000000..83dd68a56e9 --- /dev/null +++ b/docs/framework/solid/reference/variables/dataTagSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagSymbol +title: dataTagSymbol +--- + +```ts +const dataTagSymbol: typeof dataTagSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L61) diff --git a/docs/framework/solid/reference/variables/defaultScheduler.md b/docs/framework/solid/reference/variables/defaultScheduler.md new file mode 100644 index 00000000000..70e14d3f846 --- /dev/null +++ b/docs/framework/solid/reference/variables/defaultScheduler.md @@ -0,0 +1,13 @@ +--- +id: defaultScheduler +title: defaultScheduler +--- + +```ts +const defaultScheduler: ScheduleFunction = systemSetTimeoutZero; +``` + +Defined in: [packages/query-core/src/notifyManager.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L19) + +Default scheduling function used by the notify manager. +Schedules the callback with the system's `setTimeout(callback, 0)`. diff --git a/docs/framework/solid/reference/variables/environmentManager.md b/docs/framework/solid/reference/variables/environmentManager.md new file mode 100644 index 00000000000..caa1d70b2b6 --- /dev/null +++ b/docs/framework/solid/reference/variables/environmentManager.md @@ -0,0 +1,44 @@ +--- +id: environmentManager +title: environmentManager +--- + +```ts +const environmentManager: object; +``` + +Defined in: [packages/query-core/src/environmentManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L15) + +Manages environment detection used by TanStack Query internals. + +## Type Declaration + +### isServer() + +```ts +isServer: () => boolean; +``` + +Returns whether the current runtime should be treated as a server environment. + +#### Returns + +`boolean` + +### setIsServer() + +```ts +setIsServer(isServerValue): void; +``` + +Overrides the server check globally. + +#### Parameters + +##### isServerValue + +`IsServerValue` + +#### Returns + +`void` diff --git a/docs/framework/solid/reference/variables/focusManager.md b/docs/framework/solid/reference/variables/focusManager.md new file mode 100644 index 00000000000..cbf7fcb4a17 --- /dev/null +++ b/docs/framework/solid/reference/variables/focusManager.md @@ -0,0 +1,12 @@ +--- +id: focusManager +title: focusManager +--- + +```ts +const focusManager: FocusManager; +``` + +Defined in: [packages/query-core/src/focusManager.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L142) + +Singleton instance of FocusManager, used to manage and observe the focus state within TanStack Query. diff --git a/docs/framework/solid/reference/variables/isServer.md b/docs/framework/solid/reference/variables/isServer.md new file mode 100644 index 00000000000..28956d55cbf --- /dev/null +++ b/docs/framework/solid/reference/variables/isServer.md @@ -0,0 +1,14 @@ +--- +id: isServer +title: isServer +--- + +```ts +const isServer: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L112) + +## Deprecated + +use `environmentManager.isServer()` instead. diff --git a/docs/framework/solid/reference/variables/notifyManager.md b/docs/framework/solid/reference/variables/notifyManager.md new file mode 100644 index 00000000000..e5ecca8df60 --- /dev/null +++ b/docs/framework/solid/reference/variables/notifyManager.md @@ -0,0 +1,156 @@ +--- +id: notifyManager +title: notifyManager +--- + +```ts +const notifyManager: object; +``` + +Defined in: [packages/query-core/src/notifyManager.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L135) + +Handles scheduling and batching callbacks in TanStack Query. + +## Type Declaration + +### batch() + +```ts +readonly batch: (callback) => T; +``` + +Batches all updates scheduled inside the passed callback. +This is mainly used internally to optimize query client updating. +Batches can be nested; the queue is only flushed once the outermost `batch` call finishes. +The return value of `callback` is passed through. + +#### Type Parameters + +##### T + +`T` + +#### Parameters + +##### callback + +() => `T` + +#### Returns + +`T` + +### batchCalls() + +```ts +readonly batchCalls: (callback) => BatchCallsCallback; +``` + +All calls to the wrapped function will be batched. + +#### Type Parameters + +##### T + +`T` *extends* `unknown`[] + +#### Parameters + +##### callback + +`BatchCallsCallback`\<`T`\> + +#### Returns + +`BatchCallsCallback`\<`T`\> + +### schedule() + +```ts +schedule: (callback) => void; +``` + +Schedules a function to be run on the next batch. +By default, the batch is run with a `setTimeout`, but this can be configured via `setScheduler`. + +#### Parameters + +##### callback + +`NotifyCallback` + +#### Returns + +`void` + +### setBatchNotifyFunction() + +```ts +readonly setBatchNotifyFunction: (fn) => void; +``` + +Use this method to set a custom function to batch notifications together into a single tick. +By default React Query will use the batch function provided by ReactDOM or React Native. + +#### Parameters + +##### fn + +`BatchNotifyFunction` + +#### Returns + +`void` + +### setNotifyFunction() + +```ts +readonly setNotifyFunction: (fn) => void; +``` + +Use this method to set a custom notify function. +This can be used to for example wrap notifications with `React.act` while running tests. + +#### Parameters + +##### fn + +`NotifyFunction` + +#### Returns + +`void` + +### setScheduler() + +```ts +readonly setScheduler: (fn) => void; +``` + +Configures a custom callback that schedules when the next batch runs. +The default behavior is `setTimeout(callback, 0)`. + +#### Parameters + +##### fn + +`ScheduleFunction` + +#### Returns + +`void` + +#### Example + +```ts +import { notifyManager } from '@tanstack/query-core' + +// Schedule batches in the next microtask +notifyManager.setScheduler(queueMicrotask) + +// Schedule batches before the next frame is rendered +notifyManager.setScheduler(requestAnimationFrame) + +// Schedule batches some time in the future +notifyManager.setScheduler((cb) => setTimeout(cb, 10)) +``` diff --git a/docs/framework/solid/reference/variables/onlineManager.md b/docs/framework/solid/reference/variables/onlineManager.md new file mode 100644 index 00000000000..4ae083f245b --- /dev/null +++ b/docs/framework/solid/reference/variables/onlineManager.md @@ -0,0 +1,12 @@ +--- +id: onlineManager +title: onlineManager +--- + +```ts +const onlineManager: OnlineManager; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L117) + +Singleton instance of OnlineManager, used to manage and observe the online state within TanStack Query. diff --git a/docs/framework/solid/reference/variables/skipToken.md b/docs/framework/solid/reference/variables/skipToken.md new file mode 100644 index 00000000000..3163e91c1c2 --- /dev/null +++ b/docs/framework/solid/reference/variables/skipToken.md @@ -0,0 +1,23 @@ +--- +id: skipToken +title: skipToken +--- + +```ts +const skipToken: typeof skipToken; +``` + +Defined in: [packages/query-core/src/utils.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L520) + +Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent +to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`, +a query disabled via `skipToken` cannot be triggered with `refetch`. + +## Example + +```ts +new QueryObserver(queryClient, { + queryKey: ['post', postId], + queryFn: postId != null ? () => fetchPost(postId) : skipToken, +}) +``` diff --git a/docs/framework/solid/reference/variables/timeoutManager.md b/docs/framework/solid/reference/variables/timeoutManager.md new file mode 100644 index 00000000000..2dcfa29b55a --- /dev/null +++ b/docs/framework/solid/reference/variables/timeoutManager.md @@ -0,0 +1,12 @@ +--- +id: timeoutManager +title: timeoutManager +--- + +```ts +const timeoutManager: TimeoutManager; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:226](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L226) + +Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/solid/reference/variables/unsetMarker.md b/docs/framework/solid/reference/variables/unsetMarker.md new file mode 100644 index 00000000000..d19ee65b38e --- /dev/null +++ b/docs/framework/solid/reference/variables/unsetMarker.md @@ -0,0 +1,10 @@ +--- +id: unsetMarker +title: unsetMarker +--- + +```ts +const unsetMarker: typeof unsetMarker; +``` + +Defined in: [packages/query-core/src/types.ts:65](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L65) diff --git a/docs/framework/svelte/reference/classes/CancelledError.md b/docs/framework/svelte/reference/classes/CancelledError.md new file mode 100644 index 00000000000..7fded5da20f --- /dev/null +++ b/docs/framework/svelte/reference/classes/CancelledError.md @@ -0,0 +1,273 @@ +--- +id: CancelledError +title: CancelledError +--- + +Defined in: [packages/query-core/src/retryer.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L77) + +The error thrown by a `Retryer` (and surfaced to `query.promise`/`mutation`) when a fetch is cancelled, e.g. via +`query.cancel()`. `revert`, if `true`, tells the caller to restore the state the query was in before the fetch +started instead of surfacing the error. `silent`, if `true`, tells the caller to suppress this error and instead +resolve with the promise of the fetch that triggered the cancellation. + +## Example + +```ts +query.cancel() + +try { + await query.promise +} catch (error) { + if (error instanceof CancelledError) { + // the fetch was cancelled, e.g. via `query.cancel()` + } +} +``` + +## Extends + +- `Error` + +## Constructors + +### Constructor + +```ts +new CancelledError(options?): CancelledError; +``` + +Defined in: [packages/query-core/src/retryer.ts:80](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L80) + +#### Parameters + +##### options? + +[`CancelOptions`](../interfaces/CancelOptions.md) + +#### Returns + +`CancelledError` + +#### Overrides + +```ts +Error.constructor +``` + +## Properties + +### cause? + +```ts +optional cause: unknown; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24 + +#### Inherited from + +```ts +Error.cause +``` + +*** + +### message + +```ts +message: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 + +#### Inherited from + +```ts +Error.message +``` + +*** + +### name + +```ts +name: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 + +#### Inherited from + +```ts +Error.name +``` + +*** + +### revert? + +```ts +optional revert: boolean; +``` + +Defined in: [packages/query-core/src/retryer.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L78) + +*** + +### silent? + +```ts +optional silent: boolean; +``` + +Defined in: [packages/query-core/src/retryer.ts:79](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L79) + +*** + +### stack? + +```ts +optional stack: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 + +#### Inherited from + +```ts +Error.stack +``` + +*** + +### stackTraceLimit + +```ts +static stackTraceLimit: number; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:68 + +The `Error.stackTraceLimit` property specifies the number of stack frames +collected by a stack trace (whether generated by `new Error().stack` or +`Error.captureStackTrace(obj)`). + +The default value is `10` but may be set to any valid JavaScript number. Changes +will affect any stack trace captured _after_ the value has been changed. + +If set to a non-number value, or set to a negative number, stack traces will +not capture any frames. + +#### Inherited from + +```ts +Error.stackTraceLimit +``` + +## Methods + +### captureStackTrace() + +```ts +static captureStackTrace(targetObject, constructorOpt?): void; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:52 + +Creates a `.stack` property on `targetObject`, which when accessed returns +a string representing the location in the code at which +`Error.captureStackTrace()` was called. + +```js +const myObject = {}; +Error.captureStackTrace(myObject); +myObject.stack; // Similar to `new Error().stack` +``` + +The first line of the trace will be prefixed with +`${myObject.name}: ${myObject.message}`. + +The optional `constructorOpt` argument accepts a function. If given, all frames +above `constructorOpt`, including `constructorOpt`, will be omitted from the +generated stack trace. + +The `constructorOpt` argument is useful for hiding implementation +details of error generation from the user. For instance: + +```js +function a() { + b(); +} + +function b() { + c(); +} + +function c() { + // Create an error without stack trace to avoid calculating the stack trace twice. + const { stackTraceLimit } = Error; + Error.stackTraceLimit = 0; + const error = new Error(); + Error.stackTraceLimit = stackTraceLimit; + + // Capture the stack trace above function b + Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace + throw error; +} + +a(); +``` + +#### Parameters + +##### targetObject + +`object` + +##### constructorOpt? + +`Function` + +#### Returns + +`void` + +#### Inherited from + +```ts +Error.captureStackTrace +``` + +*** + +### prepareStackTrace() + +```ts +static prepareStackTrace(err, stackTraces): any; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:56 + +#### Parameters + +##### err + +`Error` + +##### stackTraces + +`CallSite`[] + +#### Returns + +`any` + +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +```ts +Error.prepareStackTrace +``` diff --git a/docs/framework/svelte/reference/classes/InfiniteQueryObserver.md b/docs/framework/svelte/reference/classes/InfiniteQueryObserver.md new file mode 100644 index 00000000000..af43087a3ad --- /dev/null +++ b/docs/framework/svelte/reference/classes/InfiniteQueryObserver.md @@ -0,0 +1,665 @@ +--- +id: InfiniteQueryObserver +title: InfiniteQueryObserver +--- + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L41) + +An `InfiniteQueryObserver` extends `QueryObserver` to observe and switch +between infinite queries. It augments the base `QueryObserverResult` with +infinite-query-specific fields and methods, such as `hasNextPage` and +`fetchNextPage`, and is the primitive that framework adapters (e.g. +`useInfiniteQuery`) build their hooks on top of. + +## Example + +```ts +const observer = new InfiniteQueryObserver(queryClient, { + queryKey: ['projects'], + queryFn: ({ pageParam }) => fetchProjects(pageParam), + initialPageParam: 0, + getNextPageParam: (lastPage) => lastPage.nextCursor, +}) + +const unsubscribe = observer.subscribe((result) => console.log(result)) +``` + +## Extends + +- [`QueryObserver`](QueryObserver.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Constructors + +### Constructor + +```ts +new InfiniteQueryObserver(client, options): InfiniteQueryObserver; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L83) + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`InfiniteQueryObserver`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`constructor`](QueryObserver.md#constructor) + +## Properties + +### fetch + +```ts +protected fetch: ReplaceReturnType<(fetchOptions) => Promise>, Promise>>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:72](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L72) + +#### Overrides + +```ts +QueryObserver.fetch +``` + +*** + +### getCurrentResult + +```ts +getCurrentResult: ReplaceReturnType<() => QueryObserverResult, InfiniteQueryObserverResult>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L60) + +Returns the most recently computed `QueryObserverResult` for the +observed query. This is a point-in-time read; to be notified of updates +as they happen, subscribe to the observer instead (its inherited +`subscribe` method). + +#### Example + +```ts +const result = observer.getCurrentResult() +console.log(result.status, result.data) +``` + +#### Overrides + +```ts +QueryObserver.getCurrentResult +``` + +*** + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`listeners`](QueryObserver.md#listeners) + +*** + +### options + +```ts +options: QueryObserverOptions, TQueryKey>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L89) + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`options`](QueryObserver.md#options) + +*** + +### subscribe() + +```ts +subscribe: (listener) => () => void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L55) + +#### Parameters + +##### listener + +`InfiniteQueryObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Overrides + +```ts +QueryObserver.subscribe +``` + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L96) + +#### Returns + +`void` + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`bindMethods`](QueryObserver.md#bindmethods) + +*** + +### createResult() + +```ts +protected createResult(query, options): InfiniteQueryObserverResult; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:201](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L201) + +#### Parameters + +##### query + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`createResult`](QueryObserver.md#createresult) + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L161) + +Stops observing the current query: clears all listeners, cancels the +stale and refetch-interval timers, and removes this observer from the +query it was observing. + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`destroy`](QueryObserver.md#destroy) + +*** + +### fetchNextPage() + +```ts +fetchNextPage(options?): Promise>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L161) + +Fetches the next page of the infinite query and returns a promise that +resolves with the resulting `InfiniteQueryObserverResult`. The page +param used for the fetch is determined by `getNextPageParam`, which +receives the current pages/page params and whose result also determines +`hasNextPage`. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](../interfaces/FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const { hasNextPage } = observer.getCurrentResult() + +if (hasNextPage) { + await observer.fetchNextPage() +} +``` + +#### See + +[InfiniteQueryObserver#fetchPreviousPage](#fetchpreviouspage) + +*** + +### fetchOptimistic() + +```ts +fetchOptimistic(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:395](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L395) + +Fetches a query defined by the given options without affecting this +observer's own tracked query or result, and returns a promise that +resolves with the `QueryObserverResult` for that fetch. This is useful +for prefetching data that another observer (e.g. a query about to be +navigated to) will need, ahead of time. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.fetchOptimistic({ + queryKey: ['posts', 2], + queryFn: () => fetchPost(2), +}) +console.log(result.data) +``` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`fetchOptimistic`](QueryObserver.md#fetchoptimistic) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage(options?): Promise>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:190](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L190) + +Fetches the previous page of the infinite query and returns a promise +that resolves with the resulting `InfiniteQueryObserverResult`. The page +param used for the fetch is determined by `getPreviousPageParam`, which +receives the current pages/page params and whose result also determines +`hasPreviousPage`. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](../interfaces/FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const { hasPreviousPage } = observer.getCurrentResult() + +if (hasPreviousPage) { + await observer.fetchPreviousPage() +} +``` + +#### See + +[InfiniteQueryObserver#fetchNextPage](#fetchnextpage) + +*** + +### getCurrentQuery() + +```ts +getCurrentQuery(): Query, TQueryKey>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:357](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L357) + +Returns the `Query` instance this observer is currently observing. + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`getCurrentQuery`](QueryObserver.md#getcurrentquery) + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(options): InfiniteQueryObserverResult; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L127) + +The infinite-query counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult), marking the +options as an infinite query before delegating to it. Called by framework adapters (e.g. +`useInfiniteQuery`) ahead of subscribing, to compute the current `InfiniteQueryObserverResult` +synchronously. + +#### Parameters + +##### options + +[`DefaultedInfiniteQueryObserverOptions`](../type-aliases/DefaultedInfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`getOptimisticResult`](QueryObserver.md#getoptimisticresult) + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`hasListeners`](QueryObserver.md#haslisteners) + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L110) + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`onSubscribe`](QueryObserver.md#onsubscribe) + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L124) + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`onUnsubscribe`](QueryObserver.md#onunsubscribe) + +*** + +### refetch() + +```ts +refetch(__namedParameters): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L371) + +Refetches the observed query and returns a promise that resolves with +the resulting `QueryObserverResult`. + +#### Parameters + +##### \_\_namedParameters + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.refetch({ cancelRefetch: false }) +console.log(result.data) +``` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`refetch`](QueryObserver.md#refetch) + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:108](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L108) + +Updates the observer's options. Behaves the same as +`QueryObserver.setOptions`, additionally marking the options as +belonging to an infinite query before delegating to the base +implementation. + +#### Parameters + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`void` + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`setOptions`](QueryObserver.md#setoptions) + +*** + +### shouldFetchOnReconnect() + +```ts +shouldFetchOnReconnect(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L135) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnReconnect` option) to refetch when the network +reconnects. + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`shouldFetchOnReconnect`](QueryObserver.md#shouldfetchonreconnect) + +*** + +### shouldFetchOnWindowFocus() + +```ts +shouldFetchOnWindowFocus(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L148) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnWindowFocus` option) to refetch when the window +regains focus. + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`shouldFetchOnWindowFocus`](QueryObserver.md#shouldfetchonwindowfocus) + +*** + +### trackProp() + +```ts +trackProp(key): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:350](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L350) + +Records that the given `QueryObserverResult` property was read, so a subsequent update only +notifies this observer if a tracked property actually changed. Normally called indirectly via +[QueryObserver#trackResult](QueryObserver.md#trackresult)'s proxy; exposed directly for adapters that track property +access themselves (e.g. through their own reactivity system) instead of via the proxy. + +#### Parameters + +##### key + +`"error"` | `"data"` | `"isError"` | `"isPending"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isSuccess"` | `"isPlaceholderData"` | `"status"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`trackProp`](QueryObserver.md#trackprop) + +*** + +### trackResult() + +```ts +trackResult(result, onPropTracked?): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:331](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L331) + +Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via +[QueryObserver#trackProp](QueryObserver.md#trackprop) (and an optional `onPropTracked` callback). Used by framework +adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on +properties you actually read" behavior. + +#### Parameters + +##### result + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +##### onPropTracked? + +(`key`) => `void` + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`trackResult`](QueryObserver.md#trackresult) + +*** + +### updateResult() + +```ts +updateResult(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L735) + +Recomputes and stores the current result from the current query/options, notifying listeners +if it changed. Framework adapters call this right after subscribing to make sure no query +update was missed in the gap between creating the observer and subscribing to it. + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`updateResult`](QueryObserver.md#updateresult) diff --git a/docs/framework/svelte/reference/classes/Mutation.md b/docs/framework/svelte/reference/classes/Mutation.md new file mode 100644 index 00000000000..4e85a5b2d4c --- /dev/null +++ b/docs/framework/svelte/reference/classes/Mutation.md @@ -0,0 +1,329 @@ +--- +id: Mutation +title: Mutation +--- + +Defined in: [packages/query-core/src/mutation.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L135) + +Represents a single mutation attempt. A `Mutation` holds the mutation's +options, state (data/error/status), and the `MutationObserver`s currently +subscribed to it. + +Instances are created and managed internally by `MutationCache`; application +code typically interacts with mutations indirectly through `QueryClient` or +a framework hook like `useMutation`. Direct access to a `Mutation` instance +is possible via `mutationCache.find()`/`getAll()` for inspecting cache state. + +## Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +``` + +## Extends + +- `Removable` + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Constructors + +### Constructor + +```ts +new Mutation(config): Mutation; +``` + +Defined in: [packages/query-core/src/mutation.ts:152](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L152) + +#### Parameters + +##### config + +`MutationConfig`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`Mutation`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Overrides + +```ts +Removable.constructor +``` + +## Properties + +### gcTime + +```ts +gcTime: number; +``` + +Defined in: [packages/query-core/src/removable.ts:7](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L7) + +#### Inherited from + +```ts +Removable.gcTime +``` + +*** + +### mutationId + +```ts +readonly mutationId: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:143](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L143) + +*** + +### options + +```ts +options: MutationOptions; +``` + +Defined in: [packages/query-core/src/mutation.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L142) + +*** + +### state + +```ts +state: MutationState; +``` + +Defined in: [packages/query-core/src/mutation.ts:141](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L141) + +## Accessors + +### meta + +#### Get Signature + +```ts +get meta(): Record | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:179](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L179) + +The `meta` object passed in the mutation's options, if any. + +##### Returns + +`Record`\<`string`, `unknown`\> \| `undefined` + +## Methods + +### clearGcTimeout() + +```ts +protected clearGcTimeout(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L32) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.clearGcTimeout +``` + +*** + +### continue() + +```ts +continue(): Promise; +``` + +Defined in: [packages/query-core/src/mutation.ts:243](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L243) + +Resumes a mutation that is currently paused or was restored from a +dehydrated, still-`pending` state. + +- If this mutation has an active retryer (it paused mid-attempt, e.g. due + to the network mode or scope-based queuing), its retryer is resumed. +- Otherwise, if the mutation's status is still `pending` (e.g. it was + dehydrated while an attempt was in flight and never got a retryer in + this instance), `execute` is called again with the last known variables. +- Otherwise the mutation has already settled and this resolves immediately + without running anything again. + +#### Returns + +`Promise`\<`unknown`\> + +#### Example + +```ts +// typically driven by reconnect handling, e.g. queryClient.resumePausedMutations() +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +await mutation?.continue() +``` + +#### See + +[Mutation#execute](#execute) + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:10](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L10) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.destroy +``` + +*** + +### execute() + +```ts +execute(variables): Promise; +``` + +Defined in: [packages/query-core/src/mutation.ts:283](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L283) + +Runs the mutation function for the given variables through a retryer, and +drives the mutation's state and lifecycle callbacks through to settlement. + +If this mutation's state is already `pending` when `execute` is called +(i.e. it was restored, still in-flight, from a dehydrated state), the +`onMutate` step is skipped and a `continue` action is dispatched to +unpause it; otherwise a `pending` action is dispatched first, then the +mutation cache's `onMutate` and the mutation's own `onMutate` option are +awaited in that order, and the resulting context is stored. + +The mutation function is then run (subject to `retry`/`retryDelay`/ +`networkMode`, and to the mutation cache's scope-based serialization). +On success, the cache's `onSuccess`/`onSettled` callbacks run before the +mutation's own `onSuccess`/`onSettled` options, a `success` action is +dispatched, and the resolved data is returned. On failure, the same +cache-then-option ordering is used for `onError`/`onSettled`, but each of +those four callbacks is individually caught so that a throwing callback +cannot mask the original error; an `error` action is then dispatched and +the original error is re-thrown. + +#### Parameters + +##### variables + +`TVariables` + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +// typically invoked by MutationObserver.mutate, not called directly +const data = await mutation.execute(variables) +``` + +#### See + +[Mutation#continue](#continue) + +*** + +### optionalRemove() + +```ts +protected optionalRemove(): void; +``` + +Defined in: [packages/query-core/src/mutation.ts:212](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L212) + +#### Returns + +`void` + +#### Overrides + +```ts +Removable.optionalRemove +``` + +*** + +### scheduleGc() + +```ts +protected scheduleGc(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L14) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.scheduleGc +``` + +*** + +### updateGcTime() + +```ts +protected updateGcTime(newGcTime): void; +``` + +Defined in: [packages/query-core/src/removable.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L24) + +#### Parameters + +##### newGcTime + +`number` | `undefined` + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.updateGcTime +``` diff --git a/docs/framework/svelte/reference/classes/MutationCache.md b/docs/framework/svelte/reference/classes/MutationCache.md new file mode 100644 index 00000000000..f79919b1c4b --- /dev/null +++ b/docs/framework/svelte/reference/classes/MutationCache.md @@ -0,0 +1,308 @@ +--- +id: MutationCache +title: MutationCache +--- + +Defined in: [packages/query-core/src/mutationCache.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L117) + +The `MutationCache` is the storage for mutations. + +Normally, you will not interact with the `MutationCache` directly and instead use a +`QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of +safe/known updates to the cache, such as mutations being added, removed, or updated. + +## Extends + +- `Subscribable`\<`MutationCacheListener`\> + +## Constructors + +### Constructor + +```ts +new MutationCache(config): MutationCache; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) + +#### Parameters + +##### config + +[`MutationCacheConfig`](../interfaces/MutationCacheConfig.md) = `{}` + +#### Returns + +`MutationCache` + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### config + +```ts +config: MutationCacheConfig = {}; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) + +*** + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:229](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L229) + +Removes all mutations from the cache. + +#### Returns + +`void` + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +mutationCache.clear() +``` + +*** + +### find() + +```ts +find(filters): + | Mutation + | undefined; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L271) + +A slightly more advanced method that can be used to get an existing mutation instance from +the cache. If the mutation does not exist, `undefined` is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about a mutation in rare scenarios. + +#### Type Parameters + +##### TData + +`TData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TVariables + +`TVariables` = `any` + +##### TOnMutateResult + +`TOnMutateResult` = `unknown` + +#### Parameters + +##### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) + +#### Returns + + \| [`Mutation`](Mutation.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + \| `undefined` + +#### See + +[MutationCache#findAll](#findall) + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +``` + +*** + +### findAll() + +```ts +findAll(filters): Mutation[]; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:301](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L301) + +An even more advanced method that can be used to get existing mutation instances from the +cache that match the given filters. If no mutations match, an empty array is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about mutations in rare scenarios. + +#### Parameters + +##### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) = `{}` + +#### Returns + +[`Mutation`](Mutation.md)\<`unknown`, `Error`, `unknown`, `unknown`\>[] + +#### See + +[MutationCache#find](#find) + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutations = mutationCache.findAll({ mutationKey: ['addPost'] }) +``` + +*** + +### getAll() + +```ts +getAll(): Mutation[]; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:252](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L252) + +Returns all mutations within the cache. + +This is not typically needed for most applications, but can come in handy when needing more +information about a mutation in rare scenarios. + +#### Returns + +[`Mutation`](Mutation.md)\<`unknown`, `Error`, `unknown`, `unknown`\>[] + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutations = mutationCache.getAll() +``` + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L23) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L27) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`MutationCacheListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/svelte/reference/classes/MutationObserver.md b/docs/framework/svelte/reference/classes/MutationObserver.md new file mode 100644 index 00000000000..a121c67b0e8 --- /dev/null +++ b/docs/framework/svelte/reference/classes/MutationObserver.md @@ -0,0 +1,335 @@ +--- +id: MutationObserver +title: MutationObserver +--- + +Defined in: [packages/query-core/src/mutationObserver.ts:38](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L38) + +Observes a single mutation and derives a `MutationObserverResult` from it. +A framework hook like `useMutation` creates one `MutationObserver` per hook +call, keeps it stable across re-renders, calls `setOptions` when the options +passed to the hook change, subscribes to it to re-render on updates, and +reads `getCurrentResult()` for the value to return. Calling `mutate()` +builds a new underlying `Mutation` in the `MutationCache` and executes it. + +## Example + +```ts +const observer = new MutationObserver(queryClient, { + mutationFn: (variables: { title: string }) => addPost(variables), +}) +``` + +## Extends + +- `Subscribable`\<`MutationObserverListener`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Constructors + +### Constructor + +```ts +new MutationObserver(client, options): MutationObserver; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:58](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L58) + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`MutationObserver`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Overrides + +```ts +Subscribable< + MutationObserverListener +>.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +*** + +### options + +```ts +options: MutationObserverOptions; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:46](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L46) + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L75) + +#### Returns + +`void` + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): MutationObserverResult; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:155](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L155) + +Returns the observer's current result, derived from the observed +mutation's state (or the default, `idle` state if no mutation has been +built yet, e.g. before the first `mutate()` call or after `reset()`). + +#### Returns + +[`MutationObserverResult`](../type-aliases/MutationObserverResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### mutate() + +```ts +mutate(variables, options?): Promise; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:207](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L207) + +Builds a new `Mutation` in the `MutationCache` using the observer's +current options, detaches this observer from any previously observed +mutation, attaches it to the new one, and executes it with the given +variables. + +The optional per-call `options` (`onSuccess`/`onError`/`onSettled`) are +invoked once the mutation settles, in addition to any callbacks defined +on the observer's own options. + +#### Parameters + +##### variables + +`TVariables` + +##### options? + +[`MutateOptions`](../interfaces/MutateOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +await observer.mutate( + { title: 'New post' }, + { onSuccess: (data) => console.log(data) }, +) +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L127) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L135) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### reset() + +```ts +reset(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L180) + +Detaches the observer from the mutation it is currently observing (if +any) and resets the observed result back to its default, `idle` state. + +This does not cancel an in-flight mutation; the mutation itself keeps +running to completion and its own callbacks still fire, but this +observer stops reflecting its state and a subsequent `mutate()` call +will build a brand new mutation. + +#### Returns + +`void` + +#### Example + +```ts +observer.reset() +``` + +#### See + +[MutationObserver#mutate](#mutate) + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L96) + +Updates the observer's options. + +If the new `mutationKey` differs from the previous one (and both were +defined), the observer is reset, detaching it from the mutation it was +observing. Otherwise, if the currently observed mutation is still +`pending`, its options are updated in place as well. + +#### Parameters + +##### options + +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setOptions({ + mutationFn: (variables: { title: string }) => addPost(variables), + onSuccess: (data) => console.log(data), +}) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`MutationObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/svelte/reference/classes/QueriesObserver.md b/docs/framework/svelte/reference/classes/QueriesObserver.md new file mode 100644 index 00000000000..a40f2d2bef6 --- /dev/null +++ b/docs/framework/svelte/reference/classes/QueriesObserver.md @@ -0,0 +1,325 @@ +--- +id: QueriesObserver +title: QueriesObserver +--- + +Defined in: [packages/query-core/src/queriesObserver.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L54) + +A `QueriesObserver` watches an array of queries at once, exposing them as +a single array of `QueryObserverResult`s (or, when a `combine` option is +given, as a combined value derived from that array). It manages one +internal `QueryObserver` per query, and is the primitive that framework +adapters (e.g. `useQueries`) build their hooks on top of. + +## Example + +```ts +const observer = new QueriesObserver(queryClient, [ + { queryKey: ['post', 1], queryFn: fetchPost }, + { queryKey: ['post', 2], queryFn: fetchPost }, +]) + +const unsubscribe = observer.subscribe((result) => { + console.log(result) +}) +``` + +## Extends + +- `Subscribable`\<`QueriesObserverListener`\> + +## Type Parameters + +### TCombinedResult + +`TCombinedResult` = [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +## Constructors + +### Constructor + +```ts +new QueriesObserver( + client, + queries, +options?): QueriesObserver; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L68) + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`any`, `any`, `any`, `any`, `any`, `never`\>[] + +##### options? + +[`QueriesObserverOptions`](../interfaces/QueriesObserverOptions.md)\<`TCombinedResult`\> + +#### Returns + +`QueriesObserver`\<`TCombinedResult`\> + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L104) + +Stops observing all queries: clears all listeners and destroys every +underlying `QueryObserver` this observer manages. + +#### Returns + +`void` + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): QueryObserverResult[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L208) + +Returns the most recently computed array of `QueryObserverResult`s, one +per observed query, in the same order as the queries passed to the +constructor or `setQueries`. + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +#### Example + +```ts +const results = observer.getCurrentResult() +const data = results.map((result) => result.data) +``` + +*** + +### getObservers() + +```ts +getObservers(): QueryObserver[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L225) + +Returns the underlying `QueryObserver` instances this observer manages, +in the same order as the queries passed to the constructor or +`setQueries`. + +#### Returns + +[`QueryObserver`](QueryObserver.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[]\>[] + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(queries, combine): [QueryObserverResult[], (r?) => TCombinedResult, () => QueryObserverResult[]]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L236) + +The `QueriesObserver` counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult) — computes +the result for the given (already-defaulted) queries right now, synchronously. Called by +framework adapters (e.g. `useQueries`) ahead of subscribing, returning a tuple of the raw +per-query results, a function to compute the combined result from them, and a function to +wrap the results for property-access tracking. + +#### Parameters + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[], `never`\>[] + +##### combine + +`CombineFn`\<`TCombinedResult`\> | `undefined` + +#### Returns + +\[[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[], (`r?`) => `TCombinedResult`, () => [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[]\] + +*** + +### getQueries() + +```ts +getQueries(): Query[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:216](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L216) + +Returns the underlying `Query` instances currently being observed, in +the same order as the queries passed to the constructor or `setQueries`. + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L84) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L94) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setQueries() + +```ts +setQueries(queries, options?): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:125](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L125) + +Replaces the set of queries being observed. Existing `QueryObserver`s +are reused for queries that match an already-observed query hash; +observers for queries that are no longer present are destroyed, and new +observers are created and subscribed to for newly added queries. + +#### Parameters + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[], `never`\>[] + +##### options? + +[`QueriesObserverOptions`](../interfaces/QueriesObserverOptions.md)\<`TCombinedResult`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setQueries([ + { queryKey: ['post', 1], queryFn: fetchPost }, + { queryKey: ['post', 3], queryFn: fetchPost }, +]) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueriesObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/svelte/reference/classes/Query.md b/docs/framework/svelte/reference/classes/Query.md new file mode 100644 index 00000000000..bc15461e541 --- /dev/null +++ b/docs/framework/svelte/reference/classes/Query.md @@ -0,0 +1,585 @@ +--- +id: Query +title: Query +--- + +Defined in: [packages/query-core/src/query.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L225) + +Represents a single cached query. A `Query` holds the query's key, options, +state (data/error/status), and the observers currently subscribed to it. + +Instances are created and managed internally by `QueryCache`; application +code typically interacts with queries indirectly through `QueryClient` or +a framework hook like `useQuery`. Direct access to a `Query` instance is +possible via `queryCache.find()`/`findAll()` for inspecting cache state. + +## Example + +```ts +const queryCache = queryClient.getQueryCache() +const query = queryCache.find({ queryKey: ['posts'] }) + +if (query) { + console.log(query.state.dataUpdatedAt) +} +``` + +## Extends + +- `Removable` + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Constructors + +### Constructor + +```ts +new Query(config): Query; +``` + +Defined in: [packages/query-core/src/query.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L246) + +#### Parameters + +##### config + +`QueryConfig`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Query`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Overrides + +```ts +Removable.constructor +``` + +## Properties + +### gcTime + +```ts +gcTime: number; +``` + +Defined in: [packages/query-core/src/removable.ts:7](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L7) + +#### Inherited from + +```ts +Removable.gcTime +``` + +*** + +### observers + +```ts +observers: QueryObserver[]; +``` + +Defined in: [packages/query-core/src/query.ts:242](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L242) + +*** + +### options + +```ts +options: QueryOptions; +``` + +Defined in: [packages/query-core/src/query.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L233) + +*** + +### queryHash + +```ts +queryHash: string; +``` + +Defined in: [packages/query-core/src/query.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L232) + +*** + +### queryKey + +```ts +queryKey: TQueryKey; +``` + +Defined in: [packages/query-core/src/query.ts:231](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L231) + +*** + +### state + +```ts +state: QueryState; +``` + +Defined in: [packages/query-core/src/query.ts:234](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L234) + +## Accessors + +### meta + +#### Get Signature + +```ts +get meta(): Record | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L264) + +The `meta` object passed in the query's options, if any. + +##### Returns + +`Record`\<`string`, `unknown`\> \| `undefined` + +*** + +### promise + +#### Get Signature + +```ts +get promise(): Promise | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L277) + +The promise for the currently in-flight fetch, if the query is fetching. +`undefined` when the query is not fetching. + +##### Returns + +`Promise`\<`TData`\> \| `undefined` + +## Methods + +### cancel() + +```ts +cancel(options?): Promise; +``` + +Defined in: [packages/query-core/src/query.ts:348](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L348) + +Cancels the query's currently in-flight fetch, if any. +- Returns a promise that resolves once the cancellation has settled. +- If no fetch is in progress, resolves immediately. + +#### Parameters + +##### options? + +[`CancelOptions`](../interfaces/CancelOptions.md) + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await query.cancel() +``` + +*** + +### clearGcTimeout() + +```ts +protected clearGcTimeout(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L32) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.clearGcTimeout +``` + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/query.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L361) + +Clears the query's garbage collection timeout and silently cancels any +in-flight fetch. Called by `QueryCache` when the query is removed from +the cache. + +#### Returns + +`void` + +#### See + +[Query#cancel](#cancel) + +#### Overrides + +```ts +Removable.destroy +``` + +*** + +### fetch() + +```ts +fetch(options?, fetchOptions?): Promise; +``` + +Defined in: [packages/query-core/src/query.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L590) + +Fetches the query, i.e. runs its `queryFn` (through any configured +retryer/behavior) and updates the query's state with the result. +- If a fetch is already in flight, returns its promise instead of + starting a new one, unless `fetchOptions.cancelRefetch` is set and the + query already has data, in which case the current fetch is silently + cancelled first. +- If `options` is passed, it replaces the query's current options + before fetching. + +#### Parameters + +##### options? + +[`QueryOptions`](../interfaces/QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\> + +##### fetchOptions? + +`FetchOptions`\<`TQueryFnData`\> + +#### Returns + +`Promise`\<`TData`\> + +*** + +### getObserversCount() + +```ts +getObserversCount(): number; +``` + +Defined in: [packages/query-core/src/query.ts:560](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L560) + +Returns the number of observers currently subscribed to this query. + +#### Returns + +`number` + +#### Example + +```ts +if (query.getObserversCount() === 0) { + // no component is currently watching this query +} +``` + +*** + +### invalidate() + +```ts +invalidate(): void; +``` + +Defined in: [packages/query-core/src/query.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L574) + +Marks the query as invalidated, unless it is already invalidated. This +updates `state.isInvalidated` and notifies observers, but does not by +itself trigger a refetch. + +#### Returns + +`void` + +#### Example + +```ts +query.invalidate() +``` + +*** + +### isActive() + +```ts +isActive(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:386](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L386) + +Returns `true` if the query has at least one observer for which `enabled` +does not resolve to `false`. + +#### Returns + +`boolean` + +*** + +### isDisabled() + +```ts +isDisabled(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:400](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L400) + +Returns `true` if the query is disabled, meaning it will not fetch +automatically. +- If the query has observers, it is disabled when none of them are active + (see `isActive`). +- If the query has no observers, it is disabled when its `queryFn` is + `skipToken` or it has never been fetched. + +#### Returns + +`boolean` + +*** + +### isFetched() + +```ts +isFetched(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:412](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L412) + +Returns `true` if the query has been fetched, i.e. it has resolved with +either data or an error at least once. + +#### Returns + +`boolean` + +*** + +### isStale() + +```ts +isStale(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:447](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L447) + +Returns `true` if the query is stale. +- If the query has observers, defers to whether any observer's current + result reports `isStale` (which accounts for each observer's own + `staleTime` and `enabled` state). +- If the query has no observers, it is considered stale when it has no + data or has been invalidated. + +#### Returns + +`boolean` + +#### See + +[Query#isStaleByTime](#isstalebytime) + +#### Example + +```ts +if (query.isStale()) { + // refetch or otherwise treat the cached data as outdated +} +``` + +*** + +### isStaleByTime() + +```ts +isStaleByTime(staleTime): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:473](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L473) + +Returns `true` if the query's data is stale relative to the given +`staleTime` (defaults to `0`). +- A query with no data is always stale. +- `staleTime: 'static'` is never stale. +- An invalidated query is always stale. +- Otherwise, staleness is based on elapsed time since `dataUpdatedAt`. + +#### Parameters + +##### staleTime + +[`StaleTime`](../type-aliases/StaleTime.md) = `0` + +#### Returns + +`boolean` + +#### See + +[Query#isStale](#isstale) + +#### Example + +```ts +const isStale = query.isStaleByTime(1000 * 60) +``` + +*** + +### isStatic() + +```ts +isStatic(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:420](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L420) + +Returns `true` if the query has at least one observer configured with +`staleTime: 'static'`, meaning it is treated as never stale. + +#### Returns + +`boolean` + +*** + +### optionalRemove() + +```ts +protected optionalRemove(): void; +``` + +Defined in: [packages/query-core/src/query.ts:305](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L305) + +#### Returns + +`void` + +#### Overrides + +```ts +Removable.optionalRemove +``` + +*** + +### reset() + +```ts +reset(): void; +``` + +Defined in: [packages/query-core/src/query.ts:377](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L377) + +Resets the query back to its initial state (the state it had when it was +first created, e.g. any `initialData`), destroying it first to cancel any +in-flight fetch. + +#### Returns + +`void` + +*** + +### scheduleGc() + +```ts +protected scheduleGc(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L14) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.scheduleGc +``` + +*** + +### setState() + +```ts +setState(state): void; +``` + +Defined in: [packages/query-core/src/query.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L334) + +Merges the given partial state directly into this query's state, notifying observers. Used +by persistence and broadcast plugins to restore a state snapshot, and by devtools to let a +user manually trigger a loading/error state or edit the cached data. + +#### Parameters + +##### state + +`Partial`\<[`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\>\> + +#### Returns + +`void` + +*** + +### updateGcTime() + +```ts +protected updateGcTime(newGcTime): void; +``` + +Defined in: [packages/query-core/src/removable.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L24) + +#### Parameters + +##### newGcTime + +`number` | `undefined` + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.updateGcTime +``` diff --git a/docs/framework/svelte/reference/classes/QueryCache.md b/docs/framework/svelte/reference/classes/QueryCache.md new file mode 100644 index 00000000000..8e435445b2c --- /dev/null +++ b/docs/framework/svelte/reference/classes/QueryCache.md @@ -0,0 +1,461 @@ +--- +id: QueryCache +title: QueryCache +--- + +Defined in: [packages/query-core/src/queryCache.ts:113](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L113) + +The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta +information, and state of the queries it contains. + +Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient` +for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of +safe/known updates to the cache, such as queries being added, removed, or updated. + +## Extends + +- `Subscribable`\<`QueryCacheListener`\> + +## Constructors + +### Constructor + +```ts +new QueryCache(config): QueryCache; +``` + +Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) + +#### Parameters + +##### config + +[`QueryCacheConfig`](../interfaces/QueryCacheConfig.md) = `{}` + +#### Returns + +`QueryCache` + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### config + +```ts +config: QueryCacheConfig = {}; +``` + +Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) + +*** + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### build() + +```ts +build( + client, + options, +state?): Query; +``` + +Defined in: [packages/query-core/src/queryCache.ts:137](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L137) + +Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or +builds and adds a new one to the cache if none exists yet. Used by framework adapters and +plugins (e.g. broadcast/persistence) that need to get-or-create a `Query` directly, bypassing +the reactive `QueryObserver` machinery. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](../interfaces/QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\>, `"queryKey"`\> + +##### state? + +[`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\> + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const query = queryCache.build(queryClient, { + queryKey: ['posts'], + queryFn: fetchPosts, +}) +``` + +*** + +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:222](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L222) + +Removes all queries from the cache. + +#### Returns + +`void` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +queryCache.clear() +``` + +*** + +### find() + +```ts +find(filters): + | Query + | undefined; +``` + +Defined in: [packages/query-core/src/queryCache.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L289) + +A slightly more advanced method that can be used to get an existing query instance from the +cache. This instance not only contains all the state for the query, but all of the instances, +and underlying guts of the query as well. If the query does not exist, `undefined` is +returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about a query in rare scenarios (e.g. looking at `query.state.dataUpdatedAt` to +decide whether a query is fresh enough to be used as an initial value). + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +#### Parameters + +##### filters + +[`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryFilters`](../interfaces/QueryFilters.md)\, `"queryKey"`\> + +#### Returns + + \| [`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, readonly `unknown`[]\> + \| `undefined` + +#### See + +[QueryCache#findAll](#findall) + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const query = queryCache.find({ queryKey: ['posts'] }) +``` + +*** + +### findAll() + +```ts +findAll(filters): Query[]; +``` + +Defined in: [packages/query-core/src/queryCache.ts:314](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L314) + +An even more advanced method that can be used to get existing query instances from the cache +that partially match a query key. If no queries match, an empty array is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about queries in rare scenarios. + +#### Parameters + +##### filters + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = `{}` + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +#### See + +[QueryCache#find](#find) + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const queries = queryCache.findAll({ queryKey: ['posts'] }) +``` + +*** + +### get() + +```ts +get(queryHash): + | Query + | undefined; +``` + +Defined in: [packages/query-core/src/queryCache.ts:244](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L244) + +Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none +exists. Unlike [QueryCache#find](#find), this looks up by the already-computed hash rather +than by `QueryFilters`. Used by plugins (e.g. broadcast/hydration) that already have a hash +to look up directly. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### queryHash + +`string` + +#### Returns + + \| [`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + \| `undefined` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() +const queryHash = hashKey(['posts']) + +const query = queryCache.get(queryHash) +``` + +*** + +### getAll() + +```ts +getAll(): Query[]; +``` + +Defined in: [packages/query-core/src/queryCache.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L267) + +Returns all queries within the cache. + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const queries = queryCache.getAll() +``` + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L23) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L27) + +#### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### remove() + +```ts +remove(query): void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:198](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L198) + +Destroys the given `Query` and removes it from the cache, notifying subscribers with a +`'removed'` event. A no-op if the query is no longer the one currently stored under its hash +(e.g. it was already replaced). Used by plugins (e.g. the broadcast client) that mirror +removals across `QueryCache` instances. + +#### Parameters + +##### query + +[`Query`](Query.md)\<`any`, `any`, `any`, `any`\> + +#### Returns + +`void` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() +const query = queryCache.find({ queryKey: ['posts'] }) + +if (query) { + queryCache.remove(query) +} +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueryCacheListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/svelte/reference/classes/QueryClient.md b/docs/framework/svelte/reference/classes/QueryClient.md new file mode 100644 index 00000000000..03250c00243 --- /dev/null +++ b/docs/framework/svelte/reference/classes/QueryClient.md @@ -0,0 +1,1455 @@ +--- +id: QueryClient +title: QueryClient +--- + +Defined in: [packages/query-core/src/queryClient.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L78) + +`QueryClient` is used to interact with a cache of queries and mutations. It owns a +`QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds +the default options that are applied to queries and mutations created through it. + +```ts +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + staleTime: Infinity, + }, + }, +}) + +await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts }) +``` + +## Constructors + +### Constructor + +```ts +new QueryClient(config): QueryClient; +``` + +Defined in: [packages/query-core/src/queryClient.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L88) + +#### Parameters + +##### config + +[`QueryClientConfig`](../interfaces/QueryClientConfig.md) = `{}` + +#### Returns + +`QueryClient` + +## Methods + +### cancelQueries() + +```ts +cancelQueries(filters?, cancelOptions?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L425) + +Cancels outgoing fetches for queries matching the given filters. Most useful when performing +optimistic updates, since any outgoing refetch that resolves afterwards would otherwise +overwrite the optimistic update. By default (`revert: true`), a cancelled query's data is +reverted to its state before the outgoing fetch started. + +The returned promise never rejects, even if individual cancellations fail. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +##### cancelOptions? + +[`CancelOptions`](../interfaces/CancelOptions.md) = `{}` + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.cancelQueries({ queryKey: ['posts'], exact: true }) +``` + +*** + +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1073) + +Clears both the query cache and the mutation cache this client is connected to. + +#### Returns + +`void` + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +queryClient.clear() +``` + +*** + +### defaultMutationOptions() + +```ts +defaultMutationOptions(options?): T; +``` + +Defined in: [packages/query-core/src/queryClient.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1047) + +The mutation counterpart of [QueryClient#defaultQueryOptions](#defaultqueryoptions). Called by framework +adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the +given `mutationKey`, then the client's `defaultOptions.mutations`, then the caller's options +on top. A no-op if the options are already defaulted (`_defaulted: true`). + +#### Type Parameters + +##### T + +`T` *extends* [`MutationOptions`](../interfaces/MutationOptions.md)\<`any`, `any`, `any`, `any`\> + +#### Parameters + +##### options? + +`T` + +#### Returns + +`T` + +*** + +### defaultQueryOptions() + +```ts +defaultQueryOptions(options): DefaultedQueryObserverOptions; +``` + +Defined in: [packages/query-core/src/queryClient.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L960) + +Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the +caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the +given `queryKey`, then the client's own `defaultOptions.queries`, then the caller's options +on top. A no-op if the options are already defaulted (`_defaulted: true`). + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\> | [`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +*** + +### ~~ensureInfiniteQueryData()~~ + +```ts +ensureInfiniteQueryData(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryClient.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L725) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`EnsureInfiniteQueryDataOptions`](../type-aliases/EnsureInfiniteQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\> + +#### Deprecated + +Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version. + +*** + +### ~~ensureQueryData()~~ + +```ts +ensureQueryData(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L196) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### options + +[`EnsureQueryDataOptions`](../interfaces/EnsureQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Deprecated + +Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version. + +*** + +### ~~fetchInfiniteQuery()~~ + +```ts +fetchInfiniteQuery(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryClient.ts:682](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L682) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\> + +#### Deprecated + +Use queryClient.infiniteQuery(options) instead. This method will be removed in the next major version. + +*** + +### ~~fetchQuery()~~ + +```ts +fetchQuery(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L590) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Deprecated + +Use queryClient.query(options) instead. This method will be removed in the next major version. + +*** + +### getDefaultOptions() + +```ts +getDefaultOptions(): DefaultOptions; +``` + +Defined in: [packages/query-core/src/queryClient.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L808) + +Returns the default options that were set when creating the client, or via +[QueryClient#setDefaultOptions](#setdefaultoptions). + +#### Returns + +[`DefaultOptions`](../interfaces/DefaultOptions.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const defaultOptions = queryClient.getDefaultOptions() +``` + +*** + +### getMutationCache() + +```ts +getMutationCache(): MutationCache; +``` + +Defined in: [packages/query-core/src/queryClient.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L792) + +Returns the mutation cache this client is connected to. + +#### Returns + +[`MutationCache`](MutationCache.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const mutationCache = queryClient.getMutationCache() +const mutations = mutationCache.findAll({ status: 'pending' }) +``` + +*** + +### getMutationDefaults() + +```ts +getMutationDefaults(mutationKey): OmitKeyof, "mutationKey">; +``` + +Defined in: [packages/query-core/src/queryClient.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L935) + +Returns the default options registered for mutations whose mutation key partially matches +the given `mutationKey`, via [QueryClient#setMutationDefaults](#setmutationdefaults). If multiple registered +defaults match, they are merged together in registration order. + +#### Parameters + +##### mutationKey + +readonly `unknown`[] + +#### Returns + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`any`, `any`, `any`, `any`\>, `"mutationKey"`\> + +#### Example + +```ts +const defaultOptions = queryClient.getMutationDefaults(['addPost']) +``` + +*** + +### getQueriesData() + +```ts +getQueriesData(filters): [readonly unknown[], TQueryFnData | undefined][]; +``` + +Defined in: [packages/query-core/src/queryClient.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L233) + +Imperative (non-reactive) way to retrieve the cached data of multiple queries at once. +Only queries matching the given filters are returned; if none match, an empty array is +returned. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters + +`TQueryFilters` + +#### Returns + +\[readonly `unknown`[], `TQueryFnData` \| `undefined`\][] + +#### See + +[QueryClient#getQueryData](#getquerydata) + +#### Example + +```ts +const data = queryClient.getQueriesData({ queryKey: ['posts'] }) +``` + +*** + +### getQueryCache() + +```ts +getQueryCache(): QueryCache; +``` + +Defined in: [packages/query-core/src/queryClient.ts:776](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L776) + +Returns the query cache this client is connected to. + +#### Returns + +[`QueryCache`](QueryCache.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const queryCache = queryClient.getQueryCache() +const queries = queryCache.findAll({ queryKey: ['posts'] }) +``` + +*** + +### getQueryData() + +```ts +getQueryData(queryKey): TInferredQueryFnData | undefined; +``` + +Defined in: [packages/query-core/src/queryClient.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L182) + +Imperative (non-reactive) way to retrieve data for a QueryKey. +Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. + +Hint: Do not use this function inside a component, because it won't receive updates. +Use `useQuery` to create a `QueryObserver` that subscribes to changes. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +#### Returns + +`TInferredQueryFnData` \| `undefined` + +#### See + +[QueryClient#getQueriesData](#getqueriesdata) + +*** + +### getQueryDefaults() + +```ts +getQueryDefaults(queryKey): OmitKeyof, "queryKey">; +``` + +Defined in: [packages/query-core/src/queryClient.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L878) + +Returns the default options registered for queries whose query key partially matches the +given `queryKey`, via [QueryClient#setQueryDefaults](#setquerydefaults). If multiple registered defaults +match, they are merged together in registration order. + +#### Parameters + +##### queryKey + +readonly `unknown`[] + +#### Returns + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`any`, `any`, `any`, `any`, `any`\>, `"queryKey"`\> + +#### Example + +```ts +const defaultOptions = queryClient.getQueryDefaults(['posts']) +``` + +*** + +### getQueryState() + +```ts +getQueryState(queryKey): + | QueryState + | undefined; +``` + +Defined in: [packages/query-core/src/queryClient.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L343) + +Imperative (non-reactive) way to retrieve an existing query's state. If the query does not +exist, `undefined` is returned. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +##### TInferredError + +`TInferredError` = [`InferErrorFromTag`](../type-aliases/InferErrorFromTag.md)\<`TError`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +#### Returns + + \| [`QueryState`](../interfaces/QueryState.md)\<`TInferredQueryFnData`, `TInferredError`\> + \| `undefined` + +#### Example + +```ts +const state = queryClient.getQueryState(['posts']) +console.log(state?.dataUpdatedAt) +``` + +*** + +### infiniteQuery() + +```ts +infiniteQuery(options): Promise[] ? InfiniteData : TData>; +``` + +Defined in: [packages/query-core/src/queryClient.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L656) + +Asynchronous method to fetch and cache an infinite query, resolving with an +[InfiniteData](../interfaces/InfiniteData.md) object or throwing with the error. + +Behaves like [QueryClient#query](#query), accepting the same options (minus +`initialPageParam`), plus the required `initialPageParam`, and an optional `pages` / +`getNextPageParam` pair used to refetch a fixed number of pages from the start. + +This method replaces the deprecated `fetchInfiniteQuery`, and — combined with +`{ staleTime: 'static' }` — the deprecated `ensureInfiniteQueryData`. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`InfiniteQueryExecuteOptions`](../type-aliases/InfiniteQueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`[] *extends* [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>[] ? [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\> : `TData`\> + +#### Example + +```ts +try { + const data = await queryClient.infiniteQuery({ queryKey, queryFn, initialPageParam: 0 }) + console.log(data.pages) +} catch (error) { + console.log(error) +} +``` + +*** + +### invalidateQueries() + +```ts +invalidateQueries(filters?, options?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:453](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L453) + +Marks queries matching the given filters as invalidated. Unlike +[QueryClient#removeQueries](#removequeries), invalidated queries stay in the cache. + +Unless `filters.refetchType` is `'none'`, matching queries are then refetched via +[QueryClient#refetchQueries](#refetchqueries), using `filters.refetchType` if set, otherwise +`filters.type`, otherwise `'active'`. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`InvalidateQueryFilters`](../interfaces/InvalidateQueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`InvalidateOptions`](../interfaces/InvalidateOptions.md) = `{}` + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' }) +``` + +*** + +### isFetching() + +```ts +isFetching(filters?): number; +``` + +Defined in: [packages/query-core/src/queryClient.ts:149](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L149) + +Returns the number of queries in the cache that are currently fetching, optionally +matching a set of filters. This includes background-fetching, loading new pages, and +loading more infinite query results. + +#### Type Parameters + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters? + +`TQueryFilters` + +#### Returns + +`number` + +#### Example + +```ts +if (queryClient.isFetching()) { + console.log('At least one query is fetching!') +} +``` + +*** + +### isMutating() + +```ts +isMutating(filters?): number; +``` + +Defined in: [packages/query-core/src/queryClient.ts:167](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L167) + +Returns the number of mutations in the cache that are currently pending, optionally +matching a set of filters. + +#### Type Parameters + +##### TMutationFilters + +`TMutationFilters` *extends* [`MutationFilters`](../interfaces/MutationFilters.md)\<`any`, `any`, `unknown`, `unknown`\> = [`MutationFilters`](../interfaces/MutationFilters.md)\<`unknown`, `Error`, `unknown`, `unknown`\> + +#### Parameters + +##### filters? + +`TMutationFilters` + +#### Returns + +`number` + +#### Example + +```ts +if (queryClient.isMutating()) { + console.log('At least one mutation is pending!') +} +``` + +*** + +### mount() + +```ts +mount(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L103) + +Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start +listening for focus/online events and resume paused mutations. Ref-counted via an internal +mount count, so nested or multiple providers sharing the same `QueryClient` don't tear down +the shared listeners until the last one unmounts. + +#### Returns + +`void` + +*** + +### ~~prefetchInfiniteQuery()~~ + +```ts +prefetchInfiniteQuery(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L704) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`void`\> + +#### Deprecated + +Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version. + +*** + +### ~~prefetchQuery()~~ + +```ts +prefetchQuery(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:624](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L624) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### options + +[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Promise`\<`void`\> + +#### Deprecated + +Use queryClient.query(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version. + +*** + +### query() + +```ts +query(options): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:544](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L544) + +Asynchronous method to fetch and cache a query, resolving with the data or throwing with +the error. + +If the query already exists in the cache and its data is not stale (per the given +`staleTime`), the cached data is returned without fetching. Otherwise, the query is fetched +and the promise resolves once the fetch settles. If a `select` function is provided, it is +applied to the data in both cases (cached or freshly fetched) before it is returned. + +Unlike `useQuery`, retries are disabled by default here (`retry: false`) unless explicitly +configured, since there is no component to catch a thrown error and retry through re-render. + +The accepted options are a subset of `useQuery`'s options: fields that only make sense for a +reactive observer (e.g. `enabled`, `refetchInterval`, `refetchOnWindowFocus`, `notifyOnChangeProps`, +`throwOnError`, `suspense`, `placeholderData`) are not part of this method's options. + +This method replaces the deprecated `fetchQuery`, and — combined with +`{ staleTime: 'static' }` — the deprecated `ensureQueryData`. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`QueryExecuteOptions`](../interfaces/QueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +try { + const data = await queryClient.query({ queryKey, queryFn, staleTime: 10000 }) +} catch (error) { + console.log(error) +} +``` + +*** + +### refetchQueries() + +```ts +refetchQueries(filters?, options?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:490](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L490) + +Refetches queries matching the given filters, regardless of whether they are stale. Without +filters, every query in the cache is refetched. Queries that are disabled, or static (only +have observers with a static `staleTime`), are never refetched. + +By default (`cancelRefetch: true`), a currently running fetch is cancelled before the new +one starts. The returned promise resolves once all matching queries have settled; it does +not reject on individual query failures unless `throwOnError` is set. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`RefetchQueryFilters`](../interfaces/RefetchQueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +// refetch all active queries partially matching a query key: +await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' }) +``` + +*** + +### removeQueries() + +```ts +removeQueries(filters?): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:369](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L369) + +Removes queries from the cache that match the given filters. Unlike +[QueryClient#invalidateQueries](#invalidatequeries) or [QueryClient#refetchQueries](#refetchqueries), this removes +matching queries from the cache instead of refetching them. Without filters, every query in +the cache is removed. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +#### Returns + +`void` + +#### Example + +```ts +queryClient.removeQueries({ queryKey: ['posts'], exact: true }) +``` + +*** + +### resetQueries() + +```ts +resetQueries(filters?, options?): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L390) + +Resets queries matching the given filters back to their initial state (e.g. any +`initialData`), notifying subscribers rather than removing them. Active queries among the +matched set are then refetched, and the returned promise resolves once that refetch settles. + +#### Type Parameters + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### filters? + +[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\> + +##### options? + +[`ResetOptions`](../interfaces/ResetOptions.md) + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await queryClient.resetQueries({ queryKey: ['posts'], exact: true }) +``` + +*** + +### resumePausedMutations() + +```ts +resumePausedMutations(): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:757](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L757) + +Resumes mutations that were paused because there was no network connection. Does nothing +(resolving immediately) if the client is currently offline. + +#### Returns + +`Promise`\<`unknown`\> + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +await queryClient.resumePausedMutations() +``` + +*** + +### setDefaultOptions() + +```ts +setDefaultOptions(options): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L829) + +Dynamically sets the default options for this client, overwriting any previously defined +default options. + +#### Parameters + +##### options + +[`DefaultOptions`](../interfaces/DefaultOptions.md) + +#### Returns + +`void` + +#### See + +[QueryClient#getDefaultOptions](#getdefaultoptions) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +queryClient.setDefaultOptions({ + queries: { + staleTime: Infinity, + }, +}) +``` + +*** + +### setMutationDefaults() + +```ts +setMutationDefaults(mutationKey, options): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L907) + +Sets default options for mutations whose mutation key partially matches the given +`mutationKey`. As with [QueryClient#setQueryDefaults](#setquerydefaults), the order of registration +matters when several registered defaults match the same mutation key. + +#### Type Parameters + +##### TData + +`TData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TVariables + +`TVariables` = `void` + +##### TOnMutateResult + +`TOnMutateResult` = `unknown` + +#### Parameters + +##### mutationKey + +readonly `unknown`[] + +##### options + +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> + +#### Returns + +`void` + +#### See + +[QueryClient#getMutationDefaults](#getmutationdefaults) + +#### Example + +```ts +queryClient.setMutationDefaults(['addPost'], { mutationFn: addPost }) +``` + +*** + +### setQueriesData() + +```ts +setQueriesData( + filters, + updater, + options?): [readonly unknown[], TQueryFnData | undefined][]; +``` + +Defined in: [packages/query-core/src/queryClient.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L312) + +Synchronous way to immediately update the cached data of multiple queries at once, using +filters or partial query key matching. Only queries that already exist and match the given +filters are updated; no new cache entries are created. Internally this calls +[QueryClient#setQueryData](#setquerydata) for each matching query. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TQueryFilters + +`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\ + +#### Parameters + +##### filters + +`TQueryFilters` + +##### updater + +[`Updater`](../type-aliases/Updater.md)\<`NoInfer`\<`TQueryFnData`\> \| `undefined`, `NoInfer`\<`TQueryFnData`\> \| `undefined`\> + +##### options? + +[`SetDataOptions`](../interfaces/SetDataOptions.md) + +#### Returns + +\[readonly `unknown`[], `TQueryFnData` \| `undefined`\][] + +#### Example + +```ts +queryClient.setQueriesData({ queryKey: ['posts'] }, (oldPosts) => + oldPosts ? oldPosts.filter((post) => post.id !== deletedId) : oldPosts, +) +``` + +*** + +### setQueryData() + +```ts +setQueryData( + queryKey, + updater, + options?): NoInfer | undefined; +``` + +Defined in: [packages/query-core/src/queryClient.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L264) + +Synchronous way to immediately update a query's cached data. If the updater (or the value +passed) resolves to `undefined`, the cache is left untouched and no query is created; +otherwise, if the query does not exist yet, it will be created. To update multiple queries +at once by partially matching query keys, use [QueryClient#setQueriesData](#setqueriesdata) instead. + +Updates must be performed immutably: do not mutate `oldData`, or data previously retrieved +via [QueryClient#getQueryData](#getquerydata), in place. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TTaggedQueryKey + +`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TInferredQueryFnData + +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> + +#### Parameters + +##### queryKey + +`TTaggedQueryKey` + +The query key to set data for. + +##### updater + +[`Updater`](../type-aliases/Updater.md)\<`NoInfer`\<`TInferredQueryFnData`\> \| `undefined`, `NoInfer`\<`TInferredQueryFnData`\> \| `undefined`\> + +Either the new data, or a function that receives the current data (which +may be `undefined`) and returns the new data. + +##### options? + +[`SetDataOptions`](../interfaces/SetDataOptions.md) + +#### Returns + +`NoInfer`\<`TInferredQueryFnData`\> \| `undefined` + +#### Example + +```ts +queryClient.setQueryData(['posts'], newPosts) + +// Or, using an updater function that receives the current data: +queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost]) +``` + +*** + +### setQueryDefaults() + +```ts +setQueryDefaults(queryKey, options): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L848) + +Sets default options for queries whose query key partially matches the given `queryKey`. + +If several registered query defaults match a given query key, they are merged together in +registration order by [QueryClient#getQueryDefaults](#getquerydefaults), so register defaults from the +most generic key to the least generic one — more specific defaults should be registered +after more generic ones so they take precedence. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +#### Parameters + +##### queryKey + +readonly `unknown`[] + +##### options + +`Partial`\<[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`\>, `"queryKey"`\>\> + +#### Returns + +`void` + +#### Example + +```ts +queryClient.setQueryDefaults(['posts'], { queryFn: fetchPosts }) + +await queryClient.query({ queryKey: ['posts'] }) +``` + +*** + +### unmount() + +```ts +unmount(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L126) + +The inverse of [QueryClient#mount](#mount) — called by a framework adapter's +`QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online +listeners once the mount count returns to `0`. + +#### Returns + +`void` diff --git a/docs/framework/svelte/reference/classes/QueryObserver.md b/docs/framework/svelte/reference/classes/QueryObserver.md new file mode 100644 index 00000000000..51ff16910df --- /dev/null +++ b/docs/framework/svelte/reference/classes/QueryObserver.md @@ -0,0 +1,555 @@ +--- +id: QueryObserver +title: QueryObserver +--- + +Defined in: [packages/query-core/src/queryObserver.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L57) + +A `QueryObserver` watches a single query in the `QueryCache` and computes a +`QueryObserverResult` from its state, recomputing and notifying subscribers +whenever the underlying query (or the observer's options) changes. It is +the primitive that framework adapters (e.g. `useQuery`) build their hooks +on top of, but it can also be used directly to observe and switch between +queries outside of any framework. + +## Example + +```ts +const observer = new QueryObserver(queryClient, { + queryKey: ['posts'], + queryFn: fetchPosts, +}) + +const unsubscribe = observer.subscribe((result) => { + console.log(result.data) +}) +``` + +## Extends + +- `Subscribable`\<`QueryObserverListener`\<`TData`, `TError`\>\> + +## Extended by + +- [`InfiniteQueryObserver`](InfiniteQueryObserver.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Constructors + +### Constructor + +```ts +new QueryObserver(client, options): QueryObserver; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L87) + +#### Parameters + +##### client + +[`QueryClient`](QueryClient.md) + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`QueryObserver`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Overrides + +```ts +Subscribable>.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +*** + +### options + +```ts +options: QueryObserverOptions; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L89) + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L106) + +#### Returns + +`void` + +*** + +### createResult() + +```ts +protected createResult(query, options): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:559](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L559) + +#### Parameters + +##### query + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L161) + +Stops observing the current query: clears all listeners, cancels the +stale and refetch-interval timers, and removes this observer from the +query it was observing. + +#### Returns + +`void` + +*** + +### fetch() + +```ts +protected fetch(fetchOptions): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L448) + +#### Parameters + +##### fetchOptions + +`ObserverFetchOptions` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchOptimistic() + +```ts +fetchOptimistic(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:395](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L395) + +Fetches a query defined by the given options without affecting this +observer's own tracked query or result, and returns a promise that +resolves with the `QueryObserverResult` for that fetch. This is useful +for prefetching data that another observer (e.g. a query about to be +navigated to) will need, ahead of time. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.fetchOptimistic({ + queryKey: ['posts', 2], + queryFn: () => fetchPost(2), +}) +console.log(result.data) +``` + +*** + +### getCurrentQuery() + +```ts +getCurrentQuery(): Query; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:357](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L357) + +Returns the `Query` instance this observer is currently observing. + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L321) + +Returns the most recently computed `QueryObserverResult` for the +observed query. This is a point-in-time read; to be notified of updates +as they happen, subscribe to the observer instead (its inherited +`subscribe` method). + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +#### Example + +```ts +const result = observer.getCurrentResult() +console.log(result.status, result.data) +``` + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(options): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L272) + +Computes the result the observer would produce for the given (already-defaulted) options +right now, building the underlying `Query` if it doesn't exist yet, without waiting for a +subscription callback. Called by framework adapters on every render (e.g. `useQuery`) so the +returned value is available synchronously, ahead of `setOptions` triggering an actual fetch. + +#### Parameters + +##### options + +[`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L110) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L124) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### refetch() + +```ts +refetch(__namedParameters): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L371) + +Refetches the observed query and returns a promise that resolves with +the resulting `QueryObserverResult`. + +#### Parameters + +##### \_\_namedParameters + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.refetch({ cancelRefetch: false }) +console.log(result.data) +``` + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L182) + +Updates the observer's options. This will re-resolve the query being +observed (switching to a different query if the `queryKey` changed), +trigger a fetch if the new options require one and the observer has +subscribers, recompute the current result, and reschedule the stale and +refetch-interval timers as needed. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setOptions({ queryKey: ['posts', 1], queryFn: () => fetchPost(1) }) +// later: switch to a different query, reusing the same observer +observer.setOptions({ queryKey: ['posts', 2], queryFn: () => fetchPost(2) }) +``` + +*** + +### shouldFetchOnReconnect() + +```ts +shouldFetchOnReconnect(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L135) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnReconnect` option) to refetch when the network +reconnects. + +#### Returns + +`boolean` + +*** + +### shouldFetchOnWindowFocus() + +```ts +shouldFetchOnWindowFocus(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L148) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnWindowFocus` option) to refetch when the window +regains focus. + +#### Returns + +`boolean` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueryObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` + +*** + +### trackProp() + +```ts +trackProp(key): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:350](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L350) + +Records that the given `QueryObserverResult` property was read, so a subsequent update only +notifies this observer if a tracked property actually changed. Normally called indirectly via +[QueryObserver#trackResult](#trackresult)'s proxy; exposed directly for adapters that track property +access themselves (e.g. through their own reactivity system) instead of via the proxy. + +#### Parameters + +##### key + +`"error"` | `"data"` | `"isError"` | `"isPending"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isSuccess"` | `"isPlaceholderData"` | `"status"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` + +#### Returns + +`void` + +*** + +### trackResult() + +```ts +trackResult(result, onPropTracked?): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:331](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L331) + +Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via +[QueryObserver#trackProp](#trackprop) (and an optional `onPropTracked` callback). Used by framework +adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on +properties you actually read" behavior. + +#### Parameters + +##### result + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +##### onPropTracked? + +(`key`) => `void` + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### updateResult() + +```ts +updateResult(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L735) + +Recomputes and stores the current result from the current query/options, notifying listeners +if it changed. Framework adapters call this right after subscribing to make sure no query +update was missed in the gap between creating the observer and subscribing to it. + +#### Returns + +`void` diff --git a/docs/framework/svelte/reference/functions/createInfiniteQuery.md b/docs/framework/svelte/reference/functions/createInfiniteQuery.md index a3d7e3ec5f4..dd7a56c4582 100644 --- a/docs/framework/svelte/reference/functions/createInfiniteQuery.md +++ b/docs/framework/svelte/reference/functions/createInfiniteQuery.md @@ -23,7 +23,7 @@ Defined in: [packages/svelte-query/src/createInfiniteQuery.ts:21](https://github #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -41,7 +41,7 @@ Defined in: [packages/svelte-query/src/createInfiniteQuery.ts:21](https://github #### queryClient? -[`Accessor`](../type-aliases/Accessor.md)\<`QueryClient`\> +[`Accessor`](../type-aliases/Accessor.md)\<[`QueryClient`](../classes/QueryClient.md)\> ### Returns @@ -67,7 +67,7 @@ Defined in: [packages/svelte-query/src/createInfiniteQuery.ts:40](https://github #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -85,7 +85,7 @@ Defined in: [packages/svelte-query/src/createInfiniteQuery.ts:40](https://github #### queryClient? -[`Accessor`](../type-aliases/Accessor.md)\<`QueryClient`\> +[`Accessor`](../type-aliases/Accessor.md)\<[`QueryClient`](../classes/QueryClient.md)\> ### Returns @@ -111,7 +111,7 @@ Defined in: [packages/svelte-query/src/createInfiniteQuery.ts:152](https://githu #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -132,7 +132,7 @@ The [CreateInfiniteQueryOptions](../type-aliases/CreateInfiniteQueryOptions.md) #### queryClient? -[`Accessor`](../type-aliases/Accessor.md)\<`QueryClient`\> +[`Accessor`](../type-aliases/Accessor.md)\<[`QueryClient`](../classes/QueryClient.md)\> Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/svelte/reference/functions/createMutation.md b/docs/framework/svelte/reference/functions/createMutation.md index 84b812686f2..1c129fe5801 100644 --- a/docs/framework/svelte/reference/functions/createMutation.md +++ b/docs/framework/svelte/reference/functions/createMutation.md @@ -41,7 +41,7 @@ reactive. ### queryClient? -[`Accessor`](../type-aliases/Accessor.md)\<`QueryClient`\> +[`Accessor`](../type-aliases/Accessor.md)\<[`QueryClient`](../classes/QueryClient.md)\> Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/svelte/reference/functions/createQueries.md b/docs/framework/svelte/reference/functions/createQueries.md index 77b3275b75e..d7bae38b57b 100644 --- a/docs/framework/svelte/reference/functions/createQueries.md +++ b/docs/framework/svelte/reference/functions/createQueries.md @@ -34,7 +34,7 @@ The `queries` array to run, and an optional `combine` function, wrapped in an ### queryClient? -[`Accessor`](../type-aliases/Accessor.md)\<`QueryClient`\> +[`Accessor`](../type-aliases/Accessor.md)\<[`QueryClient`](../classes/QueryClient.md)\> Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/svelte/reference/functions/createQuery.md b/docs/framework/svelte/reference/functions/createQuery.md index 078e681de0b..043e07fa60d 100644 --- a/docs/framework/svelte/reference/functions/createQuery.md +++ b/docs/framework/svelte/reference/functions/createQuery.md @@ -40,7 +40,7 @@ wrapped in an [Accessor](../type-aliases/Accessor.md) so options can be reactive #### queryClient? -[`Accessor`](../type-aliases/Accessor.md)\<`QueryClient`\> +[`Accessor`](../type-aliases/Accessor.md)\<[`QueryClient`](../classes/QueryClient.md)\> Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. @@ -145,7 +145,7 @@ with `initialData` set, wrapped in an [Accessor](../type-aliases/Accessor.md) so #### queryClient? -[`Accessor`](../type-aliases/Accessor.md)\<`QueryClient`\> +[`Accessor`](../type-aliases/Accessor.md)\<[`QueryClient`](../classes/QueryClient.md)\> Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. @@ -224,7 +224,7 @@ in an [Accessor](../type-aliases/Accessor.md) so options can be reactive. #### queryClient? -[`Accessor`](../type-aliases/Accessor.md)\<`QueryClient`\> +[`Accessor`](../type-aliases/Accessor.md)\<[`QueryClient`](../classes/QueryClient.md)\> Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/svelte/reference/functions/defaultShouldDehydrateMutation.md b/docs/framework/svelte/reference/functions/defaultShouldDehydrateMutation.md new file mode 100644 index 00000000000..095ccf36e7c --- /dev/null +++ b/docs/framework/svelte/reference/functions/defaultShouldDehydrateMutation.md @@ -0,0 +1,23 @@ +--- +id: defaultShouldDehydrateMutation +title: defaultShouldDehydrateMutation +--- + +```ts +function defaultShouldDehydrateMutation(mutation): boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L180) + +The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are +currently paused (e.g. paused by `networkMode` while offline). + +## Parameters + +### mutation + +[`Mutation`](../classes/Mutation.md) + +## Returns + +`boolean` diff --git a/docs/framework/svelte/reference/functions/defaultShouldDehydrateQuery.md b/docs/framework/svelte/reference/functions/defaultShouldDehydrateQuery.md new file mode 100644 index 00000000000..06afc29d670 --- /dev/null +++ b/docs/framework/svelte/reference/functions/defaultShouldDehydrateQuery.md @@ -0,0 +1,23 @@ +--- +id: defaultShouldDehydrateQuery +title: defaultShouldDehydrateQuery +--- + +```ts +function defaultShouldDehydrateQuery(query): boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:188](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L188) + +The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is +`'success'`. + +## Parameters + +### query + +[`Query`](../classes/Query.md) + +## Returns + +`boolean` diff --git a/docs/framework/svelte/reference/functions/dehydrate.md b/docs/framework/svelte/reference/functions/dehydrate.md new file mode 100644 index 00000000000..b7334de7729 --- /dev/null +++ b/docs/framework/svelte/reference/functions/dehydrate.md @@ -0,0 +1,43 @@ +--- +id: dehydrate +title: dehydrate +--- + +```ts +function dehydrate(client, options): DehydratedState; +``` + +Defined in: [packages/query-core/src/hydration.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L210) + +Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`, +typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`. +Which queries/mutations are included, and how their data/errors are transformed, is controlled by `options`, +falling back to the client's `dehydrate` default options, and finally to `defaultShouldDehydrateQuery` / +`defaultShouldDehydrateMutation`. + +## Parameters + +### client + +[`QueryClient`](../classes/QueryClient.md) + +### options + +[`DehydrateOptions`](../interfaces/DehydrateOptions.md) = `{}` + +## Returns + +[`DehydratedState`](../interfaces/DehydratedState.md) + +## Example + +```ts +const queryClient = new QueryClient() + +await queryClient.prefetchQuery({ + queryKey: ['posts'], + queryFn: getPosts, +}) + +const dehydratedState = dehydrate(queryClient) +``` diff --git a/docs/framework/svelte/reference/functions/dehydrateQuery.md b/docs/framework/svelte/reference/functions/dehydrateQuery.md new file mode 100644 index 00000000000..2827d2ebb45 --- /dev/null +++ b/docs/framework/svelte/reference/functions/dehydrateQuery.md @@ -0,0 +1,43 @@ +--- +id: dehydrateQuery +title: dehydrateQuery +--- + +```ts +function dehydrateQuery( + query, + serializeData?, + shouldRedactErrors?): DehydratedQuery; +``` + +Defined in: [packages/query-core/src/hydration.ts:151](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L151) + +Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g. +`queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the +de/rehydrated data, typically with `useQuery` on the client. If the query is still `pending`, its in-flight +promise is dehydrated too so it can be resumed on the other side instead of re-fetched. + +## Parameters + +### query + +[`Query`](../classes/Query.md) + +The query to dehydrate. + +### serializeData? + +`TransformerFn` + +Optional transform applied to `query.state.data` before it is included in the snapshot. + +### shouldRedactErrors? + +(`error`) => `boolean` + +Optional predicate; if it returns `false` for the promise's rejection error, that +error is kept as-is instead of being redacted. + +## Returns + +`DehydratedQuery` diff --git a/docs/framework/svelte/reference/functions/experimental_streamedQuery.md b/docs/framework/svelte/reference/functions/experimental_streamedQuery.md new file mode 100644 index 00000000000..afd44df7c5f --- /dev/null +++ b/docs/framework/svelte/reference/functions/experimental_streamedQuery.md @@ -0,0 +1,52 @@ +--- +id: experimental_streamedQuery +title: experimental_streamedQuery +--- + +```ts +function experimental_streamedQuery(queryFn): QueryFunction; +``` + +Defined in: [packages/query-core/src/streamedQuery.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L60) + +This is a helper function to create a query function that streams data from an AsyncIterable. +Data will be an Array of all the chunks received. +The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. +The query will stay in fetchStatus 'fetching' until the stream ends. + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TData + +`TData` = `TQueryFnData`[] + +### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +## Parameters + +### queryFn + +`StreamedQueryParams`\<`TQueryFnData`, `TData`, `TQueryKey`\> + +The function that returns an AsyncIterable to stream data from. + +## Returns + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TData`, `TQueryKey`\> + +## Example + +```ts +await queryClient.query({ + queryKey: ['data'], + queryFn: streamedQuery({ + streamFn: fetchDataInChunks, + }), +}) +``` diff --git a/docs/framework/svelte/reference/functions/getQueryClientContext.md b/docs/framework/svelte/reference/functions/getQueryClientContext.md index 9c409d66165..096087f9c1e 100644 --- a/docs/framework/svelte/reference/functions/getQueryClientContext.md +++ b/docs/framework/svelte/reference/functions/getQueryClientContext.md @@ -14,7 +14,7 @@ Retrieves the `QueryClient` set on Svelte's context by `QueryClientProvider` (or ## Returns -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) The `QueryClient` set on context, whether by `QueryClientProvider` or [setQueryClientContext](setQueryClientContext.md). diff --git a/docs/framework/svelte/reference/functions/hashKey.md b/docs/framework/svelte/reference/functions/hashKey.md new file mode 100644 index 00000000000..9e7844aa09d --- /dev/null +++ b/docs/framework/svelte/reference/functions/hashKey.md @@ -0,0 +1,30 @@ +--- +id: hashKey +title: hashKey +--- + +```ts +function hashKey(queryKey): string; +``` + +Defined in: [packages/query-core/src/utils.ts:282](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L282) + +Default query & mutation keys hash function. +Hashes the value into a stable hash. + +## Parameters + +### queryKey + +readonly `unknown`[] + +## Returns + +`string` + +## Example + +```ts +// Object keys are sorted, so key order doesn't affect the hash: +hashKey(['todos', { page: 1, filter: 'done' }]) // === '["todos",{"filter":"done","page":1}]' +``` diff --git a/docs/framework/svelte/reference/functions/hydrate.md b/docs/framework/svelte/reference/functions/hydrate.md new file mode 100644 index 00000000000..dc55e38bf64 --- /dev/null +++ b/docs/framework/svelte/reference/functions/hydrate.md @@ -0,0 +1,49 @@ +--- +id: hydrate +title: hydrate +--- + +```ts +function hydrate( + client, + dehydratedState, + options?): void; +``` + +Defined in: [packages/query-core/src/hydration.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L267) + +Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the +client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`. +Queries not yet in the cache are built from the dehydrated snapshot; queries that already exist are only updated +when the dehydrated data is newer than what's already cached. Newly built queries have their `fetchStatus` reset +to `'idle'` so they don't hydrate stuck in a fetching state. If a dehydrated query still had an in-flight +promise, it is resumed via `query.fetch()` (reusing that promise as `initialPromise`) rather than re-invoking +`queryFn`. + +## Parameters + +### client + +[`QueryClient`](../classes/QueryClient.md) + +### dehydratedState + +`Partial`\<[`DehydratedState`](../interfaces/DehydratedState.md)\> + +### options? + +[`HydrateOptions`](../interfaces/HydrateOptions.md) + +## Returns + +`void` + +## Example + +```ts +// dehydratedState was produced by `dehydrate` on the server +// and sent to the client, e.g. embedded in server-rendered markup. +const queryClient = new QueryClient() + +hydrate(queryClient, dehydratedState) +``` diff --git a/docs/framework/svelte/reference/functions/infiniteQueryOptions.md b/docs/framework/svelte/reference/functions/infiniteQueryOptions.md index 528e063cee3..7f85b977af0 100644 --- a/docs/framework/svelte/reference/functions/infiniteQueryOptions.md +++ b/docs/framework/svelte/reference/functions/infiniteQueryOptions.md @@ -29,7 +29,7 @@ This overload is selected when `initialData` is set. #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -50,7 +50,7 @@ The [DefinedInitialDataInfiniteOptions](../type-aliases/DefinedInitialDataInfini ### Returns -[`CreateInfiniteQueryOptions`](../type-aliases/CreateInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `object` & `QueryKeyWithDataTag`\<`TQueryKey`, `InfiniteData`\<`TQueryFnData`, `unknown`\>, `TError`\> +[`CreateInfiniteQueryOptions`](../type-aliases/CreateInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `object` & [`QueryKeyWithDataTag`](../type-aliases/QueryKeyWithDataTag.md)\<`TQueryKey`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>, `TError`\> The same options object, typed so that `queryKey` carries the inferred data type. @@ -113,7 +113,7 @@ These options can be shared across `createInfiniteQuery` calls and imperative AP #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -134,7 +134,7 @@ The [UndefinedInitialDataInfiniteOptions](../type-aliases/UndefinedInitialDataIn ### Returns -[`CreateInfiniteQueryOptions`](../type-aliases/CreateInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `object` & `QueryKeyWithDataTag`\<`TQueryKey`, `InfiniteData`\<`TQueryFnData`, `unknown`\>, `TError`\> +[`CreateInfiniteQueryOptions`](../type-aliases/CreateInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `object` & [`QueryKeyWithDataTag`](../type-aliases/QueryKeyWithDataTag.md)\<`TQueryKey`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>, `TError`\> The same options object, typed so that `queryKey` carries the inferred data type. diff --git a/docs/framework/svelte/reference/functions/isCancelledError.md b/docs/framework/svelte/reference/functions/isCancelledError.md new file mode 100644 index 00000000000..c8f57c4b94d --- /dev/null +++ b/docs/framework/svelte/reference/functions/isCancelledError.md @@ -0,0 +1,24 @@ +--- +id: isCancelledError +title: isCancelledError +--- + +```ts +function isCancelledError(value): value is CancelledError; +``` + +Defined in: [packages/query-core/src/retryer.ts:90](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L90) + +## Parameters + +### value + +`any` + +## Returns + +`value is CancelledError` + +## Deprecated + +Use instanceof `CancelledError` instead. diff --git a/docs/framework/svelte/reference/functions/keepPreviousData.md b/docs/framework/svelte/reference/functions/keepPreviousData.md new file mode 100644 index 00000000000..d41c7d7c726 --- /dev/null +++ b/docs/framework/svelte/reference/functions/keepPreviousData.md @@ -0,0 +1,40 @@ +--- +id: keepPreviousData +title: keepPreviousData +--- + +```ts +function keepPreviousData(previousData): T | undefined; +``` + +Defined in: [packages/query-core/src/utils.ts:491](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L491) + +Intended to be passed as a query's `placeholderData` option, for example +`placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new +query key is fetching, it keeps displaying the previously fetched data until the new data arrives. + +## Type Parameters + +### T + +`T` + +## Parameters + +### previousData + +`T` | `undefined` + +## Returns + +`T` \| `undefined` + +## Example + +```ts +new QueryObserver(queryClient, { + queryKey: ['posts', page], + queryFn: () => fetchPosts(page), + placeholderData: keepPreviousData, +}) +``` diff --git a/docs/framework/svelte/reference/functions/matchMutation.md b/docs/framework/svelte/reference/functions/matchMutation.md new file mode 100644 index 00000000000..79468dcfad9 --- /dev/null +++ b/docs/framework/svelte/reference/functions/matchMutation.md @@ -0,0 +1,38 @@ +--- +id: matchMutation +title: matchMutation +--- + +```ts +function matchMutation(filters, mutation): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:235](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L235) + +Checks whether a mutation matches the given [MutationFilters](../interfaces/MutationFilters.md). +Every filter that is specified must match; filters that are left unspecified are ignored. +If a `mutationKey` filter is provided but the mutation has no `mutationKey` of its own, it does not match. + +## Parameters + +### filters + +[`MutationFilters`](../interfaces/MutationFilters.md) + +### mutation + +[`Mutation`](../classes/Mutation.md)\<`any`, `any`\> + +## Returns + +`boolean` + +## Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const matchingMutations = mutationCache + .getAll() + .filter((mutation) => matchMutation({ mutationKey: ['addPost'] }, mutation)) +``` diff --git a/docs/framework/svelte/reference/functions/matchQuery.md b/docs/framework/svelte/reference/functions/matchQuery.md new file mode 100644 index 00000000000..f98fe5f3537 --- /dev/null +++ b/docs/framework/svelte/reference/functions/matchQuery.md @@ -0,0 +1,37 @@ +--- +id: matchQuery +title: matchQuery +--- + +```ts +function matchQuery(filters, query): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L173) + +Checks whether a query matches the given [QueryFilters](../interfaces/QueryFilters.md). +Every filter that is specified must match; filters that are left unspecified are ignored. + +## Parameters + +### filters + +[`QueryFilters`](../interfaces/QueryFilters.md) + +### query + +[`Query`](../classes/Query.md)\<`any`, `any`, `any`, `any`\> + +## Returns + +`boolean` + +## Example + +```ts +const queryCache = queryClient.getQueryCache() + +const matchingQueries = queryCache + .getAll() + .filter((query) => matchQuery({ queryKey: ['posts'] }, query)) +``` diff --git a/docs/framework/svelte/reference/functions/mutationOptions.md b/docs/framework/svelte/reference/functions/mutationOptions.md index b1b3cbdf839..70c84d47672 100644 --- a/docs/framework/svelte/reference/functions/mutationOptions.md +++ b/docs/framework/svelte/reference/functions/mutationOptions.md @@ -37,13 +37,13 @@ overload requires `mutationKey`, so the resulting options can be looked up elsew #### options -`WithRequired`\<[`CreateMutationOptions`](../type-aliases/CreateMutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> +[`WithRequired`](../type-aliases/WithRequired.md)\<[`CreateMutationOptions`](../type-aliases/CreateMutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> The options to use — everything you can pass to `createMutation`, with `mutationKey` set. ### Returns -`WithRequired`\<[`CreateMutationOptions`](../type-aliases/CreateMutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> +[`WithRequired`](../type-aliases/WithRequired.md)\<[`CreateMutationOptions`](../type-aliases/CreateMutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> The same options object. diff --git a/docs/framework/svelte/reference/functions/noop.md b/docs/framework/svelte/reference/functions/noop.md new file mode 100644 index 00000000000..fd1b8dc2ad0 --- /dev/null +++ b/docs/framework/svelte/reference/functions/noop.md @@ -0,0 +1,32 @@ +--- +id: noop +title: noop +--- + +## Call Signature + +```ts +function noop(): void; +``` + +Defined in: [packages/query-core/src/utils.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L117) + +A function that does nothing. + +### Returns + +`void` + +## Call Signature + +```ts +function noop(): undefined; +``` + +Defined in: [packages/query-core/src/utils.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L118) + +A function that does nothing. + +### Returns + +`undefined` diff --git a/docs/framework/svelte/reference/functions/partialMatchKey.md b/docs/framework/svelte/reference/functions/partialMatchKey.md new file mode 100644 index 00000000000..3795de85b95 --- /dev/null +++ b/docs/framework/svelte/reference/functions/partialMatchKey.md @@ -0,0 +1,26 @@ +--- +id: partialMatchKey +title: partialMatchKey +--- + +```ts +function partialMatchKey(a, b): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L298) + +Checks if key `b` partially matches with key `a`. + +## Parameters + +### a + +readonly `unknown`[] + +### b + +readonly `unknown`[] + +## Returns + +`boolean` diff --git a/docs/framework/svelte/reference/functions/queryOptions.md b/docs/framework/svelte/reference/functions/queryOptions.md index 9df98bee357..da01a743ef8 100644 --- a/docs/framework/svelte/reference/functions/queryOptions.md +++ b/docs/framework/svelte/reference/functions/queryOptions.md @@ -46,7 +46,7 @@ with `initialData` set. ### Returns -[`CreateQueryOptions`](../type-aliases/CreateQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> & `object` & `QueryKeyWithDataTag`\<`TQueryKey`, `TQueryFnData`, `TError`\> +[`CreateQueryOptions`](../type-aliases/CreateQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> & `object` & [`QueryKeyWithDataTag`](../type-aliases/QueryKeyWithDataTag.md)\<`TQueryKey`, `TQueryFnData`, `TError`\> The same options object, typed so that `queryKey` carries the inferred data type. @@ -121,7 +121,7 @@ The [UndefinedInitialDataOptions](../type-aliases/UndefinedInitialDataOptions.md ### Returns -[`CreateQueryOptions`](../type-aliases/CreateQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> & `object` & `QueryKeyWithDataTag`\<`TQueryKey`, `TQueryFnData`, `TError`\> +[`CreateQueryOptions`](../type-aliases/CreateQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> & `object` & [`QueryKeyWithDataTag`](../type-aliases/QueryKeyWithDataTag.md)\<`TQueryKey`, `TQueryFnData`, `TError`\> The same options object, typed so that `queryKey` carries the inferred data type. diff --git a/docs/framework/svelte/reference/functions/replaceEqualDeep.md b/docs/framework/svelte/reference/functions/replaceEqualDeep.md new file mode 100644 index 00000000000..77a393196ef --- /dev/null +++ b/docs/framework/svelte/reference/functions/replaceEqualDeep.md @@ -0,0 +1,41 @@ +--- +id: replaceEqualDeep +title: replaceEqualDeep +--- + +```ts +function replaceEqualDeep( + a, + b, + depth?): T; +``` + +Defined in: [packages/query-core/src/utils.ts:337](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L337) + +This function returns `a` if `b` is deeply equal. +If not, it will replace any deeply equal children of `b` with those of `a`. +This can be used for structural sharing between JSON values for example. + +## Type Parameters + +### T + +`T` + +## Parameters + +### a + +`unknown` + +### b + +`T` + +### depth? + +`number` + +## Returns + +`T` diff --git a/docs/framework/svelte/reference/functions/setQueryClientContext.md b/docs/framework/svelte/reference/functions/setQueryClientContext.md index 2c469623faa..7d8309828cd 100644 --- a/docs/framework/svelte/reference/functions/setQueryClientContext.md +++ b/docs/framework/svelte/reference/functions/setQueryClientContext.md @@ -17,7 +17,7 @@ only if you need to set the client from your own component instead. ### client -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) The `QueryClient` to make available to descendant components. diff --git a/docs/framework/svelte/reference/functions/shouldThrowError.md b/docs/framework/svelte/reference/functions/shouldThrowError.md new file mode 100644 index 00000000000..3146617391e --- /dev/null +++ b/docs/framework/svelte/reference/functions/shouldThrowError.md @@ -0,0 +1,45 @@ +--- +id: shouldThrowError +title: shouldThrowError +--- + +```ts +function shouldThrowError(throwOnError, params): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L574) + +Resolves a `throwOnError` option to a boolean. +If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller, +additional context such as the query or mutation) and its result is returned, allowing the throwing +behavior to be decided per error. Otherwise, `throwOnError` itself is coerced to a boolean (`undefined` +resolves to `false`). + +## Type Parameters + +### T + +`T` *extends* (...`args`) => `boolean` + +## Parameters + +### throwOnError + +`boolean` | `T` | `undefined` + +### params + +`Parameters`\<`T`\> + +## Returns + +`boolean` + +## Example + +```ts +const throwOnError = + query.state.error && typeof options.throwOnError === 'function' + ? shouldThrowError(options.throwOnError, [query.state.error, query]) + : options.throwOnError +``` diff --git a/docs/framework/svelte/reference/functions/useHydrate.md b/docs/framework/svelte/reference/functions/useHydrate.md index 780abcd1e7f..e2b0957c9ca 100644 --- a/docs/framework/svelte/reference/functions/useHydrate.md +++ b/docs/framework/svelte/reference/functions/useHydrate.md @@ -27,13 +27,13 @@ The dehydrated state to hydrate into the cache, as produced by `dehydrate`. ### options? -`HydrateOptions` +[`HydrateOptions`](../interfaces/HydrateOptions.md) -HydrateOptions to control the hydration. +[HydrateOptions](../interfaces/HydrateOptions.md) to control the hydration. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/svelte/reference/functions/useIsFetching.md b/docs/framework/svelte/reference/functions/useIsFetching.md index 0c2eca7496f..b54ac5d3cfe 100644 --- a/docs/framework/svelte/reference/functions/useIsFetching.md +++ b/docs/framework/svelte/reference/functions/useIsFetching.md @@ -13,14 +13,14 @@ Defined in: [packages/svelte-query/src/useIsFetching.svelte.ts:40](https://githu ### filters? -`QueryFilters`\ +[`QueryFilters`](../interfaces/QueryFilters.md)\ -QueryFilters to narrow down which queries to count. Omit to count every fetching +[QueryFilters](../interfaces/QueryFilters.md) to narrow down which queries to count. Omit to count every fetching query. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/svelte/reference/functions/useIsMutating.md b/docs/framework/svelte/reference/functions/useIsMutating.md index 7be79e23809..d81f5e6106a 100644 --- a/docs/framework/svelte/reference/functions/useIsMutating.md +++ b/docs/framework/svelte/reference/functions/useIsMutating.md @@ -16,13 +16,13 @@ running (useful for app-wide loading indicators). ### filters? -`MutationFilters`\<`unknown`, `Error`, `unknown`, `unknown`\> +[`MutationFilters`](../interfaces/MutationFilters.md)\<`unknown`, `Error`, `unknown`, `unknown`\> -MutationFilters to narrow down which mutations to count. +[MutationFilters](../interfaces/MutationFilters.md) to narrow down which mutations to count. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/svelte/reference/functions/useMutationState.md b/docs/framework/svelte/reference/functions/useMutationState.md index 27cd0fac728..da623f58e46 100644 --- a/docs/framework/svelte/reference/functions/useMutationState.md +++ b/docs/framework/svelte/reference/functions/useMutationState.md @@ -16,11 +16,11 @@ were created by a different component or hook instance, or even ones no longer m ### TResult -`TResult` = `MutationState`\<`unknown`, `Error`, `unknown`, `unknown`\> +`TResult` = [`MutationState`](../interfaces/MutationState.md)\<`unknown`, `Error`, `unknown`, `unknown`\> ### TMutation -`TMutation` *extends* `Mutation`\<`any`, `any`, `any`, `any`\> = [`MutationTypeFromResult`](../type-aliases/MutationTypeFromResult.md)\<`TResult`\> +`TMutation` *extends* [`Mutation`](../classes/Mutation.md)\<`any`, `any`, `any`, `any`\> = [`MutationTypeFromResult`](../type-aliases/MutationTypeFromResult.md)\<`TResult`\> ## Parameters @@ -33,7 +33,7 @@ mutation state. ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/svelte/reference/functions/useQueryClient.md b/docs/framework/svelte/reference/functions/useQueryClient.md index 01116b8edee..1799ad8e45b 100644 --- a/docs/framework/svelte/reference/functions/useQueryClient.md +++ b/docs/framework/svelte/reference/functions/useQueryClient.md @@ -13,8 +13,8 @@ Defined in: [packages/svelte-query/src/useQueryClient.ts:4](https://github.com/T ### queryClient? -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) ## Returns -`QueryClient` +[`QueryClient`](../classes/QueryClient.md) diff --git a/docs/framework/svelte/reference/index.md b/docs/framework/svelte/reference/index.md index daeca51b5c1..83a59b64d29 100644 --- a/docs/framework/svelte/reference/index.md +++ b/docs/framework/svelte/reference/index.md @@ -3,9 +3,81 @@ id: "@tanstack/svelte-query" title: "@tanstack/svelte-query" --- +## Classes + +- [CancelledError](classes/CancelledError.md) +- [InfiniteQueryObserver](classes/InfiniteQueryObserver.md) +- [Mutation](classes/Mutation.md) +- [MutationCache](classes/MutationCache.md) +- [MutationObserver](classes/MutationObserver.md) +- [QueriesObserver](classes/QueriesObserver.md) +- [Query](classes/Query.md) +- [QueryCache](classes/QueryCache.md) +- [QueryClient](classes/QueryClient.md) +- [QueryObserver](classes/QueryObserver.md) + +## Interfaces + +- [CancelOptions](interfaces/CancelOptions.md) +- [DefaultOptions](interfaces/DefaultOptions.md) +- [DehydratedState](interfaces/DehydratedState.md) +- [DehydrateOptions](interfaces/DehydrateOptions.md) +- [~~EnsureQueryDataOptions~~](interfaces/EnsureQueryDataOptions.md) +- [FetchNextPageOptions](interfaces/FetchNextPageOptions.md) +- [FetchPreviousPageOptions](interfaces/FetchPreviousPageOptions.md) +- [~~FetchQueryOptions~~](interfaces/FetchQueryOptions.md) +- [HydrateOptions](interfaces/HydrateOptions.md) +- [InfiniteData](interfaces/InfiniteData.md) +- [InfiniteQueryObserverBaseResult](interfaces/InfiniteQueryObserverBaseResult.md) +- [InfiniteQueryObserverLoadingErrorResult](interfaces/InfiniteQueryObserverLoadingErrorResult.md) +- [InfiniteQueryObserverLoadingResult](interfaces/InfiniteQueryObserverLoadingResult.md) +- [InfiniteQueryObserverOptions](interfaces/InfiniteQueryObserverOptions.md) +- [InfiniteQueryObserverPendingResult](interfaces/InfiniteQueryObserverPendingResult.md) +- [InfiniteQueryObserverPlaceholderResult](interfaces/InfiniteQueryObserverPlaceholderResult.md) +- [InfiniteQueryObserverRefetchErrorResult](interfaces/InfiniteQueryObserverRefetchErrorResult.md) +- [InfiniteQueryObserverSuccessResult](interfaces/InfiniteQueryObserverSuccessResult.md) +- [InfiniteQueryPageParamsOptions](interfaces/InfiniteQueryPageParamsOptions.md) +- [InitialPageParam](interfaces/InitialPageParam.md) +- [InvalidateOptions](interfaces/InvalidateOptions.md) +- [InvalidateQueryFilters](interfaces/InvalidateQueryFilters.md) +- [MutateOptions](interfaces/MutateOptions.md) +- [MutationCacheConfig](interfaces/MutationCacheConfig.md) +- [MutationFilters](interfaces/MutationFilters.md) +- [MutationObserverBaseResult](interfaces/MutationObserverBaseResult.md) +- [MutationObserverErrorResult](interfaces/MutationObserverErrorResult.md) +- [MutationObserverIdleResult](interfaces/MutationObserverIdleResult.md) +- [MutationObserverLoadingResult](interfaces/MutationObserverLoadingResult.md) +- [MutationObserverOptions](interfaces/MutationObserverOptions.md) +- [MutationObserverSuccessResult](interfaces/MutationObserverSuccessResult.md) +- [MutationOptions](interfaces/MutationOptions.md) +- [MutationState](interfaces/MutationState.md) +- [NotifyEvent](interfaces/NotifyEvent.md) +- [QueriesObserverOptions](interfaces/QueriesObserverOptions.md) +- [QueryCacheConfig](interfaces/QueryCacheConfig.md) +- [QueryClientConfig](interfaces/QueryClientConfig.md) +- [QueryExecuteOptions](interfaces/QueryExecuteOptions.md) +- [QueryFilters](interfaces/QueryFilters.md) +- [QueryObserverBaseResult](interfaces/QueryObserverBaseResult.md) +- [QueryObserverLoadingErrorResult](interfaces/QueryObserverLoadingErrorResult.md) +- [QueryObserverLoadingResult](interfaces/QueryObserverLoadingResult.md) +- [QueryObserverOptions](interfaces/QueryObserverOptions.md) +- [QueryObserverPendingResult](interfaces/QueryObserverPendingResult.md) +- [QueryObserverPlaceholderResult](interfaces/QueryObserverPlaceholderResult.md) +- [QueryObserverRefetchErrorResult](interfaces/QueryObserverRefetchErrorResult.md) +- [QueryObserverSuccessResult](interfaces/QueryObserverSuccessResult.md) +- [QueryOptions](interfaces/QueryOptions.md) +- [QueryState](interfaces/QueryState.md) +- [RefetchOptions](interfaces/RefetchOptions.md) +- [RefetchQueryFilters](interfaces/RefetchQueryFilters.md) +- [Register](interfaces/Register.md) +- [ResetOptions](interfaces/ResetOptions.md) +- [ResultOptions](interfaces/ResultOptions.md) +- [SetDataOptions](interfaces/SetDataOptions.md) + ## Type Aliases - [Accessor](type-aliases/Accessor.md) +- [AnyDataTag](type-aliases/AnyDataTag.md) - [CreateBaseMutationResult](type-aliases/CreateBaseMutationResult.md) - [CreateBaseQueryOptions](type-aliases/CreateBaseQueryOptions.md) - [CreateBaseQueryResult](type-aliases/CreateBaseQueryResult.md) @@ -17,23 +89,92 @@ title: "@tanstack/svelte-query" - [CreateMutationResult](type-aliases/CreateMutationResult.md) - [CreateQueryOptions](type-aliases/CreateQueryOptions.md) - [CreateQueryResult](type-aliases/CreateQueryResult.md) +- [DataTag](type-aliases/DataTag.md) +- [dataTagErrorSymbol](type-aliases/dataTagErrorSymbol.md) +- [dataTagSymbol](type-aliases/dataTagSymbol.md) +- [DefaultedInfiniteQueryObserverOptions](type-aliases/DefaultedInfiniteQueryObserverOptions.md) +- [DefaultedQueryObserverOptions](type-aliases/DefaultedQueryObserverOptions.md) +- [DefaultError](type-aliases/DefaultError.md) - [DefinedCreateBaseQueryResult](type-aliases/DefinedCreateBaseQueryResult.md) - [DefinedCreateInfiniteQueryResult](type-aliases/DefinedCreateInfiniteQueryResult.md) - [DefinedCreateQueryResult](type-aliases/DefinedCreateQueryResult.md) +- [DefinedInfiniteQueryObserverResult](type-aliases/DefinedInfiniteQueryObserverResult.md) - [DefinedInitialDataInfiniteOptions](type-aliases/DefinedInitialDataInfiniteOptions.md) - [DefinedInitialDataOptions](type-aliases/DefinedInitialDataOptions.md) +- [DefinedQueryObserverResult](type-aliases/DefinedQueryObserverResult.md) +- [DistributiveOmit](type-aliases/DistributiveOmit.md) +- [~~EnsureInfiniteQueryDataOptions~~](type-aliases/EnsureInfiniteQueryDataOptions.md) +- [~~FetchInfiniteQueryOptions~~](type-aliases/FetchInfiniteQueryOptions.md) +- [FetchStatus](type-aliases/FetchStatus.md) +- [GetNextPageParamFunction](type-aliases/GetNextPageParamFunction.md) +- [GetPreviousPageParamFunction](type-aliases/GetPreviousPageParamFunction.md) - [HydrationBoundary](type-aliases/HydrationBoundary.md) +- [InferDataFromTag](type-aliases/InferDataFromTag.md) +- [InferErrorFromTag](type-aliases/InferErrorFromTag.md) +- [InfiniteQueryExecuteOptions](type-aliases/InfiniteQueryExecuteOptions.md) +- [InfiniteQueryObserverResult](type-aliases/InfiniteQueryObserverResult.md) +- [InitialDataFunction](type-aliases/InitialDataFunction.md) +- [ManagedTimerId](type-aliases/ManagedTimerId.md) +- [MutateFunction](type-aliases/MutateFunction.md) +- [MutateFunctionRest](type-aliases/MutateFunctionRest.md) +- [MutationCacheNotifyEvent](type-aliases/MutationCacheNotifyEvent.md) +- [MutationFunction](type-aliases/MutationFunction.md) +- [MutationFunctionContext](type-aliases/MutationFunctionContext.md) +- [MutationKey](type-aliases/MutationKey.md) +- [MutationMeta](type-aliases/MutationMeta.md) +- [MutationObserverResult](type-aliases/MutationObserverResult.md) +- [MutationScope](type-aliases/MutationScope.md) - [MutationStateOptions](type-aliases/MutationStateOptions.md) +- [MutationStatus](type-aliases/MutationStatus.md) - [MutationTypeFromResult](type-aliases/MutationTypeFromResult.md) +- [NetworkMode](type-aliases/NetworkMode.md) +- [NonUndefinedGuard](type-aliases/NonUndefinedGuard.md) +- [NotifyEventType](type-aliases/NotifyEventType.md) +- [NotifyOnChangeProps](type-aliases/NotifyOnChangeProps.md) +- [OmitKeyof](type-aliases/OmitKeyof.md) +- [Override](type-aliases/Override.md) +- [PlaceholderDataFunction](type-aliases/PlaceholderDataFunction.md) - [QueriesOptions](type-aliases/QueriesOptions.md) +- [QueriesPlaceholderDataFunction](type-aliases/QueriesPlaceholderDataFunction.md) - [QueriesResults](type-aliases/QueriesResults.md) +- [QueryBooleanOption](type-aliases/QueryBooleanOption.md) +- [QueryCacheNotifyEvent](type-aliases/QueryCacheNotifyEvent.md) - [QueryClientProviderProps](type-aliases/QueryClientProviderProps.md) +- [QueryFunction](type-aliases/QueryFunction.md) +- [QueryFunctionContext](type-aliases/QueryFunctionContext.md) +- [QueryKey](type-aliases/QueryKey.md) +- [QueryKeyHashFunction](type-aliases/QueryKeyHashFunction.md) +- [QueryKeyWithDataTag](type-aliases/QueryKeyWithDataTag.md) +- [QueryMeta](type-aliases/QueryMeta.md) +- [QueryObserverResult](type-aliases/QueryObserverResult.md) +- [QueryPersister](type-aliases/QueryPersister.md) +- [QueryStatus](type-aliases/QueryStatus.md) +- [SkipToken](type-aliases/SkipToken.md) +- [StaleTime](type-aliases/StaleTime.md) +- [StaleTimeFunction](type-aliases/StaleTimeFunction.md) +- [ThrowOnError](type-aliases/ThrowOnError.md) +- [TimeoutCallback](type-aliases/TimeoutCallback.md) +- [TimeoutProvider](type-aliases/TimeoutProvider.md) - [UndefinedInitialDataInfiniteOptions](type-aliases/UndefinedInitialDataInfiniteOptions.md) - [UndefinedInitialDataOptions](type-aliases/UndefinedInitialDataOptions.md) +- [UnsetMarker](type-aliases/UnsetMarker.md) +- [Updater](type-aliases/Updater.md) +- [WithRequired](type-aliases/WithRequired.md) ## Variables +- [dataTagErrorSymbol](variables/dataTagErrorSymbol.md) +- [dataTagSymbol](variables/dataTagSymbol.md) +- [defaultScheduler](variables/defaultScheduler.md) +- [environmentManager](variables/environmentManager.md) +- [focusManager](variables/focusManager.md) - [HydrationBoundary](variables/HydrationBoundary.md) +- [~~isServer~~](variables/isServer.md) +- [notifyManager](variables/notifyManager.md) +- [onlineManager](variables/onlineManager.md) +- [skipToken](variables/skipToken.md) +- [timeoutManager](variables/timeoutManager.md) +- [unsetMarker](variables/unsetMarker.md) ## Functions @@ -41,13 +182,28 @@ title: "@tanstack/svelte-query" - [createMutation](functions/createMutation.md) - [createQueries](functions/createQueries.md) - [createQuery](functions/createQuery.md) +- [defaultShouldDehydrateMutation](functions/defaultShouldDehydrateMutation.md) +- [defaultShouldDehydrateQuery](functions/defaultShouldDehydrateQuery.md) +- [dehydrate](functions/dehydrate.md) +- [dehydrateQuery](functions/dehydrateQuery.md) +- [experimental\_streamedQuery](functions/experimental_streamedQuery.md) - [getIsRestoringContext](functions/getIsRestoringContext.md) - [getQueryClientContext](functions/getQueryClientContext.md) +- [hashKey](functions/hashKey.md) +- [hydrate](functions/hydrate.md) - [infiniteQueryOptions](functions/infiniteQueryOptions.md) +- [~~isCancelledError~~](functions/isCancelledError.md) +- [keepPreviousData](functions/keepPreviousData.md) +- [matchMutation](functions/matchMutation.md) +- [matchQuery](functions/matchQuery.md) - [mutationOptions](functions/mutationOptions.md) +- [noop](functions/noop.md) +- [partialMatchKey](functions/partialMatchKey.md) - [queryOptions](functions/queryOptions.md) +- [replaceEqualDeep](functions/replaceEqualDeep.md) - [setIsRestoringContext](functions/setIsRestoringContext.md) - [setQueryClientContext](functions/setQueryClientContext.md) +- [shouldThrowError](functions/shouldThrowError.md) - [useHydrate](functions/useHydrate.md) - [useIsFetching](functions/useIsFetching.md) - [useIsMutating](functions/useIsMutating.md) diff --git a/docs/framework/svelte/reference/interfaces/CancelOptions.md b/docs/framework/svelte/reference/interfaces/CancelOptions.md new file mode 100644 index 00000000000..2b9293712d2 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/CancelOptions.md @@ -0,0 +1,26 @@ +--- +id: CancelOptions +title: CancelOptions +--- + +Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) + +## Properties + +### revert? + +```ts +optional revert: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1444) + +*** + +### silent? + +```ts +optional silent: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1445](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1445) diff --git a/docs/framework/svelte/reference/interfaces/DefaultOptions.md b/docs/framework/svelte/reference/interfaces/DefaultOptions.md new file mode 100644 index 00000000000..149ef5b3444 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/DefaultOptions.md @@ -0,0 +1,76 @@ +--- +id: DefaultOptions +title: DefaultOptions +--- + +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) + +## Type Parameters + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### dehydrate? + +```ts +optional dehydrate: DehydrateOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) + +*** + +### hydrate? + +```ts +optional hydrate: object; +``` + +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) + +#### deserializeData? + +```ts +optional deserializeData: TransformerFn; +``` + +Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. + +#### mutations? + +```ts +optional mutations: MutationOptions; +``` + +Default options merged into every mutation restored from the dehydrated state. + +#### queries? + +```ts +optional queries: QueryOptions; +``` + +Default options merged into every query restored from the dehydrated state. + +*** + +### mutations? + +```ts +optional mutations: MutationObserverOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) + +*** + +### queries? + +```ts +optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; +``` + +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) diff --git a/docs/framework/svelte/reference/interfaces/DehydrateOptions.md b/docs/framework/svelte/reference/interfaces/DehydrateOptions.md new file mode 100644 index 00000000000..e862ae88b43 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/DehydrateOptions.md @@ -0,0 +1,89 @@ +--- +id: DehydrateOptions +title: DehydrateOptions +--- + +Defined in: [packages/query-core/src/hydration.ts:42](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L42) + +Options for `dehydrate`, controlling which queries/mutations are included in the resulting `DehydratedState` and +how their data/errors are transformed before being serialized (e.g. for embedding in server-rendered markup). + +## Properties + +### serializeData? + +```ts +optional serializeData: TransformerFn; +``` + +Defined in: [packages/query-core/src/hydration.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L44) + +Transforms a query's `data` before it is dehydrated. Useful for non-JSON-serializable data. + +*** + +### shouldDehydrateMutation()? + +```ts +optional shouldDehydrateMutation: (mutation) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:46](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L46) + +Predicate to decide whether a given `Mutation` should be dehydrated. Defaults to `defaultShouldDehydrateMutation`. + +#### Parameters + +##### mutation + +[`Mutation`](../classes/Mutation.md) + +#### Returns + +`boolean` + +*** + +### shouldDehydrateQuery()? + +```ts +optional shouldDehydrateQuery: (query) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:48](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L48) + +Predicate to decide whether a given `Query` should be dehydrated. Defaults to `defaultShouldDehydrateQuery`. + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +*** + +### shouldRedactErrors()? + +```ts +optional shouldRedactErrors: (error) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L54) + +Predicate to decide whether a query's error should be redacted before dehydration. Errors are redacted +(replaced with a generic `Error('redacted')`) unless this function is provided and returns `false` for the +given error, in which case the original error is kept. + +#### Parameters + +##### error + +`unknown` + +#### Returns + +`boolean` diff --git a/docs/framework/svelte/reference/interfaces/DehydratedState.md b/docs/framework/svelte/reference/interfaces/DehydratedState.md new file mode 100644 index 00000000000..7edce60a00d --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/DehydratedState.md @@ -0,0 +1,30 @@ +--- +id: DehydratedState +title: DehydratedState +--- + +Defined in: [packages/query-core/src/hydration.ts:97](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L97) + +A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically +transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data +that has already been fetched, avoiding a redundant fetch on the client. + +## Properties + +### mutations + +```ts +mutations: DehydratedMutation[]; +``` + +Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L98) + +*** + +### queries + +```ts +queries: DehydratedQuery[]; +``` + +Defined in: [packages/query-core/src/hydration.ts:99](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L99) diff --git a/docs/framework/svelte/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/svelte/reference/interfaces/EnsureQueryDataOptions.md new file mode 100644 index 00000000000..d7b4751a9d3 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/EnsureQueryDataOptions.md @@ -0,0 +1,343 @@ +--- +id: EnsureQueryDataOptions +title: EnsureQueryDataOptions +--- + +Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) + +## Deprecated + +## Extends + +- [`FetchQueryOptions`](FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### ~~gcTime?~~ + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`gcTime`](FetchQueryOptions.md#gctime) + +*** + +### ~~initialData?~~ + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialData`](FetchQueryOptions.md#initialdata) + +*** + +### ~~initialDataUpdatedAt?~~ + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialDataUpdatedAt`](FetchQueryOptions.md#initialdataupdatedat) + +*** + +### ~~initialPageParam?~~ + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialPageParam`](FetchQueryOptions.md#initialpageparam) + +*** + +### ~~maxPages?~~ + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`maxPages`](FetchQueryOptions.md#maxpages) + +*** + +### ~~meta?~~ + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`meta`](FetchQueryOptions.md#meta) + +*** + +### ~~networkMode?~~ + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`networkMode`](FetchQueryOptions.md#networkmode) + +*** + +### ~~persister?~~ + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`persister`](FetchQueryOptions.md#persister) + +*** + +### ~~queryFn?~~ + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryFn`](FetchQueryOptions.md#queryfn) + +*** + +### ~~queryHash?~~ + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryHash`](FetchQueryOptions.md#queryhash) + +*** + +### ~~queryKey~~ + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryKey`](FetchQueryOptions.md#querykey) + +*** + +### ~~queryKeyHashFn?~~ + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryKeyHashFn`](FetchQueryOptions.md#querykeyhashfn) + +*** + +### ~~retry?~~ + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`retry`](FetchQueryOptions.md#retry) + +*** + +### ~~retryDelay?~~ + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`retryDelay`](FetchQueryOptions.md#retrydelay) + +*** + +### ~~revalidateIfStale?~~ + +```ts +optional revalidateIfStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L608) + +*** + +### ~~staleTime?~~ + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`staleTime`](FetchQueryOptions.md#staletime) + +*** + +### ~~structuralSharing?~~ + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`structuralSharing`](FetchQueryOptions.md#structuralsharing) diff --git a/docs/framework/svelte/reference/interfaces/FetchNextPageOptions.md b/docs/framework/svelte/reference/interfaces/FetchNextPageOptions.md new file mode 100644 index 00000000000..fefe7f30c13 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/FetchNextPageOptions.md @@ -0,0 +1,41 @@ +--- +id: FetchNextPageOptions +title: FetchNextPageOptions +--- + +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) + +If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, +whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + +If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/svelte/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/svelte/reference/interfaces/FetchPreviousPageOptions.md new file mode 100644 index 00000000000..ad3c3c736c9 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/FetchPreviousPageOptions.md @@ -0,0 +1,41 @@ +--- +id: FetchPreviousPageOptions +title: FetchPreviousPageOptions +--- + +Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) + +If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, +whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + +If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/svelte/reference/interfaces/FetchQueryOptions.md b/docs/framework/svelte/reference/interfaces/FetchQueryOptions.md new file mode 100644 index 00000000000..3b9347e06ea --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/FetchQueryOptions.md @@ -0,0 +1,357 @@ +--- +id: FetchQueryOptions +title: FetchQueryOptions +--- + +Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L576) + +## Deprecated + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Extended by + +- [`EnsureQueryDataOptions`](EnsureQueryDataOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### ~~gcTime?~~ + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### ~~initialData?~~ + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### ~~initialDataUpdatedAt?~~ + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### ~~initialPageParam?~~ + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) + +*** + +### ~~maxPages?~~ + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### ~~meta?~~ + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### ~~networkMode?~~ + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### ~~persister?~~ + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### ~~queryFn?~~ + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### ~~queryHash?~~ + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### ~~queryKey~~ + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### ~~queryKeyHashFn?~~ + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### ~~retry?~~ + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### ~~retryDelay?~~ + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### ~~staleTime?~~ + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +*** + +### ~~structuralSharing?~~ + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` diff --git a/docs/framework/svelte/reference/interfaces/HydrateOptions.md b/docs/framework/svelte/reference/interfaces/HydrateOptions.md new file mode 100644 index 00000000000..fe8b92317e3 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/HydrateOptions.md @@ -0,0 +1,43 @@ +--- +id: HydrateOptions +title: HydrateOptions +--- + +Defined in: [packages/query-core/src/hydration.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L61) + +Options for `hydrate`, controlling the default options applied to queries/mutations restored from a +`DehydratedState`, and how to reverse any transformation applied by `DehydrateOptions.serializeData`. + +## Properties + +### defaultOptions? + +```ts +optional defaultOptions: object; +``` + +Defined in: [packages/query-core/src/hydration.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L62) + +#### deserializeData? + +```ts +optional deserializeData: TransformerFn; +``` + +Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. + +#### mutations? + +```ts +optional mutations: MutationOptions; +``` + +Default options merged into every mutation restored from the dehydrated state. + +#### queries? + +```ts +optional queries: QueryOptions; +``` + +Default options merged into every query restored from the dehydrated state. diff --git a/docs/framework/svelte/reference/interfaces/InfiniteData.md b/docs/framework/svelte/reference/interfaces/InfiniteData.md new file mode 100644 index 00000000000..4d7ad595c2d --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/InfiniteData.md @@ -0,0 +1,36 @@ +--- +id: InfiniteData +title: InfiniteData +--- + +Defined in: [packages/query-core/src/types.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L210) + +## Type Parameters + +### TData + +`TData` + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### pageParams + +```ts +pageParams: TPageParam[]; +``` + +Defined in: [packages/query-core/src/types.ts:212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L212) + +*** + +### pages + +```ts +pages: TData[]; +``` + +Defined in: [packages/query-core/src/types.ts:211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L211) diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult.md new file mode 100644 index 00000000000..94347ea2e40 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -0,0 +1,577 @@ +--- +id: InfiniteQueryObserverBaseResult +title: InfiniteQueryObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Extended by + +- [`InfiniteQueryObserverPendingResult`](InfiniteQueryObserverPendingResult.md) +- [`InfiniteQueryObserverLoadingResult`](InfiniteQueryObserverLoadingResult.md) +- [`InfiniteQueryObserverLoadingErrorResult`](InfiniteQueryObserverLoadingErrorResult.md) +- [`InfiniteQueryObserverRefetchErrorResult`](InfiniteQueryObserverRefetchErrorResult.md) +- [`InfiniteQueryObserverSuccessResult`](InfiniteQueryObserverSuccessResult.md) +- [`InfiniteQueryObserverPlaceholderResult`](InfiniteQueryObserverPlaceholderResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) + +The last successfully resolved data for the query. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) + +Will be `true` if the query failed while fetching the next page. + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) + +Will be `true` if the query failed while fetching the previous page. + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) + +Will be `true` if the query failed while fetching for the first time. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) + +Will be `true` if the data shown is the placeholder data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) + +Will be `true` if the query failed while refetching. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md new file mode 100644 index 00000000000..3e0d3a79fa1 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverLoadingErrorResult +title: InfiniteQueryObserverLoadingErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult.md new file mode 100644 index 00000000000..f6400f44b52 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverLoadingResult +title: InfiniteQueryObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: true; +``` + +Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverOptions.md new file mode 100644 index 00000000000..db1ca7f18fe --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverOptions.md @@ -0,0 +1,605 @@ +--- +id: InfiniteQueryObserverOptions +title: InfiniteQueryObserverOptions +--- + +Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) + +## Extends + +- [`QueryObserverOptions`](QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`, `TPageParam`\>.[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md)\<`TQueryFnData`, `TPageParam`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### enabled? + +```ts +optional enabled: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`enabled`](QueryObserverOptions.md#enabled) + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`gcTime`](QueryObserverOptions.md#gctime) + +*** + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`getNextPageParam`](InfiniteQueryPageParamsOptions.md#getnextpageparam) + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`getPreviousPageParam`](InfiniteQueryPageParamsOptions.md#getpreviouspageparam) + +*** + +### initialData? + +```ts +optional initialData: + | InfiniteData +| InitialDataFunction>; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialData`](QueryObserverOptions.md#initialdata) + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialDataUpdatedAt`](QueryObserverOptions.md#initialdataupdatedat) + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`initialPageParam`](InfiniteQueryPageParamsOptions.md#initialpageparam) + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`maxPages`](QueryObserverOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`meta`](QueryObserverOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`networkMode`](QueryObserverOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`persister`](QueryObserverOptions.md#persister) + +*** + +### placeholderData? + +```ts +optional placeholderData: + | InfiniteData +| PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`placeholderData`](QueryObserverOptions.md#placeholderdata) + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryFn`](QueryObserverOptions.md#queryfn) + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryHash`](QueryObserverOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKey`](QueryObserverOptions.md#querykey) + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKeyHashFn`](QueryObserverOptions.md#querykeyhashfn) + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchInterval`](QueryObserverOptions.md#refetchinterval) + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnMount`](QueryObserverOptions.md#refetchonmount) + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnReconnect`](QueryObserverOptions.md#refetchonreconnect) + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnWindowFocus`](QueryObserverOptions.md#refetchonwindowfocus) + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retry`](QueryObserverOptions.md#retry) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryOnMount`](QueryObserverOptions.md#retryonmount) + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +[`InfiniteData`](InfiniteData.md) + +#### Returns + +`TData` + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`select`](QueryObserverOptions.md#select) + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`staleTime`](QueryObserverOptions.md#staletime) + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`structuralSharing`](QueryObserverOptions.md#structuralsharing) + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`suspense`](QueryObserverOptions.md#suspense) + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`throwOnError`](QueryObserverOptions.md#throwonerror) diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult.md new file mode 100644 index 00000000000..53d910f545d --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverPendingResult +title: InfiniteQueryObserverPendingResult +--- + +Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1009) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1013](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1013) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1017](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1017) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1016](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1016) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1021](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1021) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1023](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1023) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md new file mode 100644 index 00000000000..5949179bc6f --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverPlaceholderResult +title: InfiniteQueryObserverPlaceholderResult +--- + +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: true; +``` + +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md new file mode 100644 index 00000000000..e299e60ddc3 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverRefetchErrorResult +title: InfiniteQueryObserverRefetchErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) + +Will be `true` if the query failed while fetching the next page. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) + +Will be `true` if the query failed while fetching the previous page. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult.md new file mode 100644 index 00000000000..7b550e0a90b --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverSuccessResult +title: InfiniteQueryObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryPageParamsOptions.md new file mode 100644 index 00000000000..bfab8bfc319 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -0,0 +1,64 @@ +--- +id: InfiniteQueryPageParamsOptions +title: InfiniteQueryPageParamsOptions +--- + +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) + +## Extends + +- [`InitialPageParam`](InitialPageParam.md)\<`TPageParam`\> + +## Extended by + +- [`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +[`InitialPageParam`](InitialPageParam.md).[`initialPageParam`](InitialPageParam.md#initialpageparam) diff --git a/docs/framework/svelte/reference/interfaces/InitialPageParam.md b/docs/framework/svelte/reference/interfaces/InitialPageParam.md new file mode 100644 index 00000000000..ffbf32ae0d6 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/InitialPageParam.md @@ -0,0 +1,26 @@ +--- +id: InitialPageParam +title: InitialPageParam +--- + +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) + +## Extended by + +- [`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md) + +## Type Parameters + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) diff --git a/docs/framework/svelte/reference/interfaces/InvalidateOptions.md b/docs/framework/svelte/reference/interfaces/InvalidateOptions.md new file mode 100644 index 00000000000..494afe1c465 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/InvalidateOptions.md @@ -0,0 +1,44 @@ +--- +id: InvalidateOptions +title: InvalidateOptions +--- + +Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L700) + +## Extends + +- [`RefetchOptions`](RefetchOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`cancelRefetch`](RefetchOptions.md#cancelrefetch) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`throwOnError`](RefetchOptions.md#throwonerror) diff --git a/docs/framework/svelte/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/svelte/reference/interfaces/InvalidateQueryFilters.md new file mode 100644 index 00000000000..4824d80d910 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/InvalidateQueryFilters.md @@ -0,0 +1,135 @@ +--- +id: InvalidateQueryFilters +title: InvalidateQueryFilters +--- + +Defined in: [packages/query-core/src/types.ts:690](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L690) + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extends + +- [`QueryFilters`](QueryFilters.md)\<`TQueryKey`\> + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`exact`](QueryFilters.md#exact) + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`fetchStatus`](QueryFilters.md#fetchstatus) + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`predicate`](QueryFilters.md#predicate) + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`queryKey`](QueryFilters.md#querykey) + +*** + +### refetchType? + +```ts +optional refetchType: QueryTypeFilter | "none"; +``` + +Defined in: [packages/query-core/src/types.ts:693](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L693) + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`stale`](QueryFilters.md#stale) + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/svelte/reference/interfaces/MutateOptions.md b/docs/framework/svelte/reference/interfaces/MutateOptions.md new file mode 100644 index 00000000000..a0af091a997 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/MutateOptions.md @@ -0,0 +1,124 @@ +--- +id: MutateOptions +title: MutateOptions +--- + +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1228) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1234) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1222](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1222) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` diff --git a/docs/framework/svelte/reference/interfaces/MutationCacheConfig.md b/docs/framework/svelte/reference/interfaces/MutationCacheConfig.md new file mode 100644 index 00000000000..c38d2dc26f4 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/MutationCacheConfig.md @@ -0,0 +1,161 @@ +--- +id: MutationCacheConfig +title: MutationCacheConfig +--- + +Defined in: [packages/query-core/src/mutationCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L26) + +Global callbacks that fire for every mutation handled by a `MutationCache`, regardless of which +component or observer triggered it. They differ from the `defaultOptions` provided to a +`QueryClient` in two ways: `defaultOptions` can be overridden by each mutation, while these +callbacks are always called, and `onMutate` here does not allow returning a result. + +If a callback returns a promise, it will be awaited before the mutation continues. + +## Properties + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L28) + +Called when any mutation in the cache encounters an error. + +#### Parameters + +##### error + +`Error` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L44) + +Called before any mutation in the cache executes. + +#### Parameters + +##### variables + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:50](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L50) + +Called when any mutation in the cache is settled, either successfully or with an error. + +#### Parameters + +##### data + +`unknown` + +##### error + +`Error` | `null` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:36](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L36) + +Called when any mutation in the cache is successful. + +#### Parameters + +##### data + +`unknown` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` diff --git a/docs/framework/svelte/reference/interfaces/MutationFilters.md b/docs/framework/svelte/reference/interfaces/MutationFilters.md new file mode 100644 index 00000000000..378a411bfe5 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/MutationFilters.md @@ -0,0 +1,85 @@ +--- +id: MutationFilters +title: MutationFilters +--- + +Defined in: [packages/query-core/src/utils.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L62) + +Filters used to select mutations, for example in `mutationCache.findAll` or `queryClient.isMutating`. +All provided filters must match; filters that are left unspecified are ignored. + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L71) + +Match mutation key exactly + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/utils.ts:81](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L81) + +Include mutations matching this mutation key + +*** + +### predicate()? + +```ts +optional predicate: (mutation) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L75) + +Include mutations matching this predicate function + +#### Parameters + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`boolean` + +*** + +### status? + +```ts +optional status: MutationStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L85) + +Filter by mutation status diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverBaseResult.md new file mode 100644 index 00000000000..98810323966 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/MutationObserverBaseResult.md @@ -0,0 +1,291 @@ +--- +id: MutationObserverBaseResult +title: MutationObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationState`](MutationState.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Extended by + +- [`MutationObserverIdleResult`](MutationObserverIdleResult.md) +- [`MutationObserverLoadingResult`](MutationObserverLoadingResult.md) +- [`MutationObserverErrorResult`](MutationObserverErrorResult.md) +- [`MutationObserverSuccessResult`](MutationObserverSuccessResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationState`](MutationState.md).[`context`](MutationState.md#context) + +*** + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationState`](MutationState.md).[`data`](MutationState.md#data) + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:1285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1285) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationState`](MutationState.md).[`error`](MutationState.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationState`](MutationState.md).[`failureCount`](MutationState.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationState`](MutationState.md).[`failureReason`](MutationState.md#failurereason) + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +*** + +### isIdle + +```ts +isIdle: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1295) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationState`](MutationState.md).[`isPaused`](MutationState.md#ispaused) + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1300](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1300) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1305](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1305) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +*** + +### status + +```ts +status: MutationStatus; +``` + +Defined in: [packages/query-core/src/types.ts:1314](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1314) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationState`](MutationState.md).[`status`](MutationState.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationState`](MutationState.md).[`submittedAt`](MutationState.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationState`](MutationState.md).[`variables`](MutationState.md#variables) diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverErrorResult.md new file mode 100644 index 00000000000..d61f244ced4 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/MutationObserverErrorResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverErrorResult +title: MutationObserverErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1374](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1374) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1385](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1385) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1386](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1386) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1388](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1388) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1389](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1389) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1390) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverIdleResult.md new file mode 100644 index 00000000000..93655da0aa5 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/MutationObserverIdleResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverIdleResult +title: MutationObserverIdleResult +--- + +Defined in: [packages/query-core/src/types.ts:1332](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1332) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1346](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1346) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: true; +``` + +Defined in: [packages/query-core/src/types.ts:1347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1347) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1349) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "idle"; +``` + +Defined in: [packages/query-core/src/types.ts:1350](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1350) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverLoadingResult.md new file mode 100644 index 00000000000..de146c45f5c --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/MutationObserverLoadingResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverLoadingResult +title: MutationObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1364](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1364) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1367](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1367) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1369](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1369) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1370](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1370) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1371](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1371) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1365) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverOptions.md b/docs/framework/svelte/reference/interfaces/MutationObserverOptions.md new file mode 100644 index 00000000000..fe59cc7444d --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/MutationObserverOptions.md @@ -0,0 +1,290 @@ +--- +id: MutationObserverOptions +title: MutationObserverOptions +--- + +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) + +## Extends + +- [`MutationOptions`](MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`gcTime`](MutationOptions.md#gctime) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`meta`](MutationOptions.md#meta) + +*** + +### mutationFn? + +```ts +optional mutationFn: MutationFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`mutationFn`](MutationOptions.md#mutationfn) + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`mutationKey`](MutationOptions.md#mutationkey) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`networkMode`](MutationOptions.md#networkmode) + +*** + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onError`](MutationOptions.md#onerror) + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, context) => TOnMutateResult | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) + +#### Parameters + +##### variables + +`TVariables` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`TOnMutateResult` \| `Promise`\<`TOnMutateResult`\> + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onMutate`](MutationOptions.md#onmutate) + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onSettled`](MutationOptions.md#onsettled) + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`onSuccess`](MutationOptions.md#onsuccess) + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`retry`](MutationOptions.md#retry) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`retryDelay`](MutationOptions.md#retrydelay) + +*** + +### scope? + +```ts +optional scope: MutationScope; +``` + +Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) + +#### Inherited from + +[`MutationOptions`](MutationOptions.md).[`scope`](MutationOptions.md#scope) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean | (error) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverSuccessResult.md new file mode 100644 index 00000000000..b50ec4ab6f1 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/MutationObserverSuccessResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverSuccessResult +title: MutationObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1406](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1406) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1407) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1409) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1410](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1410) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/svelte/reference/interfaces/MutationOptions.md b/docs/framework/svelte/reference/interfaces/MutationOptions.md new file mode 100644 index 00000000000..f641d241142 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/MutationOptions.md @@ -0,0 +1,232 @@ +--- +id: MutationOptions +title: MutationOptions +--- + +Defined in: [packages/query-core/src/types.ts:1166](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1166) + +## Extended by + +- [`MutationObserverOptions`](MutationObserverOptions.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) + +*** + +### mutationFn? + +```ts +optional mutationFn: MutationFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) + +*** + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, context) => TOnMutateResult | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) + +#### Parameters + +##### variables + +`TVariables` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`TOnMutateResult` \| `Promise`\<`TOnMutateResult`\> + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) + +*** + +### scope? + +```ts +optional scope: MutationScope; +``` + +Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) diff --git a/docs/framework/svelte/reference/interfaces/MutationState.md b/docs/framework/svelte/reference/interfaces/MutationState.md new file mode 100644 index 00000000000..bec050ec1d3 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/MutationState.md @@ -0,0 +1,142 @@ +--- +id: MutationState +title: MutationState +--- + +Defined in: [packages/query-core/src/mutation.ts:30](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L30) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extended by + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +*** + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L44) + +The last successfully resolved data for the mutation. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L49) + +The error object for the mutation, if the last attempt resulted in an error. +- Defaults to `null`. + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +*** + +### status + +```ts +status: MutationStatus; +``` + +Defined in: [packages/query-core/src/mutation.ts:66](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L66) + +The status of the mutation. + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +*** + +### variables + +```ts +variables: TVariables | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L70) + +The variables the mutation was last called with. diff --git a/docs/framework/svelte/reference/interfaces/NotifyEvent.md b/docs/framework/svelte/reference/interfaces/NotifyEvent.md new file mode 100644 index 00000000000..1dc93464df1 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/NotifyEvent.md @@ -0,0 +1,16 @@ +--- +id: NotifyEvent +title: NotifyEvent +--- + +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) + +## Properties + +### type + +```ts +type: NotifyEventType; +``` + +Defined in: [packages/query-core/src/types.ts:1462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1462) diff --git a/docs/framework/svelte/reference/interfaces/QueriesObserverOptions.md b/docs/framework/svelte/reference/interfaces/QueriesObserverOptions.md new file mode 100644 index 00000000000..16035c45714 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/QueriesObserverOptions.md @@ -0,0 +1,27 @@ +--- +id: QueriesObserverOptions +title: QueriesObserverOptions +--- + +Defined in: [packages/query-core/src/queriesObserver.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L23) + +## Type Parameters + +### TCombinedResult + +`TCombinedResult` = [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +## Properties + +### combine? + +```ts +optional combine: CombineFn; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L32) + +A function that combines the array of `QueryObserverResult`s (one per +observed query) into a single value. The combined value is memoized and +only recomputed when one of the underlying results, the query hashes, or +the `combine` function itself changes. diff --git a/docs/framework/svelte/reference/interfaces/QueryCacheConfig.md b/docs/framework/svelte/reference/interfaces/QueryCacheConfig.md new file mode 100644 index 00000000000..69ea600366c --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/QueryCacheConfig.md @@ -0,0 +1,92 @@ +--- +id: QueryCacheConfig +title: QueryCacheConfig +--- + +Defined in: [packages/query-core/src/queryCache.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L24) + +Global callbacks that fire for every query handled by a `QueryCache`, regardless of which +component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can +override, these callbacks are always called. + +## Properties + +### onError()? + +```ts +optional onError: (error, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L26) + +Called when any query in the cache encounters an error. + +#### Parameters + +##### error + +`Error` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L33) + +Called when any query in the cache is settled, either successfully or with an error. + +#### Parameters + +##### data + +`unknown` + +##### error + +`Error` | `null` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L31) + +Called when any query in the cache is successful. + +#### Parameters + +##### data + +`unknown` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` diff --git a/docs/framework/svelte/reference/interfaces/QueryClientConfig.md b/docs/framework/svelte/reference/interfaces/QueryClientConfig.md new file mode 100644 index 00000000000..7c9bc255b35 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/QueryClientConfig.md @@ -0,0 +1,36 @@ +--- +id: QueryClientConfig +title: QueryClientConfig +--- + +Defined in: [packages/query-core/src/types.ts:1427](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1427) + +## Properties + +### defaultOptions? + +```ts +optional defaultOptions: DefaultOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1430](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1430) + +*** + +### mutationCache? + +```ts +optional mutationCache: MutationCache; +``` + +Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) + +*** + +### queryCache? + +```ts +optional queryCache: QueryCache; +``` + +Defined in: [packages/query-core/src/types.ts:1428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1428) diff --git a/docs/framework/svelte/reference/interfaces/QueryExecuteOptions.md b/docs/framework/svelte/reference/interfaces/QueryExecuteOptions.md new file mode 100644 index 00000000000..5a055675308 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/QueryExecuteOptions.md @@ -0,0 +1,375 @@ +--- +id: QueryExecuteOptions +title: QueryExecuteOptions +--- + +Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L555) + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](QueryOptions.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### initialPageParam? + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L567) + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:572](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L572) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` diff --git a/docs/framework/svelte/reference/interfaces/QueryFilters.md b/docs/framework/svelte/reference/interfaces/QueryFilters.md new file mode 100644 index 00000000000..6b177d93aa5 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/QueryFilters.md @@ -0,0 +1,102 @@ +--- +id: QueryFilters +title: QueryFilters +--- + +Defined in: [packages/query-core/src/utils.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L31) + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extended by + +- [`InvalidateQueryFilters`](InvalidateQueryFilters.md) +- [`RefetchQueryFilters`](RefetchQueryFilters.md) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverBaseResult.md new file mode 100644 index 00000000000..2840be27e27 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/QueryObserverBaseResult.md @@ -0,0 +1,358 @@ +--- +id: QueryObserverBaseResult +title: QueryObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) + +## Extended by + +- [`QueryObserverPendingResult`](QueryObserverPendingResult.md) +- [`QueryObserverLoadingResult`](QueryObserverLoadingResult.md) +- [`QueryObserverLoadingErrorResult`](QueryObserverLoadingErrorResult.md) +- [`QueryObserverRefetchErrorResult`](QueryObserverRefetchErrorResult.md) +- [`QueryObserverSuccessResult`](QueryObserverSuccessResult.md) +- [`QueryObserverPlaceholderResult`](QueryObserverPlaceholderResult.md) +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) + +The last successfully resolved data for the query. + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +*** + +### isLoadingError + +```ts +isLoadingError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) + +Will be `true` if the query failed while fetching for the first time. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) + +Will be `true` if the data shown is the placeholder data. + +*** + +### isRefetchError + +```ts +isRefetchError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) + +Will be `true` if the query failed while refetching. + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult.md new file mode 100644 index 00000000000..97d5d5125a7 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverLoadingErrorResult +title: QueryObserverLoadingErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: true; +``` + +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverLoadingResult.md new file mode 100644 index 00000000000..1f442f18130 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/QueryObserverLoadingResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverLoadingResult +title: QueryObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L873) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: true; +``` + +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:885](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L885) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:884](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L884) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverOptions.md b/docs/framework/svelte/reference/interfaces/QueryObserverOptions.md new file mode 100644 index 00000000000..af3d0bdff26 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/QueryObserverOptions.md @@ -0,0 +1,541 @@ +--- +id: QueryObserverOptions +title: QueryObserverOptions +--- + +Defined in: [packages/query-core/src/types.ts:373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L373) + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](QueryOptions.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Extended by + +- [`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### enabled? + +```ts +optional enabled: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### placeholderData? + +```ts +optional placeholderData: + | NonFunctionGuard +| PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverPendingResult.md new file mode 100644 index 00000000000..ad040ff9cc5 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/QueryObserverPendingResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverPendingResult +title: QueryObserverPendingResult +--- + +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:862](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L862) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:864](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L864) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:866](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L866) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:865](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L865) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:869](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L869) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:870](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L870) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverPlaceholderResult.md new file mode 100644 index 00000000000..8a1ae61dee9 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/QueryObserverPlaceholderResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverPlaceholderResult +title: QueryObserverPlaceholderResult +--- + +Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: true; +``` + +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult.md new file mode 100644 index 00000000000..c8d5274697a --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverRefetchErrorResult +title: QueryObserverRefetchErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: true; +``` + +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverSuccessResult.md new file mode 100644 index 00000000000..e3c834e6c3a --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/QueryObserverSuccessResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverSuccessResult +title: QueryObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/svelte/reference/interfaces/QueryOptions.md b/docs/framework/svelte/reference/interfaces/QueryOptions.md new file mode 100644 index 00000000000..ba603a4332f --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/QueryOptions.md @@ -0,0 +1,240 @@ +--- +id: QueryOptions +title: QueryOptions +--- + +Defined in: [packages/query-core/src/types.ts:231](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L231) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +*** + +### initialData? + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +*** + +### queryFn? + +```ts +optional queryFn: + | QueryFunction + | typeof skipToken; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. diff --git a/docs/framework/svelte/reference/interfaces/QueryState.md b/docs/framework/svelte/reference/interfaces/QueryState.md new file mode 100644 index 00000000000..7dce476d743 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/QueryState.md @@ -0,0 +1,175 @@ +--- +id: QueryState +title: QueryState +--- + +Defined in: [packages/query-core/src/query.ts:52](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L52) + +The raw state stored on a `Query` instance. This is the underlying state +that observer results (e.g. `QueryObserverResult`) are derived from. + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:56](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L56) + +The last successfully resolved data for the query. + +*** + +### dataUpdateCount + +```ts +dataUpdateCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L60) + +The number of times the query has successfully resolved. + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/query.ts:64](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L64) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/query.ts:69](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L69) + +The error object for the query, if the last attempt resulted in an error. +- Defaults to `null`. + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:73](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L73) + +The sum of all errors, incremented every time the query resolves with an error. + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/query.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L77) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +*** + +### fetchFailureCount + +```ts +fetchFailureCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L83) + +The failure count for the current fetch. +- Incremented every time the fetch fails. +- Reset to `0` when the fetch succeeds. + +*** + +### fetchFailureReason + +```ts +fetchFailureReason: TError | null; +``` + +Defined in: [packages/query-core/src/query.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L88) + +The reason the current fetch failed, as reported by the retryer. +- Reset to `null` when the fetch succeeds. + +*** + +### fetchMeta + +```ts +fetchMeta: FetchMeta | null; +``` + +Defined in: [packages/query-core/src/query.ts:93](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L93) + +Metadata passed to the currently in-flight (or most recent) fetch, e.g. the +`fetchMore` direction for infinite queries. + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/query.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L112) + +The fetch status of the query. +- `fetching`: the `queryFn` is currently executing. +- `paused`: a fetch wanted to run but has been paused (see network mode). +- `idle`: the query is not fetching. + +*** + +### isInvalidated + +```ts +isInvalidated: boolean; +``` + +Defined in: [packages/query-core/src/query.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L98) + +Whether the query has been marked as invalidated via `invalidate()`. +- Reset to `false` whenever the query resolves successfully. + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/query.ts:105](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L105) + +The status of the query. +- `pending` if there's no cached data and no attempt was finished yet. +- `error` if the last attempt resulted in an error. +- `success` if the query has data. diff --git a/docs/framework/svelte/reference/interfaces/RefetchOptions.md b/docs/framework/svelte/reference/interfaces/RefetchOptions.md new file mode 100644 index 00000000000..a3db94b1674 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/RefetchOptions.md @@ -0,0 +1,45 @@ +--- +id: RefetchOptions +title: RefetchOptions +--- + +Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L679) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Extended by + +- [`InvalidateOptions`](InvalidateOptions.md) +- [`ResetOptions`](ResetOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/svelte/reference/interfaces/RefetchQueryFilters.md b/docs/framework/svelte/reference/interfaces/RefetchQueryFilters.md new file mode 100644 index 00000000000..f2b6b287875 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/RefetchQueryFilters.md @@ -0,0 +1,125 @@ +--- +id: RefetchQueryFilters +title: RefetchQueryFilters +--- + +Defined in: [packages/query-core/src/types.ts:696](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L696) + +Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. +All provided filters must match; filters that are left unspecified are ignored. + +## Extends + +- [`QueryFilters`](QueryFilters.md)\<`TQueryKey`\> + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`exact`](QueryFilters.md#exact) + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`fetchStatus`](QueryFilters.md#fetchstatus) + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`predicate`](QueryFilters.md#predicate) + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`queryKey`](QueryFilters.md#querykey) + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`stale`](QueryFilters.md#stale) + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries + +#### Inherited from + +[`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/svelte/reference/interfaces/Register.md b/docs/framework/svelte/reference/interfaces/Register.md new file mode 100644 index 00000000000..4f442442b48 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/Register.md @@ -0,0 +1,6 @@ +--- +id: Register +title: Register +--- + +Defined in: [packages/query-core/src/types.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L37) diff --git a/docs/framework/svelte/reference/interfaces/ResetOptions.md b/docs/framework/svelte/reference/interfaces/ResetOptions.md new file mode 100644 index 00000000000..bfa931717f8 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/ResetOptions.md @@ -0,0 +1,44 @@ +--- +id: ResetOptions +title: ResetOptions +--- + +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) + +## Extends + +- [`RefetchOptions`](RefetchOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`cancelRefetch`](RefetchOptions.md#cancelrefetch) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`throwOnError`](RefetchOptions.md#throwonerror) diff --git a/docs/framework/svelte/reference/interfaces/ResultOptions.md b/docs/framework/svelte/reference/interfaces/ResultOptions.md new file mode 100644 index 00000000000..dbf00d6c67e --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/ResultOptions.md @@ -0,0 +1,22 @@ +--- +id: ResultOptions +title: ResultOptions +--- + +Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) + +## Extended by + +- [`RefetchOptions`](RefetchOptions.md) +- [`FetchNextPageOptions`](FetchNextPageOptions.md) +- [`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +## Properties + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) diff --git a/docs/framework/svelte/reference/interfaces/SetDataOptions.md b/docs/framework/svelte/reference/interfaces/SetDataOptions.md new file mode 100644 index 00000000000..5fcbcfdf7cd --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/SetDataOptions.md @@ -0,0 +1,16 @@ +--- +id: SetDataOptions +title: SetDataOptions +--- + +Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1448) + +## Properties + +### updatedAt? + +```ts +optional updatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) diff --git a/docs/framework/svelte/reference/type-aliases/AnyDataTag.md b/docs/framework/svelte/reference/type-aliases/AnyDataTag.md new file mode 100644 index 00000000000..d3d5e33bb3e --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/AnyDataTag.md @@ -0,0 +1,30 @@ +--- +id: AnyDataTag +title: AnyDataTag +--- + +```ts +type AnyDataTag = object; +``` + +Defined in: [packages/query-core/src/types.ts:67](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L67) + +## Properties + +### \[dataTagErrorSymbol\] + +```ts +[dataTagErrorSymbol]: any; +``` + +Defined in: [packages/query-core/src/types.ts:69](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L69) + +*** + +### \[dataTagSymbol\] + +```ts +[dataTagSymbol]: any; +``` + +Defined in: [packages/query-core/src/types.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L68) diff --git a/docs/framework/svelte/reference/type-aliases/CreateBaseMutationResult.md b/docs/framework/svelte/reference/type-aliases/CreateBaseMutationResult.md index 458782e77ba..22f42183cda 100644 --- a/docs/framework/svelte/reference/type-aliases/CreateBaseMutationResult.md +++ b/docs/framework/svelte/reference/type-aliases/CreateBaseMutationResult.md @@ -27,7 +27,7 @@ mutateAsync: CreateMutateAsyncFunction\> +...`Parameters`\<[`MutateFunction`](MutateFunction.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> ## Returns diff --git a/docs/framework/svelte/reference/type-aliases/CreateMutationOptions.md b/docs/framework/svelte/reference/type-aliases/CreateMutationOptions.md index 4b70afeba75..690e447757a 100644 --- a/docs/framework/svelte/reference/type-aliases/CreateMutationOptions.md +++ b/docs/framework/svelte/reference/type-aliases/CreateMutationOptions.md @@ -19,7 +19,7 @@ Options for createMutation ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TVariables diff --git a/docs/framework/svelte/reference/type-aliases/CreateMutationResult.md b/docs/framework/svelte/reference/type-aliases/CreateMutationResult.md index 79bb862bec4..e91def2c93e 100644 --- a/docs/framework/svelte/reference/type-aliases/CreateMutationResult.md +++ b/docs/framework/svelte/reference/type-aliases/CreateMutationResult.md @@ -19,7 +19,7 @@ Result from createMutation ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TVariables diff --git a/docs/framework/svelte/reference/type-aliases/CreateQueryOptions.md b/docs/framework/svelte/reference/type-aliases/CreateQueryOptions.md index b11b5aa11db..f25a4fb4db0 100644 --- a/docs/framework/svelte/reference/type-aliases/CreateQueryOptions.md +++ b/docs/framework/svelte/reference/type-aliases/CreateQueryOptions.md @@ -19,7 +19,7 @@ Options for createQuery ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData @@ -27,4 +27,4 @@ Options for createQuery ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/svelte/reference/type-aliases/CreateQueryResult.md b/docs/framework/svelte/reference/type-aliases/CreateQueryResult.md index d7187e3cdd1..74cecd3f9c6 100644 --- a/docs/framework/svelte/reference/type-aliases/CreateQueryResult.md +++ b/docs/framework/svelte/reference/type-aliases/CreateQueryResult.md @@ -19,4 +19,4 @@ Result from createQuery ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/svelte/reference/type-aliases/DataTag.md b/docs/framework/svelte/reference/type-aliases/DataTag.md new file mode 100644 index 00000000000..904ca124464 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/DataTag.md @@ -0,0 +1,24 @@ +--- +id: DataTag +title: DataTag +--- + +```ts +type DataTag = TType extends AnyDataTag ? TType : TType & object; +``` + +Defined in: [packages/query-core/src/types.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L71) + +## Type Parameters + +### TType + +`TType` + +### TValue + +`TValue` + +### TError + +`TError` = [`UnsetMarker`](UnsetMarker.md) diff --git a/docs/framework/svelte/reference/type-aliases/DefaultError.md b/docs/framework/svelte/reference/type-aliases/DefaultError.md new file mode 100644 index 00000000000..da9f615482f --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/DefaultError.md @@ -0,0 +1,10 @@ +--- +id: DefaultError +title: DefaultError +--- + +```ts +type DefaultError = Register extends object ? TError : Error; +``` + +Defined in: [packages/query-core/src/types.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L45) diff --git a/docs/framework/svelte/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/svelte/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md new file mode 100644 index 00000000000..733a1a5ad75 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -0,0 +1,32 @@ +--- +id: DefaultedInfiniteQueryObserverOptions +title: DefaultedInfiniteQueryObserverOptions +--- + +```ts +type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; +``` + +Defined in: [packages/query-core/src/types.ts:538](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L538) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` diff --git a/docs/framework/svelte/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/svelte/reference/type-aliases/DefaultedQueryObserverOptions.md new file mode 100644 index 00000000000..1b4309f150c --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -0,0 +1,32 @@ +--- +id: DefaultedQueryObserverOptions +title: DefaultedQueryObserverOptions +--- + +```ts +type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; +``` + +Defined in: [packages/query-core/src/types.ts:509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L509) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/svelte/reference/type-aliases/DefinedCreateBaseQueryResult.md b/docs/framework/svelte/reference/type-aliases/DefinedCreateBaseQueryResult.md index b0cac595928..e73b278ec7a 100644 --- a/docs/framework/svelte/reference/type-aliases/DefinedCreateBaseQueryResult.md +++ b/docs/framework/svelte/reference/type-aliases/DefinedCreateBaseQueryResult.md @@ -19,4 +19,4 @@ Options for createBaseQuery with initialData ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/svelte/reference/type-aliases/DefinedCreateInfiniteQueryResult.md b/docs/framework/svelte/reference/type-aliases/DefinedCreateInfiniteQueryResult.md index add7ce8a0ec..0e07398bf67 100644 --- a/docs/framework/svelte/reference/type-aliases/DefinedCreateInfiniteQueryResult.md +++ b/docs/framework/svelte/reference/type-aliases/DefinedCreateInfiniteQueryResult.md @@ -19,4 +19,4 @@ Result from createInfiniteQuery with initialData ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/svelte/reference/type-aliases/DefinedCreateQueryResult.md b/docs/framework/svelte/reference/type-aliases/DefinedCreateQueryResult.md index 238a9d9188b..b064912ecec 100644 --- a/docs/framework/svelte/reference/type-aliases/DefinedCreateQueryResult.md +++ b/docs/framework/svelte/reference/type-aliases/DefinedCreateQueryResult.md @@ -19,4 +19,4 @@ Options for createQuery with initialData ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult.md new file mode 100644 index 00000000000..ced8e568299 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -0,0 +1,22 @@ +--- +id: DefinedInfiniteQueryObserverResult +title: DefinedInfiniteQueryObserverResult +--- + +```ts +type DefinedInfiniteQueryObserverResult = + | InfiniteQueryObserverRefetchErrorResult +| InfiniteQueryObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/svelte/reference/type-aliases/DefinedInitialDataInfiniteOptions.md b/docs/framework/svelte/reference/type-aliases/DefinedInitialDataInfiniteOptions.md index e9e635dc277..4d6b305fb5e 100644 --- a/docs/framework/svelte/reference/type-aliases/DefinedInitialDataInfiniteOptions.md +++ b/docs/framework/svelte/reference/type-aliases/DefinedInitialDataInfiniteOptions.md @@ -27,15 +27,15 @@ initialData: ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) ### TPageParam diff --git a/docs/framework/svelte/reference/type-aliases/DefinedInitialDataOptions.md b/docs/framework/svelte/reference/type-aliases/DefinedInitialDataOptions.md index 0f223ff1182..e45af352af7 100644 --- a/docs/framework/svelte/reference/type-aliases/DefinedInitialDataOptions.md +++ b/docs/framework/svelte/reference/type-aliases/DefinedInitialDataOptions.md @@ -27,7 +27,7 @@ initialData: ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData @@ -35,4 +35,4 @@ initialData: ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/svelte/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/svelte/reference/type-aliases/DefinedQueryObserverResult.md new file mode 100644 index 00000000000..7afdbfd38bc --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/DefinedQueryObserverResult.md @@ -0,0 +1,22 @@ +--- +id: DefinedQueryObserverResult +title: DefinedQueryObserverResult +--- + +```ts +type DefinedQueryObserverResult = + | QueryObserverRefetchErrorResult +| QueryObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/svelte/reference/type-aliases/DistributiveOmit.md b/docs/framework/svelte/reference/type-aliases/DistributiveOmit.md new file mode 100644 index 00000000000..33b87a5cd6e --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/DistributiveOmit.md @@ -0,0 +1,20 @@ +--- +id: DistributiveOmit +title: DistributiveOmit +--- + +```ts +type DistributiveOmit = TObject extends any ? Omit : never; +``` + +Defined in: [packages/query-core/src/types.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L14) + +## Type Parameters + +### TObject + +`TObject` + +### TKey + +`TKey` *extends* keyof `TObject` diff --git a/docs/framework/svelte/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/svelte/reference/type-aliases/EnsureInfiniteQueryDataOptions.md new file mode 100644 index 00000000000..305eef94893 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -0,0 +1,42 @@ +--- +id: EnsureInfiniteQueryDataOptions +title: EnsureInfiniteQueryDataOptions +--- + +```ts +type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; +``` + +Defined in: [packages/query-core/src/types.ts:612](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L612) + +## Type Declaration + +### ~~revalidateIfStale?~~ + +```ts +optional revalidateIfStale: boolean; +``` + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Deprecated diff --git a/docs/framework/svelte/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/svelte/reference/type-aliases/FetchInfiniteQueryOptions.md new file mode 100644 index 00000000000..1ee1470b14a --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -0,0 +1,34 @@ +--- +id: FetchInfiniteQueryOptions +title: FetchInfiniteQueryOptions +--- + +```ts +type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; +``` + +Defined in: [packages/query-core/src/types.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L656) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Deprecated diff --git a/docs/framework/svelte/reference/type-aliases/FetchStatus.md b/docs/framework/svelte/reference/type-aliases/FetchStatus.md new file mode 100644 index 00000000000..4dae9444af6 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/FetchStatus.md @@ -0,0 +1,10 @@ +--- +id: FetchStatus +title: FetchStatus +--- + +```ts +type FetchStatus = "fetching" | "paused" | "idle"; +``` + +Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) diff --git a/docs/framework/svelte/reference/type-aliases/GetNextPageParamFunction.md b/docs/framework/svelte/reference/type-aliases/GetNextPageParamFunction.md new file mode 100644 index 00000000000..81d1a1544ab --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/GetNextPageParamFunction.md @@ -0,0 +1,42 @@ +--- +id: GetNextPageParamFunction +title: GetNextPageParamFunction +--- + +```ts +type GetNextPageParamFunction = (lastPage, allPages, lastPageParam, allPageParams) => TPageParam | undefined | null; +``` + +Defined in: [packages/query-core/src/types.ts:203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L203) + +## Type Parameters + +### TPageParam + +`TPageParam` + +### TQueryFnData + +`TQueryFnData` = `unknown` + +## Parameters + +### lastPage + +`TQueryFnData` + +### allPages + +`TQueryFnData`[] + +### lastPageParam + +`TPageParam` + +### allPageParams + +`TPageParam`[] + +## Returns + +`TPageParam` \| `undefined` \| `null` diff --git a/docs/framework/svelte/reference/type-aliases/GetPreviousPageParamFunction.md b/docs/framework/svelte/reference/type-aliases/GetPreviousPageParamFunction.md new file mode 100644 index 00000000000..5a6d9b93d7e --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/GetPreviousPageParamFunction.md @@ -0,0 +1,42 @@ +--- +id: GetPreviousPageParamFunction +title: GetPreviousPageParamFunction +--- + +```ts +type GetPreviousPageParamFunction = (firstPage, allPages, firstPageParam, allPageParams) => TPageParam | undefined | null; +``` + +Defined in: [packages/query-core/src/types.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L196) + +## Type Parameters + +### TPageParam + +`TPageParam` + +### TQueryFnData + +`TQueryFnData` = `unknown` + +## Parameters + +### firstPage + +`TQueryFnData` + +### allPages + +`TQueryFnData`[] + +### firstPageParam + +`TPageParam` + +### allPageParams + +`TPageParam`[] + +## Returns + +`TPageParam` \| `undefined` \| `null` diff --git a/docs/framework/svelte/reference/type-aliases/InferDataFromTag.md b/docs/framework/svelte/reference/type-aliases/InferDataFromTag.md new file mode 100644 index 00000000000..09a15ca4b1c --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/InferDataFromTag.md @@ -0,0 +1,20 @@ +--- +id: InferDataFromTag +title: InferDataFromTag +--- + +```ts +type InferDataFromTag = TTaggedQueryKey extends DataTag ? TaggedValue : TQueryFnData; +``` + +Defined in: [packages/query-core/src/types.ts:90](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L90) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` + +### TTaggedQueryKey + +`TTaggedQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/svelte/reference/type-aliases/InferErrorFromTag.md b/docs/framework/svelte/reference/type-aliases/InferErrorFromTag.md new file mode 100644 index 00000000000..cd94e4b5c3f --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/InferErrorFromTag.md @@ -0,0 +1,20 @@ +--- +id: InferErrorFromTag +title: InferErrorFromTag +--- + +```ts +type InferErrorFromTag = TTaggedQueryKey extends DataTag ? TaggedError extends UnsetMarker ? TError : TaggedError : TError; +``` + +Defined in: [packages/query-core/src/types.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L95) + +## Type Parameters + +### TError + +`TError` + +### TTaggedQueryKey + +`TTaggedQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/svelte/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/svelte/reference/type-aliases/InfiniteQueryExecuteOptions.md new file mode 100644 index 00000000000..29c974cfddf --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -0,0 +1,32 @@ +--- +id: InfiniteQueryExecuteOptions +title: InfiniteQueryExecuteOptions +--- + +```ts +type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; +``` + +Defined in: [packages/query-core/src/types.ts:635](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L635) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` diff --git a/docs/framework/svelte/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/svelte/reference/type-aliases/InfiniteQueryObserverResult.md new file mode 100644 index 00000000000..95fda780d1d --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/InfiniteQueryObserverResult.md @@ -0,0 +1,25 @@ +--- +id: InfiniteQueryObserverResult +title: InfiniteQueryObserverResult +--- + +```ts +type InfiniteQueryObserverResult = + | DefinedInfiniteQueryObserverResult + | InfiniteQueryObserverLoadingErrorResult + | InfiniteQueryObserverLoadingResult + | InfiniteQueryObserverPendingResult +| InfiniteQueryObserverPlaceholderResult; +``` + +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/svelte/reference/type-aliases/InitialDataFunction.md b/docs/framework/svelte/reference/type-aliases/InitialDataFunction.md new file mode 100644 index 00000000000..6ba4aaabe61 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/InitialDataFunction.md @@ -0,0 +1,20 @@ +--- +id: InitialDataFunction +title: InitialDataFunction +--- + +```ts +type InitialDataFunction = () => T | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L173) + +## Type Parameters + +### T + +`T` + +## Returns + +`T` \| `undefined` diff --git a/docs/framework/svelte/reference/type-aliases/ManagedTimerId.md b/docs/framework/svelte/reference/type-aliases/ManagedTimerId.md new file mode 100644 index 00000000000..d7833e3e4f0 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/ManagedTimerId.md @@ -0,0 +1,19 @@ +--- +id: ManagedTimerId +title: ManagedTimerId +--- + +```ts +type ManagedTimerId = + | number + | { + [toPrimitive]: () => number; +}; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:17](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L17) + +Wrapping `setTimeout` is awkward from a typing perspective because platform +typings may extend the return type of `setTimeout`. For example, NodeJS +typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be +able to return such a type. diff --git a/docs/framework/svelte/reference/type-aliases/MutateFunction.md b/docs/framework/svelte/reference/type-aliases/MutateFunction.md new file mode 100644 index 00000000000..f574ca7f8ca --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/MutateFunction.md @@ -0,0 +1,38 @@ +--- +id: MutateFunction +title: MutateFunction +--- + +```ts +type MutateFunction = (...rest) => Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1258) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Parameters + +### rest + +...[`MutateFunctionRest`](MutateFunctionRest.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Returns + +`Promise`\<`TData`\> diff --git a/docs/framework/svelte/reference/type-aliases/MutateFunctionRest.md b/docs/framework/svelte/reference/type-aliases/MutateFunctionRest.md new file mode 100644 index 00000000000..aef21572aeb --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/MutateFunctionRest.md @@ -0,0 +1,28 @@ +--- +id: MutateFunctionRest +title: MutateFunctionRest +--- + +```ts +type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; +``` + +Defined in: [packages/query-core/src/types.ts:1243](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1243) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` diff --git a/docs/framework/svelte/reference/type-aliases/MutationCacheNotifyEvent.md b/docs/framework/svelte/reference/type-aliases/MutationCacheNotifyEvent.md new file mode 100644 index 00000000000..aa5e196bc72 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/MutationCacheNotifyEvent.md @@ -0,0 +1,20 @@ +--- +id: MutationCacheNotifyEvent +title: MutationCacheNotifyEvent +--- + +```ts +type MutationCacheNotifyEvent = + | NotifyEventMutationAdded + | NotifyEventMutationRemoved + | NotifyEventMutationObserverAdded + | NotifyEventMutationObserverRemoved + | NotifyEventMutationObserverOptionsUpdated + | NotifyEventMutationUpdated; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L98) + +The event passed to a `MutationCache` subscriber. Fired whenever a mutation is added or removed +from the cache, its state is updated, or one of its observers is added, removed, or has its +options updated. diff --git a/docs/framework/svelte/reference/type-aliases/MutationFunction.md b/docs/framework/svelte/reference/type-aliases/MutationFunction.md new file mode 100644 index 00000000000..e306a5f1a48 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/MutationFunction.md @@ -0,0 +1,34 @@ +--- +id: MutationFunction +title: MutationFunction +--- + +```ts +type MutationFunction = (variables, context) => Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1161](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1161) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TVariables + +`TVariables` = `unknown` + +## Parameters + +### variables + +`TVariables` + +### context + +[`MutationFunctionContext`](MutationFunctionContext.md) + +## Returns + +`Promise`\<`TData`\> diff --git a/docs/framework/svelte/reference/type-aliases/MutationFunctionContext.md b/docs/framework/svelte/reference/type-aliases/MutationFunctionContext.md new file mode 100644 index 00000000000..b29a54df298 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/MutationFunctionContext.md @@ -0,0 +1,40 @@ +--- +id: MutationFunctionContext +title: MutationFunctionContext +--- + +```ts +type MutationFunctionContext = object; +``` + +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) + +## Properties + +### client + +```ts +client: QueryClient; +``` + +Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) + +*** + +### meta + +```ts +meta: MutationMeta | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) + +*** + +### mutationKey? + +```ts +optional mutationKey: MutationKey; +``` + +Defined in: [packages/query-core/src/types.ts:1158](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1158) diff --git a/docs/framework/svelte/reference/type-aliases/MutationKey.md b/docs/framework/svelte/reference/type-aliases/MutationKey.md new file mode 100644 index 00000000000..f89c6959883 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/MutationKey.md @@ -0,0 +1,10 @@ +--- +id: MutationKey +title: MutationKey +--- + +```ts +type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; +``` + +Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) diff --git a/docs/framework/svelte/reference/type-aliases/MutationMeta.md b/docs/framework/svelte/reference/type-aliases/MutationMeta.md new file mode 100644 index 00000000000..e1d481cdcf1 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/MutationMeta.md @@ -0,0 +1,10 @@ +--- +id: MutationMeta +title: MutationMeta +--- + +```ts +type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; +``` + +Defined in: [packages/query-core/src/types.ts:1147](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1147) diff --git a/docs/framework/svelte/reference/type-aliases/MutationObserverResult.md b/docs/framework/svelte/reference/type-aliases/MutationObserverResult.md new file mode 100644 index 00000000000..cbd07f40537 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/MutationObserverResult.md @@ -0,0 +1,32 @@ +--- +id: MutationObserverResult +title: MutationObserverResult +--- + +```ts +type MutationObserverResult = + | MutationObserverIdleResult + | MutationObserverLoadingResult + | MutationObserverErrorResult +| MutationObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` diff --git a/docs/framework/svelte/reference/type-aliases/MutationScope.md b/docs/framework/svelte/reference/type-aliases/MutationScope.md new file mode 100644 index 00000000000..6ec14643477 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/MutationScope.md @@ -0,0 +1,20 @@ +--- +id: MutationScope +title: MutationScope +--- + +```ts +type MutationScope = object; +``` + +Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) + +## Properties + +### id + +```ts +id: string; +``` + +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) diff --git a/docs/framework/svelte/reference/type-aliases/MutationStateOptions.md b/docs/framework/svelte/reference/type-aliases/MutationStateOptions.md index 0b5a5f875e7..faa4070e9fc 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationStateOptions.md +++ b/docs/framework/svelte/reference/type-aliases/MutationStateOptions.md @@ -15,11 +15,11 @@ Options for useMutationState ### TResult -`TResult` = `MutationState` +`TResult` = [`MutationState`](../interfaces/MutationState.md) ### TMutation -`TMutation` *extends* `Mutation`\<`any`, `any`, `any`, `any`\> = [`MutationTypeFromResult`](MutationTypeFromResult.md)\<`TResult`\> +`TMutation` *extends* [`Mutation`](../classes/Mutation.md)\<`any`, `any`, `any`, `any`\> = [`MutationTypeFromResult`](MutationTypeFromResult.md)\<`TResult`\> ## Properties diff --git a/docs/framework/svelte/reference/type-aliases/MutationStatus.md b/docs/framework/svelte/reference/type-aliases/MutationStatus.md new file mode 100644 index 00000000000..eedf0fb979a --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/MutationStatus.md @@ -0,0 +1,10 @@ +--- +id: MutationStatus +title: MutationStatus +--- + +```ts +type MutationStatus = "idle" | "pending" | "success" | "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) diff --git a/docs/framework/svelte/reference/type-aliases/NetworkMode.md b/docs/framework/svelte/reference/type-aliases/NetworkMode.md new file mode 100644 index 00000000000..94ae0ba76ed --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/NetworkMode.md @@ -0,0 +1,10 @@ +--- +id: NetworkMode +title: NetworkMode +--- + +```ts +type NetworkMode = "online" | "always" | "offlineFirst"; +``` + +Defined in: [packages/query-core/src/types.ts:223](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L223) diff --git a/docs/framework/svelte/reference/type-aliases/NonUndefinedGuard.md b/docs/framework/svelte/reference/type-aliases/NonUndefinedGuard.md new file mode 100644 index 00000000000..4aaf208013b --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/NonUndefinedGuard.md @@ -0,0 +1,16 @@ +--- +id: NonUndefinedGuard +title: NonUndefinedGuard +--- + +```ts +type NonUndefinedGuard = T extends undefined ? never : T; +``` + +Defined in: [packages/query-core/src/types.ts:12](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L12) + +## Type Parameters + +### T + +`T` diff --git a/docs/framework/svelte/reference/type-aliases/NotifyEventType.md b/docs/framework/svelte/reference/type-aliases/NotifyEventType.md new file mode 100644 index 00000000000..7b788ced7af --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/NotifyEventType.md @@ -0,0 +1,17 @@ +--- +id: NotifyEventType +title: NotifyEventType +--- + +```ts +type NotifyEventType = + | "added" + | "removed" + | "updated" + | "observerAdded" + | "observerRemoved" + | "observerResultsUpdated" + | "observerOptionsUpdated"; +``` + +Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) diff --git a/docs/framework/svelte/reference/type-aliases/NotifyOnChangeProps.md b/docs/framework/svelte/reference/type-aliases/NotifyOnChangeProps.md new file mode 100644 index 00000000000..7de194fa10b --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/NotifyOnChangeProps.md @@ -0,0 +1,17 @@ +--- +id: NotifyOnChangeProps +title: NotifyOnChangeProps +--- + +```ts +type NotifyOnChangeProps = + | keyof InfiniteQueryObserverResult[] + | "all" + | undefined + | () => + | keyof InfiniteQueryObserverResult[] + | "all" + | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L225) diff --git a/docs/framework/svelte/reference/type-aliases/OmitKeyof.md b/docs/framework/svelte/reference/type-aliases/OmitKeyof.md new file mode 100644 index 00000000000..690a7b0a5d2 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/OmitKeyof.md @@ -0,0 +1,28 @@ +--- +id: OmitKeyof +title: OmitKeyof +--- + +```ts +type OmitKeyof = Omit; +``` + +Defined in: [packages/query-core/src/types.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L19) + +## Type Parameters + +### TObject + +`TObject` + +### TKey + +`TKey` *extends* `TStrictly` *extends* `"safely"` ? + \| keyof `TObject` + \| `string` & `Record`\<`never`, `never`\> + \| `number` & `Record`\<`never`, `never`\> + \| `symbol` & `Record`\<`never`, `never`\> : keyof `TObject` + +### TStrictly + +`TStrictly` *extends* `"strictly"` \| `"safely"` = `"strictly"` diff --git a/docs/framework/svelte/reference/type-aliases/Override.md b/docs/framework/svelte/reference/type-aliases/Override.md new file mode 100644 index 00000000000..8abcecd1e1b --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/Override.md @@ -0,0 +1,20 @@ +--- +id: Override +title: Override +--- + +```ts +type Override = { [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey] }; +``` + +Defined in: [packages/query-core/src/types.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L31) + +## Type Parameters + +### TTargetA + +`TTargetA` + +### TTargetB + +`TTargetB` diff --git a/docs/framework/svelte/reference/type-aliases/PlaceholderDataFunction.md b/docs/framework/svelte/reference/type-aliases/PlaceholderDataFunction.md new file mode 100644 index 00000000000..cd40f28b41e --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/PlaceholderDataFunction.md @@ -0,0 +1,42 @@ +--- +id: PlaceholderDataFunction +title: PlaceholderDataFunction +--- + +```ts +type PlaceholderDataFunction = (previousData, previousQuery) => TQueryData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:177](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L177) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +## Parameters + +### previousData + +`TQueryData` | `undefined` + +### previousQuery + +[`Query`](../classes/Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> | `undefined` + +## Returns + +`TQueryData` \| `undefined` diff --git a/docs/framework/svelte/reference/type-aliases/QueriesPlaceholderDataFunction.md b/docs/framework/svelte/reference/type-aliases/QueriesPlaceholderDataFunction.md new file mode 100644 index 00000000000..5d3fca8c9e0 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/QueriesPlaceholderDataFunction.md @@ -0,0 +1,30 @@ +--- +id: QueriesPlaceholderDataFunction +title: QueriesPlaceholderDataFunction +--- + +```ts +type QueriesPlaceholderDataFunction = (previousData, previousQuery) => TQueryData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L187) + +## Type Parameters + +### TQueryData + +`TQueryData` + +## Parameters + +### previousData + +`undefined` + +### previousQuery + +`undefined` + +## Returns + +`TQueryData` \| `undefined` diff --git a/docs/framework/svelte/reference/type-aliases/QueryBooleanOption.md b/docs/framework/svelte/reference/type-aliases/QueryBooleanOption.md new file mode 100644 index 00000000000..9759e3ddb42 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/QueryBooleanOption.md @@ -0,0 +1,28 @@ +--- +id: QueryBooleanOption +title: QueryBooleanOption +--- + +```ts +type QueryBooleanOption = boolean | (query) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L119) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/svelte/reference/type-aliases/QueryCacheNotifyEvent.md b/docs/framework/svelte/reference/type-aliases/QueryCacheNotifyEvent.md new file mode 100644 index 00000000000..8e52da9e279 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/QueryCacheNotifyEvent.md @@ -0,0 +1,21 @@ +--- +id: QueryCacheNotifyEvent +title: QueryCacheNotifyEvent +--- + +```ts +type QueryCacheNotifyEvent = + | NotifyEventQueryAdded + | NotifyEventQueryRemoved + | NotifyEventQueryUpdated + | NotifyEventQueryObserverAdded + | NotifyEventQueryObserverRemoved + | NotifyEventQueryObserverResultsUpdated + | NotifyEventQueryObserverOptionsUpdated; +``` + +Defined in: [packages/query-core/src/queryCache.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L84) + +The event passed to a `QueryCache` subscriber. Fired whenever a query is added or removed from +the cache, its state is updated (e.g. via `query.setState` or `queryClient.removeQueries`), or +one of its observers is added, removed, or has its results or options updated. diff --git a/docs/framework/svelte/reference/type-aliases/QueryFunction.md b/docs/framework/svelte/reference/type-aliases/QueryFunction.md new file mode 100644 index 00000000000..306367388a1 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/QueryFunction.md @@ -0,0 +1,34 @@ +--- +id: QueryFunction +title: QueryFunction +--- + +```ts +type QueryFunction = (context) => T | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L102) + +## Type Parameters + +### T + +`T` = `unknown` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Parameters + +### context + +[`QueryFunctionContext`](QueryFunctionContext.md)\<`TQueryKey`, `TPageParam`\> + +## Returns + +`T` \| `Promise`\<`T`\> diff --git a/docs/framework/svelte/reference/type-aliases/QueryFunctionContext.md b/docs/framework/svelte/reference/type-aliases/QueryFunctionContext.md new file mode 100644 index 00000000000..d2c9fe3e2b2 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/QueryFunctionContext.md @@ -0,0 +1,20 @@ +--- +id: QueryFunctionContext +title: QueryFunctionContext +--- + +```ts +type QueryFunctionContext = [TPageParam] extends [never] ? object : object; +``` + +Defined in: [packages/query-core/src/types.ts:144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L144) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` diff --git a/docs/framework/svelte/reference/type-aliases/QueryKey.md b/docs/framework/svelte/reference/type-aliases/QueryKey.md new file mode 100644 index 00000000000..1a3f34cde18 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/QueryKey.md @@ -0,0 +1,10 @@ +--- +id: QueryKey +title: QueryKey +--- + +```ts +type QueryKey = Register extends object ? TQueryKey extends ReadonlyArray ? TQueryKey : TQueryKey extends unknown[] ? TQueryKey : ReadonlyArray : ReadonlyArray; +``` + +Defined in: [packages/query-core/src/types.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L51) diff --git a/docs/framework/svelte/reference/type-aliases/QueryKeyHashFunction.md b/docs/framework/svelte/reference/type-aliases/QueryKeyHashFunction.md new file mode 100644 index 00000000000..feda96373cc --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/QueryKeyHashFunction.md @@ -0,0 +1,26 @@ +--- +id: QueryKeyHashFunction +title: QueryKeyHashFunction +--- + +```ts +type QueryKeyHashFunction = (queryKey) => string; +``` + +Defined in: [packages/query-core/src/types.ts:192](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L192) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) + +## Parameters + +### queryKey + +`TQueryKey` + +## Returns + +`string` diff --git a/docs/framework/svelte/reference/type-aliases/QueryKeyWithDataTag.md b/docs/framework/svelte/reference/type-aliases/QueryKeyWithDataTag.md new file mode 100644 index 00000000000..6613f74be9e --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/QueryKeyWithDataTag.md @@ -0,0 +1,34 @@ +--- +id: QueryKeyWithDataTag +title: QueryKeyWithDataTag +--- + +```ts +type QueryKeyWithDataTag = object; +``` + +Defined in: [packages/query-core/src/types.ts:82](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L82) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +## Properties + +### queryKey + +```ts +queryKey: DataTag; +``` + +Defined in: [packages/query-core/src/types.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L87) diff --git a/docs/framework/svelte/reference/type-aliases/QueryMeta.md b/docs/framework/svelte/reference/type-aliases/QueryMeta.md new file mode 100644 index 00000000000..c12917b2cce --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/QueryMeta.md @@ -0,0 +1,10 @@ +--- +id: QueryMeta +title: QueryMeta +--- + +```ts +type QueryMeta = Register extends object ? TQueryMeta extends Record ? TQueryMeta : Record : Record; +``` + +Defined in: [packages/query-core/src/types.ts:215](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L215) diff --git a/docs/framework/svelte/reference/type-aliases/QueryObserverResult.md b/docs/framework/svelte/reference/type-aliases/QueryObserverResult.md new file mode 100644 index 00000000000..f6c4118a978 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/QueryObserverResult.md @@ -0,0 +1,25 @@ +--- +id: QueryObserverResult +title: QueryObserverResult +--- + +```ts +type QueryObserverResult = + | DefinedQueryObserverResult + | QueryObserverLoadingErrorResult + | QueryObserverLoadingResult + | QueryObserverPendingResult +| QueryObserverPlaceholderResult; +``` + +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/svelte/reference/type-aliases/QueryPersister.md b/docs/framework/svelte/reference/type-aliases/QueryPersister.md new file mode 100644 index 00000000000..72e80165b0d --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/QueryPersister.md @@ -0,0 +1,24 @@ +--- +id: QueryPersister +title: QueryPersister +--- + +```ts +type QueryPersister = [TPageParam] extends [never] ? (queryFn, context, query) => T | Promise : (queryFn, context, query) => T | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L128) + +## Type Parameters + +### T + +`T` = `unknown` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` diff --git a/docs/framework/svelte/reference/type-aliases/QueryStatus.md b/docs/framework/svelte/reference/type-aliases/QueryStatus.md new file mode 100644 index 00000000000..ed6059e03ec --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/QueryStatus.md @@ -0,0 +1,10 @@ +--- +id: QueryStatus +title: QueryStatus +--- + +```ts +type QueryStatus = "pending" | "error" | "success"; +``` + +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) diff --git a/docs/framework/svelte/reference/type-aliases/SkipToken.md b/docs/framework/svelte/reference/type-aliases/SkipToken.md new file mode 100644 index 00000000000..176c23830d2 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/SkipToken.md @@ -0,0 +1,12 @@ +--- +id: SkipToken +title: SkipToken +--- + +```ts +type SkipToken = typeof skipToken; +``` + +Defined in: [packages/query-core/src/utils.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L524) + +The type of the [skipToken](../variables/skipToken.md) sentinel value. diff --git a/docs/framework/svelte/reference/type-aliases/StaleTime.md b/docs/framework/svelte/reference/type-aliases/StaleTime.md new file mode 100644 index 00000000000..3e7e21608be --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/StaleTime.md @@ -0,0 +1,10 @@ +--- +id: StaleTime +title: StaleTime +--- + +```ts +type StaleTime = number | "static"; +``` + +Defined in: [packages/query-core/src/types.ts:108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L108) diff --git a/docs/framework/svelte/reference/type-aliases/StaleTimeFunction.md b/docs/framework/svelte/reference/type-aliases/StaleTimeFunction.md new file mode 100644 index 00000000000..b1c541fa64e --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/StaleTimeFunction.md @@ -0,0 +1,28 @@ +--- +id: StaleTimeFunction +title: StaleTimeFunction +--- + +```ts +type StaleTimeFunction = StaleTime | (query) => StaleTime; +``` + +Defined in: [packages/query-core/src/types.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L110) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/svelte/reference/type-aliases/ThrowOnError.md b/docs/framework/svelte/reference/type-aliases/ThrowOnError.md new file mode 100644 index 00000000000..60ad44c1cd1 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/ThrowOnError.md @@ -0,0 +1,28 @@ +--- +id: ThrowOnError +title: ThrowOnError +--- + +```ts +type ThrowOnError = boolean | (error, query) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L361) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` + +### TError + +`TError` + +### TQueryData + +`TQueryData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/svelte/reference/type-aliases/TimeoutCallback.md b/docs/framework/svelte/reference/type-aliases/TimeoutCallback.md new file mode 100644 index 00000000000..387fb1238f3 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/TimeoutCallback.md @@ -0,0 +1,27 @@ +--- +id: TimeoutCallback +title: TimeoutCallback +--- + +```ts +type TimeoutCallback = (_) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:9](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L9) + +TimeoutManager does not support passing arguments to the callback. + +`(_: void)` is the argument type inferred by TypeScript's default typings for +`setTimeout(cb, number)`. +If we don't accept a single void argument, then +`new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. + +## Parameters + +### \_ + +`void` + +## Returns + +`void` diff --git a/docs/framework/svelte/reference/type-aliases/TimeoutProvider.md b/docs/framework/svelte/reference/type-aliases/TimeoutProvider.md new file mode 100644 index 00000000000..6416fe4c557 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/TimeoutProvider.md @@ -0,0 +1,106 @@ +--- +id: TimeoutProvider +title: TimeoutProvider +--- + +```ts +type TimeoutProvider = object; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:22](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L22) + +Backend for timer functions. + +## Type Parameters + +### TTimerId + +`TTimerId` *extends* [`ManagedTimerId`](ManagedTimerId.md) = [`ManagedTimerId`](ManagedTimerId.md) + +## Properties + +### clearInterval() + +```ts +readonly clearInterval: (intervalId) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) + +#### Parameters + +##### intervalId + +`TTimerId` | `undefined` + +#### Returns + +`void` + +*** + +### clearTimeout() + +```ts +readonly clearTimeout: (timeoutId) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L25) + +#### Parameters + +##### timeoutId + +`TTimerId` | `undefined` + +#### Returns + +`void` + +*** + +### setInterval() + +```ts +readonly setInterval: (callback, delay) => TTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L27) + +#### Parameters + +##### callback + +[`TimeoutCallback`](TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +`TTimerId` + +*** + +### setTimeout() + +```ts +readonly setTimeout: (callback, delay) => TTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L24) + +#### Parameters + +##### callback + +[`TimeoutCallback`](TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +`TTimerId` diff --git a/docs/framework/svelte/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md b/docs/framework/svelte/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md index a51304370d2..a0d8c1907d6 100644 --- a/docs/framework/svelte/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md +++ b/docs/framework/svelte/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md @@ -27,15 +27,15 @@ optional initialData: ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) ### TPageParam diff --git a/docs/framework/svelte/reference/type-aliases/UndefinedInitialDataOptions.md b/docs/framework/svelte/reference/type-aliases/UndefinedInitialDataOptions.md index 7f974342fb6..dd7717c4716 100644 --- a/docs/framework/svelte/reference/type-aliases/UndefinedInitialDataOptions.md +++ b/docs/framework/svelte/reference/type-aliases/UndefinedInitialDataOptions.md @@ -25,7 +25,7 @@ optional initialData: InitialDataFunction>; ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData @@ -33,4 +33,4 @@ optional initialData: InitialDataFunction>; ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/svelte/reference/type-aliases/UnsetMarker.md b/docs/framework/svelte/reference/type-aliases/UnsetMarker.md new file mode 100644 index 00000000000..8b9c14e1907 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/UnsetMarker.md @@ -0,0 +1,10 @@ +--- +id: UnsetMarker +title: UnsetMarker +--- + +```ts +type UnsetMarker = typeof unsetMarker; +``` + +Defined in: [packages/query-core/src/types.ts:66](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L66) diff --git a/docs/framework/svelte/reference/type-aliases/Updater.md b/docs/framework/svelte/reference/type-aliases/Updater.md new file mode 100644 index 00000000000..b6a29ccc5fc --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/Updater.md @@ -0,0 +1,35 @@ +--- +id: Updater +title: Updater +--- + +```ts +type Updater = TOutput | (input) => TOutput; +``` + +Defined in: [packages/query-core/src/utils.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L103) + +Either a plain value of type `TOutput`, or a function that receives `TInput` and returns `TOutput`. +Used for example by `setQueryData`-style updaters, which accept either the new data directly or a +function that computes it from the previous data. See functionalUpdate. + +## Type Parameters + +### TInput + +`TInput` + +### TOutput + +`TOutput` + +## Example + +```ts +queryClient.setQueryData(['posts'], newPosts) + +// Or, using an updater function that receives the current data: +queryClient.setQueryData(['posts'], (oldPosts) => + oldPosts ? [...oldPosts, newPost] : oldPosts, +) +``` diff --git a/docs/framework/svelte/reference/type-aliases/WithRequired.md b/docs/framework/svelte/reference/type-aliases/WithRequired.md new file mode 100644 index 00000000000..c8ef831db3c --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/WithRequired.md @@ -0,0 +1,20 @@ +--- +id: WithRequired +title: WithRequired +--- + +```ts +type WithRequired = TTarget & { [_ in TKey]: {} }; +``` + +Defined in: [packages/query-core/src/types.ts:505](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L505) + +## Type Parameters + +### TTarget + +`TTarget` + +### TKey + +`TKey` *extends* keyof `TTarget` diff --git a/docs/framework/svelte/reference/type-aliases/dataTagErrorSymbol.md b/docs/framework/svelte/reference/type-aliases/dataTagErrorSymbol.md new file mode 100644 index 00000000000..26148a94d6e --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/dataTagErrorSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagErrorSymbol +title: dataTagErrorSymbol +--- + +```ts +type dataTagErrorSymbol = typeof dataTagErrorSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:63](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L63) diff --git a/docs/framework/svelte/reference/type-aliases/dataTagSymbol.md b/docs/framework/svelte/reference/type-aliases/dataTagSymbol.md new file mode 100644 index 00000000000..0012c108cc5 --- /dev/null +++ b/docs/framework/svelte/reference/type-aliases/dataTagSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagSymbol +title: dataTagSymbol +--- + +```ts +type dataTagSymbol = typeof dataTagSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L61) diff --git a/docs/framework/svelte/reference/variables/dataTagErrorSymbol.md b/docs/framework/svelte/reference/variables/dataTagErrorSymbol.md new file mode 100644 index 00000000000..20bab62fb01 --- /dev/null +++ b/docs/framework/svelte/reference/variables/dataTagErrorSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagErrorSymbol +title: dataTagErrorSymbol +--- + +```ts +const dataTagErrorSymbol: typeof dataTagErrorSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:63](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L63) diff --git a/docs/framework/svelte/reference/variables/dataTagSymbol.md b/docs/framework/svelte/reference/variables/dataTagSymbol.md new file mode 100644 index 00000000000..83dd68a56e9 --- /dev/null +++ b/docs/framework/svelte/reference/variables/dataTagSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagSymbol +title: dataTagSymbol +--- + +```ts +const dataTagSymbol: typeof dataTagSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L61) diff --git a/docs/framework/svelte/reference/variables/defaultScheduler.md b/docs/framework/svelte/reference/variables/defaultScheduler.md new file mode 100644 index 00000000000..70e14d3f846 --- /dev/null +++ b/docs/framework/svelte/reference/variables/defaultScheduler.md @@ -0,0 +1,13 @@ +--- +id: defaultScheduler +title: defaultScheduler +--- + +```ts +const defaultScheduler: ScheduleFunction = systemSetTimeoutZero; +``` + +Defined in: [packages/query-core/src/notifyManager.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L19) + +Default scheduling function used by the notify manager. +Schedules the callback with the system's `setTimeout(callback, 0)`. diff --git a/docs/framework/svelte/reference/variables/environmentManager.md b/docs/framework/svelte/reference/variables/environmentManager.md new file mode 100644 index 00000000000..caa1d70b2b6 --- /dev/null +++ b/docs/framework/svelte/reference/variables/environmentManager.md @@ -0,0 +1,44 @@ +--- +id: environmentManager +title: environmentManager +--- + +```ts +const environmentManager: object; +``` + +Defined in: [packages/query-core/src/environmentManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L15) + +Manages environment detection used by TanStack Query internals. + +## Type Declaration + +### isServer() + +```ts +isServer: () => boolean; +``` + +Returns whether the current runtime should be treated as a server environment. + +#### Returns + +`boolean` + +### setIsServer() + +```ts +setIsServer(isServerValue): void; +``` + +Overrides the server check globally. + +#### Parameters + +##### isServerValue + +`IsServerValue` + +#### Returns + +`void` diff --git a/docs/framework/svelte/reference/variables/focusManager.md b/docs/framework/svelte/reference/variables/focusManager.md new file mode 100644 index 00000000000..cbf7fcb4a17 --- /dev/null +++ b/docs/framework/svelte/reference/variables/focusManager.md @@ -0,0 +1,12 @@ +--- +id: focusManager +title: focusManager +--- + +```ts +const focusManager: FocusManager; +``` + +Defined in: [packages/query-core/src/focusManager.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L142) + +Singleton instance of FocusManager, used to manage and observe the focus state within TanStack Query. diff --git a/docs/framework/svelte/reference/variables/isServer.md b/docs/framework/svelte/reference/variables/isServer.md new file mode 100644 index 00000000000..28956d55cbf --- /dev/null +++ b/docs/framework/svelte/reference/variables/isServer.md @@ -0,0 +1,14 @@ +--- +id: isServer +title: isServer +--- + +```ts +const isServer: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L112) + +## Deprecated + +use `environmentManager.isServer()` instead. diff --git a/docs/framework/svelte/reference/variables/notifyManager.md b/docs/framework/svelte/reference/variables/notifyManager.md new file mode 100644 index 00000000000..e5ecca8df60 --- /dev/null +++ b/docs/framework/svelte/reference/variables/notifyManager.md @@ -0,0 +1,156 @@ +--- +id: notifyManager +title: notifyManager +--- + +```ts +const notifyManager: object; +``` + +Defined in: [packages/query-core/src/notifyManager.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L135) + +Handles scheduling and batching callbacks in TanStack Query. + +## Type Declaration + +### batch() + +```ts +readonly batch: (callback) => T; +``` + +Batches all updates scheduled inside the passed callback. +This is mainly used internally to optimize query client updating. +Batches can be nested; the queue is only flushed once the outermost `batch` call finishes. +The return value of `callback` is passed through. + +#### Type Parameters + +##### T + +`T` + +#### Parameters + +##### callback + +() => `T` + +#### Returns + +`T` + +### batchCalls() + +```ts +readonly batchCalls: (callback) => BatchCallsCallback; +``` + +All calls to the wrapped function will be batched. + +#### Type Parameters + +##### T + +`T` *extends* `unknown`[] + +#### Parameters + +##### callback + +`BatchCallsCallback`\<`T`\> + +#### Returns + +`BatchCallsCallback`\<`T`\> + +### schedule() + +```ts +schedule: (callback) => void; +``` + +Schedules a function to be run on the next batch. +By default, the batch is run with a `setTimeout`, but this can be configured via `setScheduler`. + +#### Parameters + +##### callback + +`NotifyCallback` + +#### Returns + +`void` + +### setBatchNotifyFunction() + +```ts +readonly setBatchNotifyFunction: (fn) => void; +``` + +Use this method to set a custom function to batch notifications together into a single tick. +By default React Query will use the batch function provided by ReactDOM or React Native. + +#### Parameters + +##### fn + +`BatchNotifyFunction` + +#### Returns + +`void` + +### setNotifyFunction() + +```ts +readonly setNotifyFunction: (fn) => void; +``` + +Use this method to set a custom notify function. +This can be used to for example wrap notifications with `React.act` while running tests. + +#### Parameters + +##### fn + +`NotifyFunction` + +#### Returns + +`void` + +### setScheduler() + +```ts +readonly setScheduler: (fn) => void; +``` + +Configures a custom callback that schedules when the next batch runs. +The default behavior is `setTimeout(callback, 0)`. + +#### Parameters + +##### fn + +`ScheduleFunction` + +#### Returns + +`void` + +#### Example + +```ts +import { notifyManager } from '@tanstack/query-core' + +// Schedule batches in the next microtask +notifyManager.setScheduler(queueMicrotask) + +// Schedule batches before the next frame is rendered +notifyManager.setScheduler(requestAnimationFrame) + +// Schedule batches some time in the future +notifyManager.setScheduler((cb) => setTimeout(cb, 10)) +``` diff --git a/docs/framework/svelte/reference/variables/onlineManager.md b/docs/framework/svelte/reference/variables/onlineManager.md new file mode 100644 index 00000000000..4ae083f245b --- /dev/null +++ b/docs/framework/svelte/reference/variables/onlineManager.md @@ -0,0 +1,12 @@ +--- +id: onlineManager +title: onlineManager +--- + +```ts +const onlineManager: OnlineManager; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L117) + +Singleton instance of OnlineManager, used to manage and observe the online state within TanStack Query. diff --git a/docs/framework/svelte/reference/variables/skipToken.md b/docs/framework/svelte/reference/variables/skipToken.md new file mode 100644 index 00000000000..3163e91c1c2 --- /dev/null +++ b/docs/framework/svelte/reference/variables/skipToken.md @@ -0,0 +1,23 @@ +--- +id: skipToken +title: skipToken +--- + +```ts +const skipToken: typeof skipToken; +``` + +Defined in: [packages/query-core/src/utils.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L520) + +Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent +to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`, +a query disabled via `skipToken` cannot be triggered with `refetch`. + +## Example + +```ts +new QueryObserver(queryClient, { + queryKey: ['post', postId], + queryFn: postId != null ? () => fetchPost(postId) : skipToken, +}) +``` diff --git a/docs/framework/svelte/reference/variables/timeoutManager.md b/docs/framework/svelte/reference/variables/timeoutManager.md new file mode 100644 index 00000000000..2dcfa29b55a --- /dev/null +++ b/docs/framework/svelte/reference/variables/timeoutManager.md @@ -0,0 +1,12 @@ +--- +id: timeoutManager +title: timeoutManager +--- + +```ts +const timeoutManager: TimeoutManager; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:226](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L226) + +Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/svelte/reference/variables/unsetMarker.md b/docs/framework/svelte/reference/variables/unsetMarker.md new file mode 100644 index 00000000000..d19ee65b38e --- /dev/null +++ b/docs/framework/svelte/reference/variables/unsetMarker.md @@ -0,0 +1,10 @@ +--- +id: unsetMarker +title: unsetMarker +--- + +```ts +const unsetMarker: typeof unsetMarker; +``` + +Defined in: [packages/query-core/src/types.ts:65](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L65) diff --git a/docs/framework/vue/reference/classes/CancelledError.md b/docs/framework/vue/reference/classes/CancelledError.md new file mode 100644 index 00000000000..7fded5da20f --- /dev/null +++ b/docs/framework/vue/reference/classes/CancelledError.md @@ -0,0 +1,273 @@ +--- +id: CancelledError +title: CancelledError +--- + +Defined in: [packages/query-core/src/retryer.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L77) + +The error thrown by a `Retryer` (and surfaced to `query.promise`/`mutation`) when a fetch is cancelled, e.g. via +`query.cancel()`. `revert`, if `true`, tells the caller to restore the state the query was in before the fetch +started instead of surfacing the error. `silent`, if `true`, tells the caller to suppress this error and instead +resolve with the promise of the fetch that triggered the cancellation. + +## Example + +```ts +query.cancel() + +try { + await query.promise +} catch (error) { + if (error instanceof CancelledError) { + // the fetch was cancelled, e.g. via `query.cancel()` + } +} +``` + +## Extends + +- `Error` + +## Constructors + +### Constructor + +```ts +new CancelledError(options?): CancelledError; +``` + +Defined in: [packages/query-core/src/retryer.ts:80](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L80) + +#### Parameters + +##### options? + +[`CancelOptions`](../interfaces/CancelOptions.md) + +#### Returns + +`CancelledError` + +#### Overrides + +```ts +Error.constructor +``` + +## Properties + +### cause? + +```ts +optional cause: unknown; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24 + +#### Inherited from + +```ts +Error.cause +``` + +*** + +### message + +```ts +message: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 + +#### Inherited from + +```ts +Error.message +``` + +*** + +### name + +```ts +name: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 + +#### Inherited from + +```ts +Error.name +``` + +*** + +### revert? + +```ts +optional revert: boolean; +``` + +Defined in: [packages/query-core/src/retryer.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L78) + +*** + +### silent? + +```ts +optional silent: boolean; +``` + +Defined in: [packages/query-core/src/retryer.ts:79](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L79) + +*** + +### stack? + +```ts +optional stack: string; +``` + +Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 + +#### Inherited from + +```ts +Error.stack +``` + +*** + +### stackTraceLimit + +```ts +static stackTraceLimit: number; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:68 + +The `Error.stackTraceLimit` property specifies the number of stack frames +collected by a stack trace (whether generated by `new Error().stack` or +`Error.captureStackTrace(obj)`). + +The default value is `10` but may be set to any valid JavaScript number. Changes +will affect any stack trace captured _after_ the value has been changed. + +If set to a non-number value, or set to a negative number, stack traces will +not capture any frames. + +#### Inherited from + +```ts +Error.stackTraceLimit +``` + +## Methods + +### captureStackTrace() + +```ts +static captureStackTrace(targetObject, constructorOpt?): void; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:52 + +Creates a `.stack` property on `targetObject`, which when accessed returns +a string representing the location in the code at which +`Error.captureStackTrace()` was called. + +```js +const myObject = {}; +Error.captureStackTrace(myObject); +myObject.stack; // Similar to `new Error().stack` +``` + +The first line of the trace will be prefixed with +`${myObject.name}: ${myObject.message}`. + +The optional `constructorOpt` argument accepts a function. If given, all frames +above `constructorOpt`, including `constructorOpt`, will be omitted from the +generated stack trace. + +The `constructorOpt` argument is useful for hiding implementation +details of error generation from the user. For instance: + +```js +function a() { + b(); +} + +function b() { + c(); +} + +function c() { + // Create an error without stack trace to avoid calculating the stack trace twice. + const { stackTraceLimit } = Error; + Error.stackTraceLimit = 0; + const error = new Error(); + Error.stackTraceLimit = stackTraceLimit; + + // Capture the stack trace above function b + Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace + throw error; +} + +a(); +``` + +#### Parameters + +##### targetObject + +`object` + +##### constructorOpt? + +`Function` + +#### Returns + +`void` + +#### Inherited from + +```ts +Error.captureStackTrace +``` + +*** + +### prepareStackTrace() + +```ts +static prepareStackTrace(err, stackTraces): any; +``` + +Defined in: node\_modules/.pnpm/@types+node@22.19.15/node\_modules/@types/node/globals.d.ts:56 + +#### Parameters + +##### err + +`Error` + +##### stackTraces + +`CallSite`[] + +#### Returns + +`any` + +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +```ts +Error.prepareStackTrace +``` diff --git a/docs/framework/vue/reference/classes/InfiniteQueryObserver.md b/docs/framework/vue/reference/classes/InfiniteQueryObserver.md new file mode 100644 index 00000000000..fdc87755e8a --- /dev/null +++ b/docs/framework/vue/reference/classes/InfiniteQueryObserver.md @@ -0,0 +1,665 @@ +--- +id: InfiniteQueryObserver +title: InfiniteQueryObserver +--- + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L41) + +An `InfiniteQueryObserver` extends `QueryObserver` to observe and switch +between infinite queries. It augments the base `QueryObserverResult` with +infinite-query-specific fields and methods, such as `hasNextPage` and +`fetchNextPage`, and is the primitive that framework adapters (e.g. +`useInfiniteQuery`) build their hooks on top of. + +## Example + +```ts +const observer = new InfiniteQueryObserver(queryClient, { + queryKey: ['projects'], + queryFn: ({ pageParam }) => fetchProjects(pageParam), + initialPageParam: 0, + getNextPageParam: (lastPage) => lastPage.nextCursor, +}) + +const unsubscribe = observer.subscribe((result) => console.log(result)) +``` + +## Extends + +- [`QueryObserver`](QueryObserver.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Constructors + +### Constructor + +```ts +new InfiniteQueryObserver(client, options): InfiniteQueryObserver; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L83) + +#### Parameters + +##### client + +`QueryClient` + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`InfiniteQueryObserver`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`constructor`](QueryObserver.md#constructor) + +## Properties + +### fetch + +```ts +protected fetch: ReplaceReturnType<(fetchOptions) => Promise>, Promise>>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:72](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L72) + +#### Overrides + +```ts +QueryObserver.fetch +``` + +*** + +### getCurrentResult + +```ts +getCurrentResult: ReplaceReturnType<() => QueryObserverResult, InfiniteQueryObserverResult>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L60) + +Returns the most recently computed `QueryObserverResult` for the +observed query. This is a point-in-time read; to be notified of updates +as they happen, subscribe to the observer instead (its inherited +`subscribe` method). + +#### Example + +```ts +const result = observer.getCurrentResult() +console.log(result.status, result.data) +``` + +#### Overrides + +```ts +QueryObserver.getCurrentResult +``` + +*** + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`listeners`](QueryObserver.md#listeners) + +*** + +### options + +```ts +options: QueryObserverOptions, TQueryKey>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L89) + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`options`](QueryObserver.md#options) + +*** + +### subscribe() + +```ts +subscribe: (listener) => () => void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L55) + +#### Parameters + +##### listener + +`InfiniteQueryObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Overrides + +```ts +QueryObserver.subscribe +``` + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L96) + +#### Returns + +`void` + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`bindMethods`](QueryObserver.md#bindmethods) + +*** + +### createResult() + +```ts +protected createResult(query, options): InfiniteQueryObserverResult; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:201](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L201) + +#### Parameters + +##### query + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`createResult`](QueryObserver.md#createresult) + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L161) + +Stops observing the current query: clears all listeners, cancels the +stale and refetch-interval timers, and removes this observer from the +query it was observing. + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`destroy`](QueryObserver.md#destroy) + +*** + +### fetchNextPage() + +```ts +fetchNextPage(options?): Promise>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L161) + +Fetches the next page of the infinite query and returns a promise that +resolves with the resulting `InfiniteQueryObserverResult`. The page +param used for the fetch is determined by `getNextPageParam`, which +receives the current pages/page params and whose result also determines +`hasNextPage`. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](../interfaces/FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const { hasNextPage } = observer.getCurrentResult() + +if (hasNextPage) { + await observer.fetchNextPage() +} +``` + +#### See + +[InfiniteQueryObserver#fetchPreviousPage](#fetchpreviouspage) + +*** + +### fetchOptimistic() + +```ts +fetchOptimistic(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:395](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L395) + +Fetches a query defined by the given options without affecting this +observer's own tracked query or result, and returns a promise that +resolves with the `QueryObserverResult` for that fetch. This is useful +for prefetching data that another observer (e.g. a query about to be +navigated to) will need, ahead of time. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.fetchOptimistic({ + queryKey: ['posts', 2], + queryFn: () => fetchPost(2), +}) +console.log(result.data) +``` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`fetchOptimistic`](QueryObserver.md#fetchoptimistic) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage(options?): Promise>; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:190](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L190) + +Fetches the previous page of the infinite query and returns a promise +that resolves with the resulting `InfiniteQueryObserverResult`. The page +param used for the fetch is determined by `getPreviousPageParam`, which +receives the current pages/page params and whose result also determines +`hasPreviousPage`. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](../interfaces/FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const { hasPreviousPage } = observer.getCurrentResult() + +if (hasPreviousPage) { + await observer.fetchPreviousPage() +} +``` + +#### See + +[InfiniteQueryObserver#fetchNextPage](#fetchnextpage) + +*** + +### getCurrentQuery() + +```ts +getCurrentQuery(): Query, TQueryKey>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:357](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L357) + +Returns the `Query` instance this observer is currently observing. + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`getCurrentQuery`](QueryObserver.md#getcurrentquery) + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(options): InfiniteQueryObserverResult; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L127) + +The infinite-query counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult), marking the +options as an infinite query before delegating to it. Called by framework adapters (e.g. +`useInfiniteQuery`) ahead of subscribing, to compute the current `InfiniteQueryObserverResult` +synchronously. + +#### Parameters + +##### options + +[`DefaultedInfiniteQueryObserverOptions`](../type-aliases/DefaultedInfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\> + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`getOptimisticResult`](QueryObserver.md#getoptimisticresult) + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`hasListeners`](QueryObserver.md#haslisteners) + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L110) + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`onSubscribe`](QueryObserver.md#onsubscribe) + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L124) + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`onUnsubscribe`](QueryObserver.md#onunsubscribe) + +*** + +### refetch() + +```ts +refetch(__namedParameters): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L371) + +Refetches the observed query and returns a promise that resolves with +the resulting `QueryObserverResult`. + +#### Parameters + +##### \_\_namedParameters + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.refetch({ cancelRefetch: false }) +console.log(result.data) +``` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`refetch`](QueryObserver.md#refetch) + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:108](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L108) + +Updates the observer's options. Behaves the same as +`QueryObserver.setOptions`, additionally marking the options as +belonging to an infinite query before delegating to the base +implementation. + +#### Parameters + +##### options + +[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`void` + +#### Overrides + +[`QueryObserver`](QueryObserver.md).[`setOptions`](QueryObserver.md#setoptions) + +*** + +### shouldFetchOnReconnect() + +```ts +shouldFetchOnReconnect(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L135) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnReconnect` option) to refetch when the network +reconnects. + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`shouldFetchOnReconnect`](QueryObserver.md#shouldfetchonreconnect) + +*** + +### shouldFetchOnWindowFocus() + +```ts +shouldFetchOnWindowFocus(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L148) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnWindowFocus` option) to refetch when the window +regains focus. + +#### Returns + +`boolean` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`shouldFetchOnWindowFocus`](QueryObserver.md#shouldfetchonwindowfocus) + +*** + +### trackProp() + +```ts +trackProp(key): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:350](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L350) + +Records that the given `QueryObserverResult` property was read, so a subsequent update only +notifies this observer if a tracked property actually changed. Normally called indirectly via +[QueryObserver#trackResult](QueryObserver.md#trackresult)'s proxy; exposed directly for adapters that track property +access themselves (e.g. through their own reactivity system) instead of via the proxy. + +#### Parameters + +##### key + +`"error"` | `"data"` | `"isError"` | `"isPending"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isSuccess"` | `"isPlaceholderData"` | `"status"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`trackProp`](QueryObserver.md#trackprop) + +*** + +### trackResult() + +```ts +trackResult(result, onPropTracked?): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:331](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L331) + +Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via +[QueryObserver#trackProp](QueryObserver.md#trackprop) (and an optional `onPropTracked` callback). Used by framework +adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on +properties you actually read" behavior. + +#### Parameters + +##### result + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +##### onPropTracked? + +(`key`) => `void` + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`trackResult`](QueryObserver.md#trackresult) + +*** + +### updateResult() + +```ts +updateResult(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L735) + +Recomputes and stores the current result from the current query/options, notifying listeners +if it changed. Framework adapters call this right after subscribing to make sure no query +update was missed in the gap between creating the observer and subscribing to it. + +#### Returns + +`void` + +#### Inherited from + +[`QueryObserver`](QueryObserver.md).[`updateResult`](QueryObserver.md#updateresult) diff --git a/docs/framework/vue/reference/classes/Mutation.md b/docs/framework/vue/reference/classes/Mutation.md new file mode 100644 index 00000000000..4e85a5b2d4c --- /dev/null +++ b/docs/framework/vue/reference/classes/Mutation.md @@ -0,0 +1,329 @@ +--- +id: Mutation +title: Mutation +--- + +Defined in: [packages/query-core/src/mutation.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L135) + +Represents a single mutation attempt. A `Mutation` holds the mutation's +options, state (data/error/status), and the `MutationObserver`s currently +subscribed to it. + +Instances are created and managed internally by `MutationCache`; application +code typically interacts with mutations indirectly through `QueryClient` or +a framework hook like `useMutation`. Direct access to a `Mutation` instance +is possible via `mutationCache.find()`/`getAll()` for inspecting cache state. + +## Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +``` + +## Extends + +- `Removable` + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Constructors + +### Constructor + +```ts +new Mutation(config): Mutation; +``` + +Defined in: [packages/query-core/src/mutation.ts:152](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L152) + +#### Parameters + +##### config + +`MutationConfig`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`Mutation`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Overrides + +```ts +Removable.constructor +``` + +## Properties + +### gcTime + +```ts +gcTime: number; +``` + +Defined in: [packages/query-core/src/removable.ts:7](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L7) + +#### Inherited from + +```ts +Removable.gcTime +``` + +*** + +### mutationId + +```ts +readonly mutationId: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:143](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L143) + +*** + +### options + +```ts +options: MutationOptions; +``` + +Defined in: [packages/query-core/src/mutation.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L142) + +*** + +### state + +```ts +state: MutationState; +``` + +Defined in: [packages/query-core/src/mutation.ts:141](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L141) + +## Accessors + +### meta + +#### Get Signature + +```ts +get meta(): Record | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:179](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L179) + +The `meta` object passed in the mutation's options, if any. + +##### Returns + +`Record`\<`string`, `unknown`\> \| `undefined` + +## Methods + +### clearGcTimeout() + +```ts +protected clearGcTimeout(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L32) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.clearGcTimeout +``` + +*** + +### continue() + +```ts +continue(): Promise; +``` + +Defined in: [packages/query-core/src/mutation.ts:243](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L243) + +Resumes a mutation that is currently paused or was restored from a +dehydrated, still-`pending` state. + +- If this mutation has an active retryer (it paused mid-attempt, e.g. due + to the network mode or scope-based queuing), its retryer is resumed. +- Otherwise, if the mutation's status is still `pending` (e.g. it was + dehydrated while an attempt was in flight and never got a retryer in + this instance), `execute` is called again with the last known variables. +- Otherwise the mutation has already settled and this resolves immediately + without running anything again. + +#### Returns + +`Promise`\<`unknown`\> + +#### Example + +```ts +// typically driven by reconnect handling, e.g. queryClient.resumePausedMutations() +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +await mutation?.continue() +``` + +#### See + +[Mutation#execute](#execute) + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:10](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L10) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.destroy +``` + +*** + +### execute() + +```ts +execute(variables): Promise; +``` + +Defined in: [packages/query-core/src/mutation.ts:283](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L283) + +Runs the mutation function for the given variables through a retryer, and +drives the mutation's state and lifecycle callbacks through to settlement. + +If this mutation's state is already `pending` when `execute` is called +(i.e. it was restored, still in-flight, from a dehydrated state), the +`onMutate` step is skipped and a `continue` action is dispatched to +unpause it; otherwise a `pending` action is dispatched first, then the +mutation cache's `onMutate` and the mutation's own `onMutate` option are +awaited in that order, and the resulting context is stored. + +The mutation function is then run (subject to `retry`/`retryDelay`/ +`networkMode`, and to the mutation cache's scope-based serialization). +On success, the cache's `onSuccess`/`onSettled` callbacks run before the +mutation's own `onSuccess`/`onSettled` options, a `success` action is +dispatched, and the resolved data is returned. On failure, the same +cache-then-option ordering is used for `onError`/`onSettled`, but each of +those four callbacks is individually caught so that a throwing callback +cannot mask the original error; an `error` action is then dispatched and +the original error is re-thrown. + +#### Parameters + +##### variables + +`TVariables` + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +// typically invoked by MutationObserver.mutate, not called directly +const data = await mutation.execute(variables) +``` + +#### See + +[Mutation#continue](#continue) + +*** + +### optionalRemove() + +```ts +protected optionalRemove(): void; +``` + +Defined in: [packages/query-core/src/mutation.ts:212](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L212) + +#### Returns + +`void` + +#### Overrides + +```ts +Removable.optionalRemove +``` + +*** + +### scheduleGc() + +```ts +protected scheduleGc(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L14) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.scheduleGc +``` + +*** + +### updateGcTime() + +```ts +protected updateGcTime(newGcTime): void; +``` + +Defined in: [packages/query-core/src/removable.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L24) + +#### Parameters + +##### newGcTime + +`number` | `undefined` + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.updateGcTime +``` diff --git a/docs/framework/vue/reference/classes/MutationCache.md b/docs/framework/vue/reference/classes/MutationCache.md index 9febd420a78..838d911dbbd 100644 --- a/docs/framework/vue/reference/classes/MutationCache.md +++ b/docs/framework/vue/reference/classes/MutationCache.md @@ -3,7 +3,7 @@ id: MutationCache title: MutationCache --- -Defined in: [vue-query/src/mutationCache.ts:15](https://github.com/TanStack/query/blob/main/packages/vue-query/src/mutationCache.ts#L15) +Defined in: [packages/vue-query/src/mutationCache.ts:15](https://github.com/TanStack/query/blob/main/packages/vue-query/src/mutationCache.ts#L15) Vue-aware subclass of `@tanstack/query-core`'s `MutationCache`. `find`/`findAll` also accept a MaybeRefDeep filters object, so `ref`s can be passed directly without unwrapping. Access it via @@ -18,16 +18,16 @@ MaybeRefDeep filters object, so `ref`s can be passed directly without unwrapping ### Constructor ```ts -new MutationCache(config?): MutationCache; +new MutationCache(config): MutationCache; ``` -Defined in: query-core/dist-ts/src/mutationCache.d.ts:47 +Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) #### Parameters -##### config? +##### config -`MutationCacheConfig` +[`MutationCacheConfig`](../interfaces/MutationCacheConfig.md) = `{}` #### Returns @@ -39,8 +39,70 @@ Defined in: query-core/dist-ts/src/mutationCache.d.ts:47 MC.constructor ``` +## Properties + +### config + +```ts +config: MutationCacheConfig = {}; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) + +#### Inherited from + +```ts +MC.config +``` + +*** + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +MC.listeners +``` + ## Methods +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:229](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L229) + +Removes all mutations from the cache. + +#### Returns + +`void` + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +mutationCache.clear() +``` + +#### Inherited from + +```ts +MC.clear +``` + +*** + ### find() ```ts @@ -49,7 +111,13 @@ find(filters): | undefined; ``` -Defined in: [vue-query/src/mutationCache.ts:16](https://github.com/TanStack/query/blob/main/packages/vue-query/src/mutationCache.ts#L16) +Defined in: [packages/vue-query/src/mutationCache.ts:16](https://github.com/TanStack/query/blob/main/packages/vue-query/src/mutationCache.ts#L16) + +A slightly more advanced method that can be used to get an existing mutation instance from +the cache. If the mutation does not exist, `undefined` is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about a mutation in rare scenarios. #### Type Parameters @@ -77,9 +145,21 @@ Defined in: [vue-query/src/mutationCache.ts:16](https://github.com/TanStack/quer #### Returns - \| `Mutation`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + \| [`Mutation`](Mutation.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> \| `undefined` +#### See + +[MutationCache#findAll](#findall) + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutation = mutationCache.find({ mutationKey: ['addPost'] }) +``` + #### Overrides ```ts @@ -94,7 +174,13 @@ MC.find findAll(filters): Mutation[]; ``` -Defined in: [vue-query/src/mutationCache.ts:27](https://github.com/TanStack/query/blob/main/packages/vue-query/src/mutationCache.ts#L27) +Defined in: [packages/vue-query/src/mutationCache.ts:27](https://github.com/TanStack/query/blob/main/packages/vue-query/src/mutationCache.ts#L27) + +An even more advanced method that can be used to get existing mutation instances from the +cache that match the given filters. If no mutations match, an empty array is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about mutations in rare scenarios. #### Parameters @@ -104,10 +190,147 @@ Defined in: [vue-query/src/mutationCache.ts:27](https://github.com/TanStack/quer #### Returns -`Mutation`\<`unknown`, `Error`, `unknown`, `unknown`\>[] +[`Mutation`](Mutation.md)\<`unknown`, `Error`, `unknown`, `unknown`\>[] + +#### See + +[MutationCache#find](#find) + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutations = mutationCache.findAll({ mutationKey: ['addPost'] }) +``` #### Overrides ```ts MC.findAll ``` + +*** + +### getAll() + +```ts +getAll(): Mutation[]; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:252](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L252) + +Returns all mutations within the cache. + +This is not typically needed for most applications, but can come in handy when needing more +information about a mutation in rare scenarios. + +#### Returns + +[`Mutation`](Mutation.md)\<`unknown`, `Error`, `unknown`, `unknown`\>[] + +#### Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const mutations = mutationCache.getAll() +``` + +#### Inherited from + +```ts +MC.getAll +``` + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +MC.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L23) + +#### Returns + +`void` + +#### Inherited from + +```ts +MC.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L27) + +#### Returns + +`void` + +#### Inherited from + +```ts +MC.onUnsubscribe +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`MutationCacheListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +MC.subscribe +``` diff --git a/docs/framework/vue/reference/classes/MutationObserver.md b/docs/framework/vue/reference/classes/MutationObserver.md new file mode 100644 index 00000000000..b6c88ef3463 --- /dev/null +++ b/docs/framework/vue/reference/classes/MutationObserver.md @@ -0,0 +1,335 @@ +--- +id: MutationObserver +title: MutationObserver +--- + +Defined in: [packages/query-core/src/mutationObserver.ts:38](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L38) + +Observes a single mutation and derives a `MutationObserverResult` from it. +A framework hook like `useMutation` creates one `MutationObserver` per hook +call, keeps it stable across re-renders, calls `setOptions` when the options +passed to the hook change, subscribes to it to re-render on updates, and +reads `getCurrentResult()` for the value to return. Calling `mutate()` +builds a new underlying `Mutation` in the `MutationCache` and executes it. + +## Example + +```ts +const observer = new MutationObserver(queryClient, { + mutationFn: (variables: { title: string }) => addPost(variables), +}) +``` + +## Extends + +- `Subscribable`\<`MutationObserverListener`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Constructors + +### Constructor + +```ts +new MutationObserver(client, options): MutationObserver; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:58](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L58) + +#### Parameters + +##### client + +`QueryClient` + +##### options + +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`MutationObserver`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Overrides + +```ts +Subscribable< + MutationObserverListener +>.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +*** + +### options + +```ts +options: MutationObserverOptions; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:46](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L46) + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L75) + +#### Returns + +`void` + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): MutationObserverResult; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:155](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L155) + +Returns the observer's current result, derived from the observed +mutation's state (or the default, `idle` state if no mutation has been +built yet, e.g. before the first `mutate()` call or after `reset()`). + +#### Returns + +[`MutationObserverResult`](../type-aliases/MutationObserverResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### mutate() + +```ts +mutate(variables, options?): Promise; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:207](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L207) + +Builds a new `Mutation` in the `MutationCache` using the observer's +current options, detaches this observer from any previously observed +mutation, attaches it to the new one, and executes it with the given +variables. + +The optional per-call `options` (`onSuccess`/`onError`/`onSettled`) are +invoked once the mutation settles, in addition to any callbacks defined +on the observer's own options. + +#### Parameters + +##### variables + +`TVariables` + +##### options? + +[`MutateOptions`](../interfaces/MutateOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`Promise`\<`TData`\> + +#### Example + +```ts +await observer.mutate( + { title: 'New post' }, + { onSuccess: (data) => console.log(data) }, +) +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L127) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L135) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### reset() + +```ts +reset(): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L180) + +Detaches the observer from the mutation it is currently observing (if +any) and resets the observed result back to its default, `idle` state. + +This does not cancel an in-flight mutation; the mutation itself keeps +running to completion and its own callbacks still fire, but this +observer stops reflecting its state and a subsequent `mutate()` call +will build a brand new mutation. + +#### Returns + +`void` + +#### Example + +```ts +observer.reset() +``` + +#### See + +[MutationObserver#mutate](#mutate) + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/mutationObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L96) + +Updates the observer's options. + +If the new `mutationKey` differs from the previous one (and both were +defined), the observer is reset, detaching it from the mutation it was +observing. Otherwise, if the currently observed mutation is still +`pending`, its options are updated in place as well. + +#### Parameters + +##### options + +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setOptions({ + mutationFn: (variables: { title: string }) => addPost(variables), + onSuccess: (data) => console.log(data), +}) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`MutationObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/vue/reference/classes/QueriesObserver.md b/docs/framework/vue/reference/classes/QueriesObserver.md new file mode 100644 index 00000000000..0fd6094c5c2 --- /dev/null +++ b/docs/framework/vue/reference/classes/QueriesObserver.md @@ -0,0 +1,325 @@ +--- +id: QueriesObserver +title: QueriesObserver +--- + +Defined in: [packages/query-core/src/queriesObserver.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L54) + +A `QueriesObserver` watches an array of queries at once, exposing them as +a single array of `QueryObserverResult`s (or, when a `combine` option is +given, as a combined value derived from that array). It manages one +internal `QueryObserver` per query, and is the primitive that framework +adapters (e.g. `useQueries`) build their hooks on top of. + +## Example + +```ts +const observer = new QueriesObserver(queryClient, [ + { queryKey: ['post', 1], queryFn: fetchPost }, + { queryKey: ['post', 2], queryFn: fetchPost }, +]) + +const unsubscribe = observer.subscribe((result) => { + console.log(result) +}) +``` + +## Extends + +- `Subscribable`\<`QueriesObserverListener`\> + +## Type Parameters + +### TCombinedResult + +`TCombinedResult` = [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +## Constructors + +### Constructor + +```ts +new QueriesObserver( + client, + queries, +options?): QueriesObserver; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L68) + +#### Parameters + +##### client + +`QueryClient` + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`any`, `any`, `any`, `any`, `any`, `never`\>[] + +##### options? + +[`QueriesObserverOptions`](../interfaces/QueriesObserverOptions.md)\<`TCombinedResult`\> + +#### Returns + +`QueriesObserver`\<`TCombinedResult`\> + +#### Overrides + +```ts +Subscribable.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L104) + +Stops observing all queries: clears all listeners and destroys every +underlying `QueryObserver` this observer manages. + +#### Returns + +`void` + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): QueryObserverResult[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L208) + +Returns the most recently computed array of `QueryObserverResult`s, one +per observed query, in the same order as the queries passed to the +constructor or `setQueries`. + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +#### Example + +```ts +const results = observer.getCurrentResult() +const data = results.map((result) => result.data) +``` + +*** + +### getObservers() + +```ts +getObservers(): QueryObserver[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L225) + +Returns the underlying `QueryObserver` instances this observer manages, +in the same order as the queries passed to the constructor or +`setQueries`. + +#### Returns + +[`QueryObserver`](QueryObserver.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[]\>[] + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(queries, combine): [QueryObserverResult[], (r?) => TCombinedResult, () => QueryObserverResult[]]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L236) + +The `QueriesObserver` counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult) — computes +the result for the given (already-defaulted) queries right now, synchronously. Called by +framework adapters (e.g. `useQueries`) ahead of subscribing, returning a tuple of the raw +per-query results, a function to compute the combined result from them, and a function to +wrap the results for property-access tracking. + +#### Parameters + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[], `never`\>[] + +##### combine + +`CombineFn`\<`TCombinedResult`\> | `undefined` + +#### Returns + +\[[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[], (`r?`) => `TCombinedResult`, () => [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[]\] + +*** + +### getQueries() + +```ts +getQueries(): Query[]; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:216](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L216) + +Returns the underlying `Query` instances currently being observed, in +the same order as the queries passed to the constructor or `setQueries`. + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L84) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L94) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setQueries() + +```ts +setQueries(queries, options?): void; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:125](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L125) + +Replaces the set of queries being observed. Existing `QueryObserver`s +are reused for queries that match an already-observed query hash; +observers for queries that are no longer present are destroyed, and new +observers are created and subscribed to for newly added queries. + +#### Parameters + +##### queries + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[], `never`\>[] + +##### options? + +[`QueriesObserverOptions`](../interfaces/QueriesObserverOptions.md)\<`TCombinedResult`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setQueries([ + { queryKey: ['post', 1], queryFn: fetchPost }, + { queryKey: ['post', 3], queryFn: fetchPost }, +]) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueriesObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/vue/reference/classes/Query.md b/docs/framework/vue/reference/classes/Query.md new file mode 100644 index 00000000000..273d24bdbe8 --- /dev/null +++ b/docs/framework/vue/reference/classes/Query.md @@ -0,0 +1,585 @@ +--- +id: Query +title: Query +--- + +Defined in: [packages/query-core/src/query.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L225) + +Represents a single cached query. A `Query` holds the query's key, options, +state (data/error/status), and the observers currently subscribed to it. + +Instances are created and managed internally by `QueryCache`; application +code typically interacts with queries indirectly through `QueryClient` or +a framework hook like `useQuery`. Direct access to a `Query` instance is +possible via `queryCache.find()`/`findAll()` for inspecting cache state. + +## Example + +```ts +const queryCache = queryClient.getQueryCache() +const query = queryCache.find({ queryKey: ['posts'] }) + +if (query) { + console.log(query.state.dataUpdatedAt) +} +``` + +## Extends + +- `Removable` + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Constructors + +### Constructor + +```ts +new Query(config): Query; +``` + +Defined in: [packages/query-core/src/query.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L246) + +#### Parameters + +##### config + +`QueryConfig`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Returns + +`Query`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Overrides + +```ts +Removable.constructor +``` + +## Properties + +### gcTime + +```ts +gcTime: number; +``` + +Defined in: [packages/query-core/src/removable.ts:7](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L7) + +#### Inherited from + +```ts +Removable.gcTime +``` + +*** + +### observers + +```ts +observers: QueryObserver[]; +``` + +Defined in: [packages/query-core/src/query.ts:242](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L242) + +*** + +### options + +```ts +options: QueryOptions; +``` + +Defined in: [packages/query-core/src/query.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L233) + +*** + +### queryHash + +```ts +queryHash: string; +``` + +Defined in: [packages/query-core/src/query.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L232) + +*** + +### queryKey + +```ts +queryKey: TQueryKey; +``` + +Defined in: [packages/query-core/src/query.ts:231](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L231) + +*** + +### state + +```ts +state: QueryState; +``` + +Defined in: [packages/query-core/src/query.ts:234](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L234) + +## Accessors + +### meta + +#### Get Signature + +```ts +get meta(): Record | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L264) + +The `meta` object passed in the query's options, if any. + +##### Returns + +`Record`\<`string`, `unknown`\> \| `undefined` + +*** + +### promise + +#### Get Signature + +```ts +get promise(): Promise | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L277) + +The promise for the currently in-flight fetch, if the query is fetching. +`undefined` when the query is not fetching. + +##### Returns + +`Promise`\<`TData`\> \| `undefined` + +## Methods + +### cancel() + +```ts +cancel(options?): Promise; +``` + +Defined in: [packages/query-core/src/query.ts:348](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L348) + +Cancels the query's currently in-flight fetch, if any. +- Returns a promise that resolves once the cancellation has settled. +- If no fetch is in progress, resolves immediately. + +#### Parameters + +##### options? + +[`CancelOptions`](../interfaces/CancelOptions.md) + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +await query.cancel() +``` + +*** + +### clearGcTimeout() + +```ts +protected clearGcTimeout(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L32) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.clearGcTimeout +``` + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/query.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L361) + +Clears the query's garbage collection timeout and silently cancels any +in-flight fetch. Called by `QueryCache` when the query is removed from +the cache. + +#### Returns + +`void` + +#### See + +[Query#cancel](#cancel) + +#### Overrides + +```ts +Removable.destroy +``` + +*** + +### fetch() + +```ts +fetch(options?, fetchOptions?): Promise; +``` + +Defined in: [packages/query-core/src/query.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L590) + +Fetches the query, i.e. runs its `queryFn` (through any configured +retryer/behavior) and updates the query's state with the result. +- If a fetch is already in flight, returns its promise instead of + starting a new one, unless `fetchOptions.cancelRefetch` is set and the + query already has data, in which case the current fetch is silently + cancelled first. +- If `options` is passed, it replaces the query's current options + before fetching. + +#### Parameters + +##### options? + +`QueryOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\> + +##### fetchOptions? + +`FetchOptions`\<`TQueryFnData`\> + +#### Returns + +`Promise`\<`TData`\> + +*** + +### getObserversCount() + +```ts +getObserversCount(): number; +``` + +Defined in: [packages/query-core/src/query.ts:560](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L560) + +Returns the number of observers currently subscribed to this query. + +#### Returns + +`number` + +#### Example + +```ts +if (query.getObserversCount() === 0) { + // no component is currently watching this query +} +``` + +*** + +### invalidate() + +```ts +invalidate(): void; +``` + +Defined in: [packages/query-core/src/query.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L574) + +Marks the query as invalidated, unless it is already invalidated. This +updates `state.isInvalidated` and notifies observers, but does not by +itself trigger a refetch. + +#### Returns + +`void` + +#### Example + +```ts +query.invalidate() +``` + +*** + +### isActive() + +```ts +isActive(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:386](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L386) + +Returns `true` if the query has at least one observer for which `enabled` +does not resolve to `false`. + +#### Returns + +`boolean` + +*** + +### isDisabled() + +```ts +isDisabled(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:400](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L400) + +Returns `true` if the query is disabled, meaning it will not fetch +automatically. +- If the query has observers, it is disabled when none of them are active + (see `isActive`). +- If the query has no observers, it is disabled when its `queryFn` is + `skipToken` or it has never been fetched. + +#### Returns + +`boolean` + +*** + +### isFetched() + +```ts +isFetched(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:412](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L412) + +Returns `true` if the query has been fetched, i.e. it has resolved with +either data or an error at least once. + +#### Returns + +`boolean` + +*** + +### isStale() + +```ts +isStale(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:447](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L447) + +Returns `true` if the query is stale. +- If the query has observers, defers to whether any observer's current + result reports `isStale` (which accounts for each observer's own + `staleTime` and `enabled` state). +- If the query has no observers, it is considered stale when it has no + data or has been invalidated. + +#### Returns + +`boolean` + +#### See + +[Query#isStaleByTime](#isstalebytime) + +#### Example + +```ts +if (query.isStale()) { + // refetch or otherwise treat the cached data as outdated +} +``` + +*** + +### isStaleByTime() + +```ts +isStaleByTime(staleTime): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:473](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L473) + +Returns `true` if the query's data is stale relative to the given +`staleTime` (defaults to `0`). +- A query with no data is always stale. +- `staleTime: 'static'` is never stale. +- An invalidated query is always stale. +- Otherwise, staleness is based on elapsed time since `dataUpdatedAt`. + +#### Parameters + +##### staleTime + +[`StaleTime`](../type-aliases/StaleTime.md) = `0` + +#### Returns + +`boolean` + +#### See + +[Query#isStale](#isstale) + +#### Example + +```ts +const isStale = query.isStaleByTime(1000 * 60) +``` + +*** + +### isStatic() + +```ts +isStatic(): boolean; +``` + +Defined in: [packages/query-core/src/query.ts:420](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L420) + +Returns `true` if the query has at least one observer configured with +`staleTime: 'static'`, meaning it is treated as never stale. + +#### Returns + +`boolean` + +*** + +### optionalRemove() + +```ts +protected optionalRemove(): void; +``` + +Defined in: [packages/query-core/src/query.ts:305](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L305) + +#### Returns + +`void` + +#### Overrides + +```ts +Removable.optionalRemove +``` + +*** + +### reset() + +```ts +reset(): void; +``` + +Defined in: [packages/query-core/src/query.ts:377](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L377) + +Resets the query back to its initial state (the state it had when it was +first created, e.g. any `initialData`), destroying it first to cancel any +in-flight fetch. + +#### Returns + +`void` + +*** + +### scheduleGc() + +```ts +protected scheduleGc(): void; +``` + +Defined in: [packages/query-core/src/removable.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L14) + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.scheduleGc +``` + +*** + +### setState() + +```ts +setState(state): void; +``` + +Defined in: [packages/query-core/src/query.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L334) + +Merges the given partial state directly into this query's state, notifying observers. Used +by persistence and broadcast plugins to restore a state snapshot, and by devtools to let a +user manually trigger a loading/error state or edit the cached data. + +#### Parameters + +##### state + +`Partial`\<[`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\>\> + +#### Returns + +`void` + +*** + +### updateGcTime() + +```ts +protected updateGcTime(newGcTime): void; +``` + +Defined in: [packages/query-core/src/removable.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L24) + +#### Parameters + +##### newGcTime + +`number` | `undefined` + +#### Returns + +`void` + +#### Inherited from + +```ts +Removable.updateGcTime +``` diff --git a/docs/framework/vue/reference/classes/QueryCache.md b/docs/framework/vue/reference/classes/QueryCache.md index 957135213ac..6b97f2c0c50 100644 --- a/docs/framework/vue/reference/classes/QueryCache.md +++ b/docs/framework/vue/reference/classes/QueryCache.md @@ -3,7 +3,7 @@ id: QueryCache title: QueryCache --- -Defined in: [vue-query/src/queryCache.ts:16](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryCache.ts#L16) +Defined in: [packages/vue-query/src/queryCache.ts:16](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryCache.ts#L16) Vue-aware subclass of `@tanstack/query-core`'s `QueryCache`. `find`/`findAll` also accept a MaybeRefDeep filters object, so `ref`s can be passed directly without unwrapping. Access it via @@ -18,16 +18,16 @@ MaybeRefDeep filters object, so `ref`s can be passed directly without unwrapping ### Constructor ```ts -new QueryCache(config?): QueryCache; +new QueryCache(config): QueryCache; ``` -Defined in: query-core/dist-ts/src/queryCache.d.ts:57 +Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) #### Parameters -##### config? +##### config -`QueryCacheConfig` +[`QueryCacheConfig`](../interfaces/QueryCacheConfig.md) = `{}` #### Returns @@ -39,8 +39,141 @@ Defined in: query-core/dist-ts/src/queryCache.d.ts:57 QC.constructor ``` +## Properties + +### config + +```ts +config: QueryCacheConfig = {}; +``` + +Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) + +#### Inherited from + +```ts +QC.config +``` + +*** + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +QC.listeners +``` + ## Methods +### build() + +```ts +build( + client, + options, +state?): Query; +``` + +Defined in: [packages/query-core/src/queryCache.ts:137](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L137) + +Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or +builds and adds a new one to the cache if none exists yet. Used by framework adapters and +plugins (e.g. broadcast/persistence) that need to get-or-create a `Query` directly, bypassing +the reactive `QueryObserver` machinery. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### client + +`QueryClient` + +##### options + +[`WithRequired`](../type-aliases/WithRequired.md)\<`QueryOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\>, `"queryKey"`\> + +##### state? + +[`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\> + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const query = queryCache.build(queryClient, { + queryKey: ['posts'], + queryFn: fetchPosts, +}) +``` + +#### Inherited from + +```ts +QC.build +``` + +*** + +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:222](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L222) + +Removes all queries from the cache. + +#### Returns + +`void` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +queryCache.clear() +``` + +#### Inherited from + +```ts +QC.clear +``` + +*** + ### find() ```ts @@ -49,7 +182,16 @@ find(filters): | undefined; ``` -Defined in: [vue-query/src/queryCache.ts:17](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryCache.ts#L17) +Defined in: [packages/vue-query/src/queryCache.ts:17](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryCache.ts#L17) + +A slightly more advanced method that can be used to get an existing query instance from the +cache. This instance not only contains all the state for the query, but all of the instances, +and underlying guts of the query as well. If the query does not exist, `undefined` is +returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about a query in rare scenarios (e.g. looking at `query.state.dataUpdatedAt` to +decide whether a query is fresh enough to be used as an initial value). #### Type Parameters @@ -69,13 +211,25 @@ Defined in: [vue-query/src/queryCache.ts:17](https://github.com/TanStack/query/b ##### filters -`MaybeRefDeep`\<`WithRequired`\<`QueryFilters`\, `"queryKey"`\>\> +`MaybeRefDeep`\<[`WithRequired`](../type-aliases/WithRequired.md)\<`QueryFilters`\, `"queryKey"`\>\> #### Returns - \| `Query`\<`TQueryFnData`, `TError`, `TData`, readonly `unknown`[]\> + \| [`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, readonly `unknown`[]\> \| `undefined` +#### See + +[QueryCache#findAll](#findall) + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const query = queryCache.find({ queryKey: ['posts'] }) +``` + #### Overrides ```ts @@ -90,7 +244,13 @@ QC.find findAll(filters): Query[]; ``` -Defined in: [vue-query/src/queryCache.ts:23](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryCache.ts#L23) +Defined in: [packages/vue-query/src/queryCache.ts:23](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryCache.ts#L23) + +An even more advanced method that can be used to get existing query instances from the cache +that partially match a query key. If no queries match, an empty array is returned. + +This is not typically needed for most applications, but can come in handy when needing more +information about queries in rare scenarios. #### Parameters @@ -100,10 +260,247 @@ Defined in: [vue-query/src/queryCache.ts:23](https://github.com/TanStack/query/b #### Returns -`Query`\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +#### See + +[QueryCache#find](#find) + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const queries = queryCache.findAll({ queryKey: ['posts'] }) +``` #### Overrides ```ts QC.findAll ``` + +*** + +### get() + +```ts +get(queryHash): + | Query + | undefined; +``` + +Defined in: [packages/query-core/src/queryCache.ts:244](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L244) + +Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none +exists. Unlike [QueryCache#find](#find), this looks up by the already-computed hash rather +than by `QueryFilters`. Used by plugins (e.g. broadcast/hydration) that already have a hash +to look up directly. + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +#### Parameters + +##### queryHash + +`string` + +#### Returns + + \| [`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> + \| `undefined` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() +const queryHash = hashKey(['posts']) + +const query = queryCache.get(queryHash) +``` + +#### Inherited from + +```ts +QC.get +``` + +*** + +### getAll() + +```ts +getAll(): Query[]; +``` + +Defined in: [packages/query-core/src/queryCache.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L267) + +Returns all queries within the cache. + +#### Returns + +[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[] + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() + +const queries = queryCache.getAll() +``` + +#### Inherited from + +```ts +QC.getAll +``` + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +QC.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L23) + +#### Returns + +`void` + +#### Inherited from + +```ts +QC.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L27) + +#### Returns + +`void` + +#### Inherited from + +```ts +QC.onUnsubscribe +``` + +*** + +### remove() + +```ts +remove(query): void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:198](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L198) + +Destroys the given `Query` and removes it from the cache, notifying subscribers with a +`'removed'` event. A no-op if the query is no longer the one currently stored under its hash +(e.g. it was already replaced). Used by plugins (e.g. the broadcast client) that mirror +removals across `QueryCache` instances. + +#### Parameters + +##### query + +[`Query`](Query.md)\<`any`, `any`, `any`, `any`\> + +#### Returns + +`void` + +#### Example + +```ts +const queryCache = queryClient.getQueryCache() +const query = queryCache.find({ queryKey: ['posts'] }) + +if (query) { + queryCache.remove(query) +} +``` + +#### Inherited from + +```ts +QC.remove +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueryCacheListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +QC.subscribe +``` diff --git a/docs/framework/vue/reference/classes/QueryClient.md b/docs/framework/vue/reference/classes/QueryClient.md index 2fb44e83c1e..ebc209a89b4 100644 --- a/docs/framework/vue/reference/classes/QueryClient.md +++ b/docs/framework/vue/reference/classes/QueryClient.md @@ -3,7 +3,7 @@ id: QueryClient title: QueryClient --- -Defined in: [vue-query/src/queryClient.ts:44](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L44) +Defined in: [packages/vue-query/src/queryClient.ts:44](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L44) Vue-aware subclass of `@tanstack/query-core`'s `QueryClient`. Methods that accept `options` (such as `CancelOptions` or `InvalidateOptions`) or filters (such as the `QueryFilters` accepted by @@ -23,7 +23,7 @@ Install one on your app with `VueQueryPlugin`, or retrieve it with `useQueryClie new QueryClient(config): QueryClient; ``` -Defined in: [vue-query/src/queryClient.ts:45](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L45) +Defined in: [packages/vue-query/src/queryClient.ts:45](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L45) #### Parameters @@ -49,7 +49,7 @@ QC.constructor optional isRestoring: Ref; ``` -Defined in: [vue-query/src/queryClient.ts:58](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L58) +Defined in: [packages/vue-query/src/queryClient.ts:58](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L58) `true` while a `clientPersister` passed to `VueQueryPlugin` is restoring the cache. Queries don't fetch while this is `true`. Defaults to `false` if no persister is configured. @@ -62,7 +62,14 @@ while this is `true`. Defaults to `false` if no persister is configured. cancelQueries(filters?, options?): Promise; ``` -Defined in: [vue-query/src/queryClient.ts:185](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L185) +Defined in: [packages/vue-query/src/queryClient.ts:185](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L185) + +Cancels outgoing fetches for queries matching the given filters. Most useful when performing +optimistic updates, since any outgoing refetch that resolves afterwards would otherwise +overwrite the optimistic update. By default (`revert: true`), a cancelled query's data is +reverted to its state before the outgoing fetch started. + +The returned promise never rejects, even if individual cancellations fail. #### Type Parameters @@ -78,12 +85,18 @@ Defined in: [vue-query/src/queryClient.ts:185](https://github.com/TanStack/query ##### options? -`MaybeRefDeep`\<`CancelOptions`\> +`MaybeRefDeep`\<[`CancelOptions`](../interfaces/CancelOptions.md)\> #### Returns `Promise`\<`void`\> +#### Example + +```ts +await queryClient.cancelQueries({ queryKey: ['posts'], exact: true }) +``` + #### Overrides ```ts @@ -92,6 +105,183 @@ QC.cancelQueries *** +### clear() + +```ts +clear(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1073) + +Clears both the query cache and the mutation cache this client is connected to. + +#### Returns + +`void` + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +queryClient.clear() +``` + +#### Inherited from + +```ts +QC.clear +``` + +*** + +### defaultMutationOptions() + +```ts +defaultMutationOptions(options?): T; +``` + +Defined in: [packages/query-core/src/queryClient.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1047) + +The mutation counterpart of [QueryClient#defaultQueryOptions](#defaultqueryoptions). Called by framework +adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the +given `mutationKey`, then the client's `defaultOptions.mutations`, then the caller's options +on top. A no-op if the options are already defaulted (`_defaulted: true`). + +#### Type Parameters + +##### T + +`T` *extends* `MutationOptions`\<`any`, `any`, `any`, `any`\> + +#### Parameters + +##### options? + +`T` + +#### Returns + +`T` + +#### Inherited from + +```ts +QC.defaultMutationOptions +``` + +*** + +### defaultQueryOptions() + +```ts +defaultQueryOptions(options): DefaultedQueryObserverOptions; +``` + +Defined in: [packages/query-core/src/queryClient.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L960) + +Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the +caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the +given `queryKey`, then the client's own `defaultOptions.queries`, then the caller's options +on top. A no-op if the options are already defaulted (`_defaulted: true`). + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` = `unknown` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryData + +`TQueryData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `never` + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\> | [`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Inherited from + +```ts +QC.defaultQueryOptions +``` + +*** + +### ~~ensureInfiniteQueryData()~~ + +```ts +ensureInfiniteQueryData(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryClient.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L725) + +#### Type Parameters + +##### TQueryFnData + +`TQueryFnData` + +##### TError + +`TError` = `Error` + +##### TData + +`TData` = `TQueryFnData` + +##### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +##### TPageParam + +`TPageParam` = `unknown` + +#### Parameters + +##### options + +[`EnsureInfiniteQueryDataOptions`](../type-aliases/EnsureInfiniteQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +#### Returns + +`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\> + +#### Deprecated + +Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version. + +#### Inherited from + +```ts +QC.ensureInfiniteQueryData +``` + +*** + ### ~~ensureQueryData()~~ #### Call Signature @@ -100,7 +290,7 @@ QC.cancelQueries ensureQueryData(options): Promise; ``` -Defined in: [vue-query/src/queryClient.ts:83](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L83) +Defined in: [packages/vue-query/src/queryClient.ts:83](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L83) ##### Type Parameters @@ -124,7 +314,7 @@ Defined in: [vue-query/src/queryClient.ts:83](https://github.com/TanStack/query/ ###### options -`EnsureQueryDataOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> +[`EnsureQueryDataOptions`](../interfaces/EnsureQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> ##### Returns @@ -146,7 +336,7 @@ QC.ensureQueryData ensureQueryData(options): Promise; ``` -Defined in: [vue-query/src/queryClient.ts:91](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L91) +Defined in: [packages/vue-query/src/queryClient.ts:91](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L91) ##### Type Parameters @@ -170,7 +360,7 @@ Defined in: [vue-query/src/queryClient.ts:91](https://github.com/TanStack/query/ ###### options -`MaybeRefDeep`\<`EnsureQueryDataOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\>\> +`MaybeRefDeep`\<[`EnsureQueryDataOptions`](../interfaces/EnsureQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\>\> ##### Returns @@ -196,7 +386,7 @@ QC.ensureQueryData fetchInfiniteQuery(options): Promise>; ``` -Defined in: [vue-query/src/queryClient.ts:464](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L464) +Defined in: [packages/vue-query/src/queryClient.ts:464](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L464) ##### Type Parameters @@ -224,11 +414,11 @@ Defined in: [vue-query/src/queryClient.ts:464](https://github.com/TanStack/query ###### options -`FetchInfiniteQueryOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> +[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> ##### Returns -`Promise`\<`InfiniteData`\<`TData`, `TPageParam`\>\> +`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\> ##### Deprecated @@ -246,7 +436,7 @@ QC.fetchInfiniteQuery fetchInfiniteQuery(options): Promise>; ``` -Defined in: [vue-query/src/queryClient.ts:479](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L479) +Defined in: [packages/vue-query/src/queryClient.ts:479](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L479) ##### Type Parameters @@ -274,11 +464,11 @@ Defined in: [vue-query/src/queryClient.ts:479](https://github.com/TanStack/query ###### options -`MaybeRefDeep`\<`FetchInfiniteQueryOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>\> +`MaybeRefDeep`\<[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>\> ##### Returns -`Promise`\<`InfiniteData`\<`TData`, `TPageParam`\>\> +`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\> ##### Deprecated @@ -300,7 +490,7 @@ QC.fetchInfiniteQuery fetchQuery(options): Promise; ``` -Defined in: [vue-query/src/queryClient.ts:313](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L313) +Defined in: [packages/vue-query/src/queryClient.ts:313](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L313) ##### Type Parameters @@ -328,7 +518,7 @@ Defined in: [vue-query/src/queryClient.ts:313](https://github.com/TanStack/query ###### options -`FetchQueryOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> +[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> ##### Returns @@ -350,7 +540,7 @@ QC.fetchQuery fetchQuery(options): Promise; ``` -Defined in: [vue-query/src/queryClient.ts:328](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L328) +Defined in: [packages/vue-query/src/queryClient.ts:328](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L328) ##### Type Parameters @@ -378,7 +568,7 @@ Defined in: [vue-query/src/queryClient.ts:328](https://github.com/TanStack/query ###### options -`MaybeRefDeep`\<`FetchQueryOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>\> | () => `FetchQueryOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> +`MaybeRefDeep`\<[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>\> | () => [`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> ##### Returns @@ -396,13 +586,81 @@ QC.fetchQuery *** +### getDefaultOptions() + +```ts +getDefaultOptions(): DefaultOptions; +``` + +Defined in: [packages/query-core/src/queryClient.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L808) + +Returns the default options that were set when creating the client, or via +[QueryClient#setDefaultOptions](#setdefaultoptions). + +#### Returns + +[`DefaultOptions`](../interfaces/DefaultOptions.md) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const defaultOptions = queryClient.getDefaultOptions() +``` + +#### Inherited from + +```ts +QC.getDefaultOptions +``` + +*** + +### getMutationCache() + +```ts +getMutationCache(): MutationCache; +``` + +Defined in: [packages/query-core/src/queryClient.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L792) + +Returns the mutation cache this client is connected to. + +#### Returns + +`MutationCache` + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const mutationCache = queryClient.getMutationCache() +const mutations = mutationCache.findAll({ status: 'pending' }) +``` + +#### Inherited from + +```ts +QC.getMutationCache +``` + +*** + ### getMutationDefaults() ```ts getMutationDefaults(mutationKey): MutationObserverOptions; ``` -Defined in: [vue-query/src/queryClient.ts:612](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L612) +Defined in: [packages/vue-query/src/queryClient.ts:612](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L612) + +Returns the default options registered for mutations whose mutation key partially matches +the given `mutationKey`, via [QueryClient#setMutationDefaults](#setmutationdefaults). If multiple registered +defaults match, they are merged together in registration order. #### Parameters @@ -412,7 +670,13 @@ Defined in: [vue-query/src/queryClient.ts:612](https://github.com/TanStack/query #### Returns -`MutationObserverOptions`\<`any`, `any`, `any`, `any`\> +[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`any`, `any`, `any`, `any`\> + +#### Example + +```ts +const defaultOptions = queryClient.getMutationDefaults(['addPost']) +``` #### Overrides @@ -428,7 +692,11 @@ QC.getMutationDefaults getQueriesData(filters): [readonly unknown[], TData | undefined][]; ``` -Defined in: [vue-query/src/queryClient.ts:114](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L114) +Defined in: [packages/vue-query/src/queryClient.ts:114](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L114) + +Imperative (non-reactive) way to retrieve the cached data of multiple queries at once. +Only queries matching the given filters are returned; if none match, an empty array is +returned. #### Type Parameters @@ -446,6 +714,16 @@ Defined in: [vue-query/src/queryClient.ts:114](https://github.com/TanStack/query \[readonly `unknown`[], `TData` \| `undefined`\][] +#### See + +[QueryClient#getQueryData](#getquerydata) + +#### Example + +```ts +const data = queryClient.getQueriesData({ queryKey: ['posts'] }) +``` + #### Overrides ```ts @@ -454,15 +732,49 @@ QC.getQueriesData *** +### getQueryCache() + +```ts +getQueryCache(): QueryCache; +``` + +Defined in: [packages/query-core/src/queryClient.ts:776](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L776) + +Returns the query cache this client is connected to. + +#### Returns + +`QueryCache` + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +const queryCache = queryClient.getQueryCache() +const queries = queryCache.findAll({ queryKey: ['posts'] }) +``` + +#### Inherited from + +```ts +QC.getQueryCache +``` + +*** + ### getQueryData() #### Call Signature ```ts -getQueryData(queryKey): InferDataFromTag | undefined; +getQueryData(queryKey): + | InferDataFromTag + | undefined; ``` -Defined in: [vue-query/src/queryClient.ts:68](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L68) +Defined in: [packages/vue-query/src/queryClient.ts:68](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L68) Imperative (non-reactive) way to retrieve data for a QueryKey. Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. @@ -488,7 +800,12 @@ Use `useQuery` to create a `QueryObserver` that subscribes to changes. ##### Returns -`InferDataFromTag`\<`TData`, `TTaggedQueryKey`\> \| `undefined` + \| [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TData`, `TTaggedQueryKey`\> + \| `undefined` + +##### See + +[QueryClient#getQueriesData](#getqueriesdata) ##### Overrides @@ -502,7 +819,7 @@ QC.getQueryData getQueryData(queryKey): TData | undefined; ``` -Defined in: [vue-query/src/queryClient.ts:71](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L71) +Defined in: [packages/vue-query/src/queryClient.ts:71](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L71) ##### Type Parameters @@ -534,7 +851,11 @@ QC.getQueryData getQueryDefaults(queryKey): OmitKeyof, "queryKey">; ``` -Defined in: [vue-query/src/queryClient.ts:589](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L589) +Defined in: [packages/vue-query/src/queryClient.ts:589](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L589) + +Returns the default options registered for queries whose query key partially matches the +given `queryKey`, via [QueryClient#setQueryDefaults](#setquerydefaults). If multiple registered defaults +match, they are merged together in registration order. #### Parameters @@ -544,7 +865,13 @@ Defined in: [vue-query/src/queryClient.ts:589](https://github.com/TanStack/query #### Returns -`OmitKeyof`\<`QueryObserverOptions`\<`any`, `any`, `any`, `any`, `any`\>, `"queryKey"`\> +[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`any`, `any`, `any`, `any`, `any`\>, `"queryKey"`\> + +#### Example + +```ts +const defaultOptions = queryClient.getQueryDefaults(['posts']) +``` #### Overrides @@ -557,10 +884,15 @@ QC.getQueryDefaults ### getQueryState() ```ts -getQueryState(queryKey): QueryState | undefined; +getQueryState(queryKey): + | QueryState + | undefined; ``` -Defined in: [vue-query/src/queryClient.ts:161](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L161) +Defined in: [packages/vue-query/src/queryClient.ts:161](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L161) + +Imperative (non-reactive) way to retrieve an existing query's state. If the query does not +exist, `undefined` is returned. #### Type Parameters @@ -580,7 +912,15 @@ Defined in: [vue-query/src/queryClient.ts:161](https://github.com/TanStack/query #### Returns -`QueryState`\<`TData`, `TError`\> \| `undefined` + \| [`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\> + \| `undefined` + +#### Example + +```ts +const state = queryClient.getQueryState(['posts']) +console.log(state?.dataUpdatedAt) +``` #### Overrides @@ -598,7 +938,17 @@ QC.getQueryState infiniteQuery(options): Promise[] ? InfiniteData : TData>; ``` -Defined in: [vue-query/src/queryClient.ts:397](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L397) +Defined in: [packages/vue-query/src/queryClient.ts:397](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L397) + +Asynchronous method to fetch and cache an infinite query, resolving with an +[InfiniteData](../interfaces/InfiniteData.md) object or throwing with the error. + +Behaves like [QueryClient#query](#query), accepting the same options (minus +`initialPageParam`), plus the required `initialPageParam`, and an optional `pages` / +`getNextPageParam` pair used to refetch a fixed number of pages from the start. + +This method replaces the deprecated `fetchInfiniteQuery`, and — combined with +`{ staleTime: 'static' }` — the deprecated `ensureInfiniteQueryData`. ##### Type Parameters @@ -612,7 +962,7 @@ Defined in: [vue-query/src/queryClient.ts:397](https://github.com/TanStack/query ###### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> ###### TQueryKey @@ -626,11 +976,22 @@ Defined in: [vue-query/src/queryClient.ts:397](https://github.com/TanStack/query ###### options -`InfiniteQueryExecuteOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> +[`InfiniteQueryExecuteOptions`](../type-aliases/InfiniteQueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> ##### Returns -`Promise`\<`TData`[] *extends* `InfiniteData`\<`TQueryFnData`, `unknown`\>[] ? `InfiniteData`\<`TQueryFnData`, `TPageParam`\> : `TData`\> +`Promise`\<`TData`[] *extends* [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>[] ? [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\> : `TData`\> + +##### Example + +```ts +try { + const data = await queryClient.infiniteQuery({ queryKey, queryFn, initialPageParam: 0 }) + console.log(data.pages) +} catch (error) { + console.log(error) +} +``` ##### Overrides @@ -644,7 +1005,7 @@ QC.infiniteQuery infiniteQuery(options): Promise[] ? InfiniteData : TData>; ``` -Defined in: [vue-query/src/queryClient.ts:416](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L416) +Defined in: [packages/vue-query/src/queryClient.ts:416](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L416) ##### Type Parameters @@ -658,7 +1019,7 @@ Defined in: [vue-query/src/queryClient.ts:416](https://github.com/TanStack/query ###### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> ###### TQueryKey @@ -672,11 +1033,11 @@ Defined in: [vue-query/src/queryClient.ts:416](https://github.com/TanStack/query ###### options -`MaybeRefDeep`\<`InfiniteQueryExecuteOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>\> +`MaybeRefDeep`\<[`InfiniteQueryExecuteOptions`](../type-aliases/InfiniteQueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>\> ##### Returns -`Promise`\<`TData`[] *extends* `InfiniteData`\<`TQueryFnData`, `unknown`\>[] ? `InfiniteData`\<`TQueryFnData`, `TPageParam`\> : `TData`\> +`Promise`\<`TData`[] *extends* [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>[] ? [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\> : `TData`\> ##### Overrides @@ -692,7 +1053,14 @@ QC.infiniteQuery invalidateQueries(filters?, options?): Promise; ``` -Defined in: [vue-query/src/queryClient.ts:196](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L196) +Defined in: [packages/vue-query/src/queryClient.ts:196](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L196) + +Marks queries matching the given filters as invalidated. Unlike +[QueryClient#removeQueries](#removequeries), invalidated queries stay in the cache. + +Unless `filters.refetchType` is `'none'`, matching queries are then refetched via +[QueryClient#refetchQueries](#refetchqueries), using `filters.refetchType` if set, otherwise +`filters.type`, otherwise `'active'`. #### Type Parameters @@ -704,16 +1072,22 @@ Defined in: [vue-query/src/queryClient.ts:196](https://github.com/TanStack/query ##### filters? -`InvalidateQueryFilters`\<`TTaggedQueryKey`\> | () => `InvalidateQueryFilters`\<`TTaggedQueryKey`\> +[`InvalidateQueryFilters`](../interfaces/InvalidateQueryFilters.md)\<`TTaggedQueryKey`\> | () => [`InvalidateQueryFilters`](../interfaces/InvalidateQueryFilters.md)\<`TTaggedQueryKey`\> ##### options? -`MaybeRefDeep`\<`InvalidateOptions`\> +`MaybeRefDeep`\<[`InvalidateOptions`](../interfaces/InvalidateOptions.md)\> #### Returns `Promise`\<`void`\> +#### Example + +```ts +await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' }) +``` + #### Overrides ```ts @@ -728,7 +1102,11 @@ QC.invalidateQueries isFetching(filters): number; ``` -Defined in: [vue-query/src/queryClient.ts:60](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L60) +Defined in: [packages/vue-query/src/queryClient.ts:60](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L60) + +Returns the number of queries in the cache that are currently fetching, optionally +matching a set of filters. This includes background-fetching, loading new pages, and +loading more infinite query results. #### Parameters @@ -740,6 +1118,14 @@ Defined in: [vue-query/src/queryClient.ts:60](https://github.com/TanStack/query/ `number` +#### Example + +```ts +if (queryClient.isFetching()) { + console.log('At least one query is fetching!') +} +``` + #### Overrides ```ts @@ -754,7 +1140,10 @@ QC.isFetching isMutating(filters): number; ``` -Defined in: [vue-query/src/queryClient.ts:64](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L64) +Defined in: [packages/vue-query/src/queryClient.ts:64](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L64) + +Returns the number of mutations in the cache that are currently pending, optionally +matching a set of filters. #### Parameters @@ -766,6 +1155,14 @@ Defined in: [vue-query/src/queryClient.ts:64](https://github.com/TanStack/query/ `number` +#### Example + +```ts +if (queryClient.isMutating()) { + console.log('At least one mutation is pending!') +} +``` + #### Overrides ```ts @@ -774,6 +1171,31 @@ QC.isMutating *** +### mount() + +```ts +mount(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L103) + +Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start +listening for focus/online events and resume paused mutations. Ref-counted via an internal +mount count, so nested or multiple providers sharing the same `QueryClient` don't tear down +the shared listeners until the last one unmounts. + +#### Returns + +`void` + +#### Inherited from + +```ts +QC.mount +``` + +*** + ### ~~prefetchInfiniteQuery()~~ #### Call Signature @@ -782,7 +1204,7 @@ QC.isMutating prefetchInfiniteQuery(options): Promise; ``` -Defined in: [vue-query/src/queryClient.ts:519](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L519) +Defined in: [packages/vue-query/src/queryClient.ts:519](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L519) ##### Type Parameters @@ -810,7 +1232,7 @@ Defined in: [vue-query/src/queryClient.ts:519](https://github.com/TanStack/query ###### options -`FetchInfiniteQueryOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> +[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> ##### Returns @@ -832,7 +1254,7 @@ QC.prefetchInfiniteQuery prefetchInfiniteQuery(options): Promise; ``` -Defined in: [vue-query/src/queryClient.ts:534](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L534) +Defined in: [packages/vue-query/src/queryClient.ts:534](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L534) ##### Type Parameters @@ -860,7 +1282,7 @@ Defined in: [vue-query/src/queryClient.ts:534](https://github.com/TanStack/query ###### options -`MaybeRefDeep`\<`FetchInfiniteQueryOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>\> +`MaybeRefDeep`\<[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>\> ##### Returns @@ -886,7 +1308,7 @@ QC.prefetchInfiniteQuery prefetchQuery(options): Promise; ``` -Defined in: [vue-query/src/queryClient.ts:364](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L364) +Defined in: [packages/vue-query/src/queryClient.ts:364](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L364) ##### Type Parameters @@ -910,7 +1332,7 @@ Defined in: [vue-query/src/queryClient.ts:364](https://github.com/TanStack/query ###### options -`FetchQueryOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> +[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\> ##### Returns @@ -932,7 +1354,7 @@ QC.prefetchQuery prefetchQuery(options): Promise; ``` -Defined in: [vue-query/src/queryClient.ts:372](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L372) +Defined in: [packages/vue-query/src/queryClient.ts:372](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L372) ##### Type Parameters @@ -956,7 +1378,7 @@ Defined in: [vue-query/src/queryClient.ts:372](https://github.com/TanStack/query ###### options -`MaybeRefDeep`\<`FetchQueryOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\>\> +`MaybeRefDeep`\<[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\>\> ##### Returns @@ -982,7 +1404,25 @@ QC.prefetchQuery query(options): Promise; ``` -Defined in: [vue-query/src/queryClient.ts:252](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L252) +Defined in: [packages/vue-query/src/queryClient.ts:252](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L252) + +Asynchronous method to fetch and cache a query, resolving with the data or throwing with +the error. + +If the query already exists in the cache and its data is not stale (per the given +`staleTime`), the cached data is returned without fetching. Otherwise, the query is fetched +and the promise resolves once the fetch settles. If a `select` function is provided, it is +applied to the data in both cases (cached or freshly fetched) before it is returned. + +Unlike `useQuery`, retries are disabled by default here (`retry: false`) unless explicitly +configured, since there is no component to catch a thrown error and retry through re-render. + +The accepted options are a subset of `useQuery`'s options: fields that only make sense for a +reactive observer (e.g. `enabled`, `refetchInterval`, `refetchOnWindowFocus`, `notifyOnChangeProps`, +`throwOnError`, `suspense`, `placeholderData`) are not part of this method's options. + +This method replaces the deprecated `fetchQuery`, and — combined with +`{ staleTime: 'static' }` — the deprecated `ensureQueryData`. ##### Type Parameters @@ -1014,12 +1454,22 @@ Defined in: [vue-query/src/queryClient.ts:252](https://github.com/TanStack/query ###### options -`QueryExecuteOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\> +[`QueryExecuteOptions`](../interfaces/QueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\> ##### Returns `Promise`\<`TData`\> +##### Example + +```ts +try { + const data = await queryClient.query({ queryKey, queryFn, staleTime: 10000 }) +} catch (error) { + console.log(error) +} +``` + ##### Overrides ```ts @@ -1032,7 +1482,7 @@ QC.query query(options): Promise; ``` -Defined in: [vue-query/src/queryClient.ts:269](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L269) +Defined in: [packages/vue-query/src/queryClient.ts:269](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L269) ##### Type Parameters @@ -1064,7 +1514,7 @@ Defined in: [vue-query/src/queryClient.ts:269](https://github.com/TanStack/query ###### options -`MaybeRefDeep`\<`QueryExecuteOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\>\> +`MaybeRefDeep`\<[`QueryExecuteOptions`](../interfaces/QueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\>\> ##### Returns @@ -1084,7 +1534,15 @@ QC.query refetchQueries(filters?, options?): Promise; ``` -Defined in: [vue-query/src/queryClient.ts:236](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L236) +Defined in: [packages/vue-query/src/queryClient.ts:236](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L236) + +Refetches queries matching the given filters, regardless of whether they are stale. Without +filters, every query in the cache is refetched. Queries that are disabled, or static (only +have observers with a static `staleTime`), are never refetched. + +By default (`cancelRefetch: true`), a currently running fetch is cancelled before the new +one starts. The returned promise resolves once all matching queries have settled; it does +not reject on individual query failures unless `throwOnError` is set. #### Type Parameters @@ -1096,16 +1554,23 @@ Defined in: [vue-query/src/queryClient.ts:236](https://github.com/TanStack/query ##### filters? -`RefetchQueryFilters`\<`TTaggedQueryKey`\> +[`RefetchQueryFilters`](../interfaces/RefetchQueryFilters.md)\<`TTaggedQueryKey`\> ##### options? -`MaybeRefDeep`\<`RefetchOptions`\> +`MaybeRefDeep`\<[`RefetchOptions`](../interfaces/RefetchOptions.md)\> #### Returns `Promise`\<`void`\> +#### Example + +```ts +// refetch all active queries partially matching a query key: +await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' }) +``` + #### Overrides ```ts @@ -1120,7 +1585,12 @@ QC.refetchQueries removeQueries(filters?): void; ``` -Defined in: [vue-query/src/queryClient.ts:167](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L167) +Defined in: [packages/vue-query/src/queryClient.ts:167](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L167) + +Removes queries from the cache that match the given filters. Unlike +[QueryClient#invalidateQueries](#invalidatequeries) or [QueryClient#refetchQueries](#refetchqueries), this removes +matching queries from the cache instead of refetching them. Without filters, every query in +the cache is removed. #### Type Parameters @@ -1138,6 +1608,12 @@ Defined in: [vue-query/src/queryClient.ts:167](https://github.com/TanStack/query `void` +#### Example + +```ts +queryClient.removeQueries({ queryKey: ['posts'], exact: true }) +``` + #### Overrides ```ts @@ -1152,7 +1628,11 @@ QC.removeQueries resetQueries(filters?, options?): Promise; ``` -Defined in: [vue-query/src/queryClient.ts:174](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L174) +Defined in: [packages/vue-query/src/queryClient.ts:174](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L174) + +Resets queries matching the given filters back to their initial state (e.g. any +`initialData`), notifying subscribers rather than removing them. Active queries among the +matched set are then refetched, and the returned promise resolves once that refetch settles. #### Type Parameters @@ -1168,12 +1648,18 @@ Defined in: [vue-query/src/queryClient.ts:174](https://github.com/TanStack/query ##### options? -`MaybeRefDeep`\<`ResetOptions`\> +`MaybeRefDeep`\<[`ResetOptions`](../interfaces/ResetOptions.md)\> #### Returns `Promise`\<`void`\> +#### Example + +```ts +await queryClient.resetQueries({ queryKey: ['posts'], exact: true }) +``` + #### Overrides ```ts @@ -1182,24 +1668,76 @@ QC.resetQueries *** +### resumePausedMutations() + +```ts +resumePausedMutations(): Promise; +``` + +Defined in: [packages/query-core/src/queryClient.ts:757](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L757) + +Resumes mutations that were paused because there was no network connection. Does nothing +(resolving immediately) if the client is currently offline. + +#### Returns + +`Promise`\<`unknown`\> + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +await queryClient.resumePausedMutations() +``` + +#### Inherited from + +```ts +QC.resumePausedMutations +``` + +*** + ### setDefaultOptions() ```ts setDefaultOptions(options): void; ``` -Defined in: [vue-query/src/queryClient.ts:571](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L571) +Defined in: [packages/vue-query/src/queryClient.ts:571](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L571) + +Dynamically sets the default options for this client, overwriting any previously defined +default options. #### Parameters ##### options -`MaybeRefDeep`\<`DefaultOptions`\<`Error`\>\> +`MaybeRefDeep`\<[`DefaultOptions`](../interfaces/DefaultOptions.md)\<`Error`\>\> #### Returns `void` +#### See + +[QueryClient#getDefaultOptions](#getdefaultoptions) + +#### Example + +```ts +import { QueryClient } from '@tanstack/query-core' + +const queryClient = new QueryClient() +queryClient.setDefaultOptions({ + queries: { + staleTime: Infinity, + }, +}) +``` + #### Overrides ```ts @@ -1214,7 +1752,11 @@ QC.setDefaultOptions setMutationDefaults(mutationKey, options): void; ``` -Defined in: [vue-query/src/queryClient.ts:595](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L595) +Defined in: [packages/vue-query/src/queryClient.ts:595](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L595) + +Sets default options for mutations whose mutation key partially matches the given +`mutationKey`. As with [QueryClient#setQueryDefaults](#setquerydefaults), the order of registration +matters when several registered defaults match the same mutation key. #### Type Parameters @@ -1242,12 +1784,22 @@ Defined in: [vue-query/src/queryClient.ts:595](https://github.com/TanStack/query ##### options -`MaybeRefDeep`\<`MutationObserverOptions`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> +`MaybeRefDeep`\<[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\> #### Returns `void` +#### See + +[QueryClient#getMutationDefaults](#getmutationdefaults) + +#### Example + +```ts +queryClient.setMutationDefaults(['addPost'], { mutationFn: addPost }) +``` + #### Overrides ```ts @@ -1265,7 +1817,12 @@ setQueriesData( options): [readonly unknown[], TData | undefined][]; ``` -Defined in: [vue-query/src/queryClient.ts:149](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L149) +Defined in: [packages/vue-query/src/queryClient.ts:149](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L149) + +Synchronous way to immediately update the cached data of multiple queries at once, using +filters or partial query key matching. Only queries that already exist and match the given +filters are updated; no new cache entries are created. Internally this calls +[QueryClient#setQueryData](#setquerydata) for each matching query. #### Type Parameters @@ -1281,16 +1838,24 @@ Defined in: [vue-query/src/queryClient.ts:149](https://github.com/TanStack/query ##### updater -`Updater`\<`TData` \| `undefined`, `TData` \| `undefined`\> +[`Updater`](../type-aliases/Updater.md)\<`TData` \| `undefined`, `TData` \| `undefined`\> ##### options -`MaybeRefDeep`\<`SetDataOptions`\> = `{}` +`MaybeRefDeep`\<[`SetDataOptions`](../interfaces/SetDataOptions.md)\> = `{}` #### Returns \[readonly `unknown`[], `TData` \| `undefined`\][] +#### Example + +```ts +queryClient.setQueriesData({ queryKey: ['posts'] }, (oldPosts) => + oldPosts ? oldPosts.filter((post) => post.id !== deletedId) : oldPosts, +) +``` + #### Overrides ```ts @@ -1310,7 +1875,15 @@ setQueryData( options?): NoInfer | undefined; ``` -Defined in: [vue-query/src/queryClient.ts:120](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L120) +Defined in: [packages/vue-query/src/queryClient.ts:120](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L120) + +Synchronous way to immediately update a query's cached data. If the updater (or the value +passed) resolves to `undefined`, the cache is left untouched and no query is created; +otherwise, if the query does not exist yet, it will be created. To update multiple queries +at once by partially matching query keys, use [QueryClient#setQueriesData](#setqueriesdata) instead. + +Updates must be performed immutably: do not mutate `oldData`, or data previously retrieved +via [QueryClient#getQueryData](#getquerydata), in place. ##### Type Parameters @@ -1324,7 +1897,7 @@ Defined in: [vue-query/src/queryClient.ts:120](https://github.com/TanStack/query ###### TInferredQueryFnData -`TInferredQueryFnData` = `InferDataFromTag`\<`TQueryFnData`, `TTaggedQueryKey`\> +`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\> ##### Parameters @@ -1332,18 +1905,32 @@ Defined in: [vue-query/src/queryClient.ts:120](https://github.com/TanStack/query `TTaggedQueryKey` +The query key to set data for. + ###### updater -`Updater`\<`NoInfer`\<`TInferredQueryFnData`\> \| `undefined`, `NoInfer`\<`TInferredQueryFnData`\> \| `undefined`\> +[`Updater`](../type-aliases/Updater.md)\<`NoInfer`\<`TInferredQueryFnData`\> \| `undefined`, `NoInfer`\<`TInferredQueryFnData`\> \| `undefined`\> + +Either the new data, or a function that receives the current data (which +may be `undefined`) and returns the new data. ###### options? -`MaybeRefDeep`\<`SetDataOptions`\> +`MaybeRefDeep`\<[`SetDataOptions`](../interfaces/SetDataOptions.md)\> ##### Returns `NoInfer`\<`TInferredQueryFnData`\> \| `undefined` +##### Example + +```ts +queryClient.setQueryData(['posts'], newPosts) + +// Or, using an updater function that receives the current data: +queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost]) +``` + ##### Overrides ```ts @@ -1359,7 +1946,7 @@ setQueryData( options?): NoInfer | undefined; ``` -Defined in: [vue-query/src/queryClient.ts:132](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L132) +Defined in: [packages/vue-query/src/queryClient.ts:132](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L132) ##### Type Parameters @@ -1379,11 +1966,11 @@ Defined in: [vue-query/src/queryClient.ts:132](https://github.com/TanStack/query ###### updater -`Updater`\<`NoInfer`\<`TData`\> \| `undefined`, `NoInfer`\<`TData`\> \| `undefined`\> +[`Updater`](../type-aliases/Updater.md)\<`NoInfer`\<`TData`\> \| `undefined`, `NoInfer`\<`TData`\> \| `undefined`\> ###### options? -`MaybeRefDeep`\<`SetDataOptions`\> +`MaybeRefDeep`\<[`SetDataOptions`](../interfaces/SetDataOptions.md)\> ##### Returns @@ -1403,7 +1990,14 @@ QC.setQueryData setQueryDefaults(queryKey, options): void; ``` -Defined in: [vue-query/src/queryClient.ts:575](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L575) +Defined in: [packages/vue-query/src/queryClient.ts:575](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryClient.ts#L575) + +Sets default options for queries whose query key partially matches the given `queryKey`. + +If several registered query defaults match a given query key, they are merged together in +registration order by [QueryClient#getQueryDefaults](#getquerydefaults), so register defaults from the +most generic key to the least generic one — more specific defaults should be registered +after more generic ones so they take precedence. #### Type Parameters @@ -1437,8 +2031,40 @@ Defined in: [vue-query/src/queryClient.ts:575](https://github.com/TanStack/query `void` +#### Example + +```ts +queryClient.setQueryDefaults(['posts'], { queryFn: fetchPosts }) + +await queryClient.query({ queryKey: ['posts'] }) +``` + #### Overrides ```ts QC.setQueryDefaults ``` + +*** + +### unmount() + +```ts +unmount(): void; +``` + +Defined in: [packages/query-core/src/queryClient.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L126) + +The inverse of [QueryClient#mount](#mount) — called by a framework adapter's +`QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online +listeners once the mount count returns to `0`. + +#### Returns + +`void` + +#### Inherited from + +```ts +QC.unmount +``` diff --git a/docs/framework/vue/reference/classes/QueryObserver.md b/docs/framework/vue/reference/classes/QueryObserver.md new file mode 100644 index 00000000000..1e2bae4353a --- /dev/null +++ b/docs/framework/vue/reference/classes/QueryObserver.md @@ -0,0 +1,555 @@ +--- +id: QueryObserver +title: QueryObserver +--- + +Defined in: [packages/query-core/src/queryObserver.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L57) + +A `QueryObserver` watches a single query in the `QueryCache` and computes a +`QueryObserverResult` from its state, recomputing and notifying subscribers +whenever the underlying query (or the observer's options) changes. It is +the primitive that framework adapters (e.g. `useQuery`) build their hooks +on top of, but it can also be used directly to observe and switch between +queries outside of any framework. + +## Example + +```ts +const observer = new QueryObserver(queryClient, { + queryKey: ['posts'], + queryFn: fetchPosts, +}) + +const unsubscribe = observer.subscribe((result) => { + console.log(result.data) +}) +``` + +## Extends + +- `Subscribable`\<`QueryObserverListener`\<`TData`, `TError`\>\> + +## Extended by + +- [`InfiniteQueryObserver`](InfiniteQueryObserver.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Constructors + +### Constructor + +```ts +new QueryObserver(client, options): QueryObserver; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L87) + +#### Parameters + +##### client + +`QueryClient` + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`QueryObserver`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Overrides + +```ts +Subscribable>.constructor +``` + +## Properties + +### listeners + +```ts +protected listeners: Set>; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +*** + +### options + +```ts +options: QueryObserverOptions; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L89) + +## Methods + +### bindMethods() + +```ts +protected bindMethods(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L106) + +#### Returns + +`void` + +*** + +### createResult() + +```ts +protected createResult(query, options): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:559](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L559) + +#### Parameters + +##### query + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L161) + +Stops observing the current query: clears all listeners, cancels the +stale and refetch-interval timers, and removes this observer from the +query it was observing. + +#### Returns + +`void` + +*** + +### fetch() + +```ts +protected fetch(fetchOptions): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L448) + +#### Parameters + +##### fetchOptions + +`ObserverFetchOptions` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchOptimistic() + +```ts +fetchOptimistic(options): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:395](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L395) + +Fetches a query defined by the given options without affecting this +observer's own tracked query or result, and returns a promise that +resolves with the `QueryObserverResult` for that fetch. This is useful +for prefetching data that another observer (e.g. a query about to be +navigated to) will need, ahead of time. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.fetchOptimistic({ + queryKey: ['posts', 2], + queryFn: () => fetchPost(2), +}) +console.log(result.data) +``` + +*** + +### getCurrentQuery() + +```ts +getCurrentQuery(): Query; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:357](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L357) + +Returns the `Query` instance this observer is currently observing. + +#### Returns + +[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> + +*** + +### getCurrentResult() + +```ts +getCurrentResult(): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L321) + +Returns the most recently computed `QueryObserverResult` for the +observed query. This is a point-in-time read; to be notified of updates +as they happen, subscribe to the observer instead (its inherited +`subscribe` method). + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +#### Example + +```ts +const result = observer.getCurrentResult() +console.log(result.status, result.data) +``` + +*** + +### getOptimisticResult() + +```ts +getOptimisticResult(options): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L272) + +Computes the result the observer would produce for the given (already-defaulted) options +right now, building the underlying `Query` if it doesn't exist yet, without waiting for a +subscription callback. Called by framework adapters on every render (e.g. `useQuery`) so the +returned value is available synchronously, ahead of `setOptions` triggering an actual fetch. + +#### Parameters + +##### options + +[`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L110) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L124) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### refetch() + +```ts +refetch(__namedParameters): Promise>; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L371) + +Refetches the observed query and returns a promise that resolves with +the resulting `QueryObserverResult`. + +#### Parameters + +##### \_\_namedParameters + +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Example + +```ts +const result = await observer.refetch({ cancelRefetch: false }) +console.log(result.data) +``` + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L182) + +Updates the observer's options. This will re-resolve the query being +observed (switching to a different query if the `queryKey` changed), +trigger a fetch if the new options require one and the observer has +subscribers, recompute the current result, and reschedule the stale and +refetch-interval timers as needed. + +#### Parameters + +##### options + +[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\> + +#### Returns + +`void` + +#### Example + +```ts +observer.setOptions({ queryKey: ['posts', 1], queryFn: () => fetchPost(1) }) +// later: switch to a different query, reusing the same observer +observer.setOptions({ queryKey: ['posts', 2], queryFn: () => fetchPost(2) }) +``` + +*** + +### shouldFetchOnReconnect() + +```ts +shouldFetchOnReconnect(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L135) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnReconnect` option) to refetch when the network +reconnects. + +#### Returns + +`boolean` + +*** + +### shouldFetchOnWindowFocus() + +```ts +shouldFetchOnWindowFocus(): boolean; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L148) + +Returns whether the observed query is currently stale and configured +(via the `refetchOnWindowFocus` option) to refetch when the window +regains focus. + +#### Returns + +`boolean` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`QueryObserverListener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` + +*** + +### trackProp() + +```ts +trackProp(key): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:350](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L350) + +Records that the given `QueryObserverResult` property was read, so a subsequent update only +notifies this observer if a tracked property actually changed. Normally called indirectly via +[QueryObserver#trackResult](#trackresult)'s proxy; exposed directly for adapters that track property +access themselves (e.g. through their own reactivity system) instead of via the proxy. + +#### Parameters + +##### key + +`"error"` | `"data"` | `"isError"` | `"isPending"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isSuccess"` | `"isPlaceholderData"` | `"status"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` + +#### Returns + +`void` + +*** + +### trackResult() + +```ts +trackResult(result, onPropTracked?): QueryObserverResult; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:331](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L331) + +Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via +[QueryObserver#trackProp](#trackprop) (and an optional `onPropTracked` callback). Used by framework +adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on +properties you actually read" behavior. + +#### Parameters + +##### result + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +##### onPropTracked? + +(`key`) => `void` + +#### Returns + +[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\> + +*** + +### updateResult() + +```ts +updateResult(): void; +``` + +Defined in: [packages/query-core/src/queryObserver.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L735) + +Recomputes and stores the current result from the current query/options, notifying listeners +if it changed. Framework adapters call this right after subscribing to make sure no query +update was missed in the gap between creating the observer and subscribing to it. + +#### Returns + +`void` diff --git a/docs/framework/vue/reference/functions/defaultShouldDehydrateMutation.md b/docs/framework/vue/reference/functions/defaultShouldDehydrateMutation.md new file mode 100644 index 00000000000..095ccf36e7c --- /dev/null +++ b/docs/framework/vue/reference/functions/defaultShouldDehydrateMutation.md @@ -0,0 +1,23 @@ +--- +id: defaultShouldDehydrateMutation +title: defaultShouldDehydrateMutation +--- + +```ts +function defaultShouldDehydrateMutation(mutation): boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L180) + +The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are +currently paused (e.g. paused by `networkMode` while offline). + +## Parameters + +### mutation + +[`Mutation`](../classes/Mutation.md) + +## Returns + +`boolean` diff --git a/docs/framework/vue/reference/functions/defaultShouldDehydrateQuery.md b/docs/framework/vue/reference/functions/defaultShouldDehydrateQuery.md new file mode 100644 index 00000000000..06afc29d670 --- /dev/null +++ b/docs/framework/vue/reference/functions/defaultShouldDehydrateQuery.md @@ -0,0 +1,23 @@ +--- +id: defaultShouldDehydrateQuery +title: defaultShouldDehydrateQuery +--- + +```ts +function defaultShouldDehydrateQuery(query): boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:188](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L188) + +The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is +`'success'`. + +## Parameters + +### query + +[`Query`](../classes/Query.md) + +## Returns + +`boolean` diff --git a/docs/framework/vue/reference/functions/dehydrate.md b/docs/framework/vue/reference/functions/dehydrate.md new file mode 100644 index 00000000000..451c558858c --- /dev/null +++ b/docs/framework/vue/reference/functions/dehydrate.md @@ -0,0 +1,43 @@ +--- +id: dehydrate +title: dehydrate +--- + +```ts +function dehydrate(client, options): DehydratedState; +``` + +Defined in: [packages/query-core/src/hydration.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L210) + +Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`, +typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`. +Which queries/mutations are included, and how their data/errors are transformed, is controlled by `options`, +falling back to the client's `dehydrate` default options, and finally to `defaultShouldDehydrateQuery` / +`defaultShouldDehydrateMutation`. + +## Parameters + +### client + +`QueryClient` + +### options + +[`DehydrateOptions`](../interfaces/DehydrateOptions.md) = `{}` + +## Returns + +[`DehydratedState`](../interfaces/DehydratedState.md) + +## Example + +```ts +const queryClient = new QueryClient() + +await queryClient.prefetchQuery({ + queryKey: ['posts'], + queryFn: getPosts, +}) + +const dehydratedState = dehydrate(queryClient) +``` diff --git a/docs/framework/vue/reference/functions/dehydrateQuery.md b/docs/framework/vue/reference/functions/dehydrateQuery.md new file mode 100644 index 00000000000..2827d2ebb45 --- /dev/null +++ b/docs/framework/vue/reference/functions/dehydrateQuery.md @@ -0,0 +1,43 @@ +--- +id: dehydrateQuery +title: dehydrateQuery +--- + +```ts +function dehydrateQuery( + query, + serializeData?, + shouldRedactErrors?): DehydratedQuery; +``` + +Defined in: [packages/query-core/src/hydration.ts:151](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L151) + +Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g. +`queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the +de/rehydrated data, typically with `useQuery` on the client. If the query is still `pending`, its in-flight +promise is dehydrated too so it can be resumed on the other side instead of re-fetched. + +## Parameters + +### query + +[`Query`](../classes/Query.md) + +The query to dehydrate. + +### serializeData? + +`TransformerFn` + +Optional transform applied to `query.state.data` before it is included in the snapshot. + +### shouldRedactErrors? + +(`error`) => `boolean` + +Optional predicate; if it returns `false` for the promise's rejection error, that +error is kept as-is instead of being redacted. + +## Returns + +`DehydratedQuery` diff --git a/docs/framework/vue/reference/functions/experimental_streamedQuery.md b/docs/framework/vue/reference/functions/experimental_streamedQuery.md new file mode 100644 index 00000000000..afd44df7c5f --- /dev/null +++ b/docs/framework/vue/reference/functions/experimental_streamedQuery.md @@ -0,0 +1,52 @@ +--- +id: experimental_streamedQuery +title: experimental_streamedQuery +--- + +```ts +function experimental_streamedQuery(queryFn): QueryFunction; +``` + +Defined in: [packages/query-core/src/streamedQuery.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L60) + +This is a helper function to create a query function that streams data from an AsyncIterable. +Data will be an Array of all the chunks received. +The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. +The query will stay in fetchStatus 'fetching' until the stream ends. + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TData + +`TData` = `TQueryFnData`[] + +### TQueryKey + +`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[] + +## Parameters + +### queryFn + +`StreamedQueryParams`\<`TQueryFnData`, `TData`, `TQueryKey`\> + +The function that returns an AsyncIterable to stream data from. + +## Returns + +[`QueryFunction`](../type-aliases/QueryFunction.md)\<`TData`, `TQueryKey`\> + +## Example + +```ts +await queryClient.query({ + queryKey: ['data'], + queryFn: streamedQuery({ + streamFn: fetchDataInChunks, + }), +}) +``` diff --git a/docs/framework/vue/reference/functions/hashKey.md b/docs/framework/vue/reference/functions/hashKey.md new file mode 100644 index 00000000000..9e7844aa09d --- /dev/null +++ b/docs/framework/vue/reference/functions/hashKey.md @@ -0,0 +1,30 @@ +--- +id: hashKey +title: hashKey +--- + +```ts +function hashKey(queryKey): string; +``` + +Defined in: [packages/query-core/src/utils.ts:282](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L282) + +Default query & mutation keys hash function. +Hashes the value into a stable hash. + +## Parameters + +### queryKey + +readonly `unknown`[] + +## Returns + +`string` + +## Example + +```ts +// Object keys are sorted, so key order doesn't affect the hash: +hashKey(['todos', { page: 1, filter: 'done' }]) // === '["todos",{"filter":"done","page":1}]' +``` diff --git a/docs/framework/vue/reference/functions/hydrate.md b/docs/framework/vue/reference/functions/hydrate.md new file mode 100644 index 00000000000..1b9ad8025a4 --- /dev/null +++ b/docs/framework/vue/reference/functions/hydrate.md @@ -0,0 +1,49 @@ +--- +id: hydrate +title: hydrate +--- + +```ts +function hydrate( + client, + dehydratedState, + options?): void; +``` + +Defined in: [packages/query-core/src/hydration.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L267) + +Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the +client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`. +Queries not yet in the cache are built from the dehydrated snapshot; queries that already exist are only updated +when the dehydrated data is newer than what's already cached. Newly built queries have their `fetchStatus` reset +to `'idle'` so they don't hydrate stuck in a fetching state. If a dehydrated query still had an in-flight +promise, it is resumed via `query.fetch()` (reusing that promise as `initialPromise`) rather than re-invoking +`queryFn`. + +## Parameters + +### client + +`QueryClient` + +### dehydratedState + +`Partial`\<[`DehydratedState`](../interfaces/DehydratedState.md)\> + +### options? + +[`HydrateOptions`](../interfaces/HydrateOptions.md) + +## Returns + +`void` + +## Example + +```ts +// dehydratedState was produced by `dehydrate` on the server +// and sent to the client, e.g. embedded in server-rendered markup. +const queryClient = new QueryClient() + +hydrate(queryClient, dehydratedState) +``` diff --git a/docs/framework/vue/reference/functions/infiniteQueryOptions.md b/docs/framework/vue/reference/functions/infiniteQueryOptions.md index 564d4cc8258..d3bd0bef5fd 100644 --- a/docs/framework/vue/reference/functions/infiniteQueryOptions.md +++ b/docs/framework/vue/reference/functions/infiniteQueryOptions.md @@ -9,7 +9,7 @@ title: infiniteQueryOptions function infiniteQueryOptions(options): UndefinedInitialDataInfiniteOptions & QueryKeyWithDataTag, TError>; ``` -Defined in: [vue-query/src/infiniteQueryOptions.ts:99](https://github.com/TanStack/query/blob/main/packages/vue-query/src/infiniteQueryOptions.ts#L99) +Defined in: [packages/vue-query/src/infiniteQueryOptions.ts:99](https://github.com/TanStack/query/blob/main/packages/vue-query/src/infiniteQueryOptions.ts#L99) You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`. @@ -27,7 +27,7 @@ These options can be shared across hooks and imperative APIs such as `queryClien #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -48,7 +48,7 @@ The [UndefinedInitialDataInfiniteOptions](../type-aliases/UndefinedInitialDataIn ### Returns -[`UndefinedInitialDataInfiniteOptions`](../type-aliases/UndefinedInitialDataInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `QueryKeyWithDataTag`\<`TQueryKey`, `InfiniteData`\<`TQueryFnData`, `unknown`\>, `TError`\> +[`UndefinedInitialDataInfiniteOptions`](../type-aliases/UndefinedInitialDataInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & [`QueryKeyWithDataTag`](../type-aliases/QueryKeyWithDataTag.md)\<`TQueryKey`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>, `TError`\> The same options object, typed so that `queryKey` carries the inferred data type. @@ -79,7 +79,7 @@ const { data, isError, error, fetchNextPage } = useInfiniteQuery(projectsOptions function infiniteQueryOptions(options): DefinedInitialDataInfiniteOptions & QueryKeyWithDataTag, TError>; ``` -Defined in: [vue-query/src/infiniteQueryOptions.ts:153](https://github.com/TanStack/query/blob/main/packages/vue-query/src/infiniteQueryOptions.ts#L153) +Defined in: [packages/vue-query/src/infiniteQueryOptions.ts:153](https://github.com/TanStack/query/blob/main/packages/vue-query/src/infiniteQueryOptions.ts#L153) You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`. @@ -99,7 +99,7 @@ This overload is selected when `initialData` is set, so the resulting `data` is #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -120,7 +120,7 @@ The [DefinedInitialDataInfiniteOptions](../type-aliases/DefinedInitialDataInfini ### Returns -[`DefinedInitialDataInfiniteOptions`](../type-aliases/DefinedInitialDataInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `QueryKeyWithDataTag`\<`TQueryKey`, `InfiniteData`\<`TQueryFnData`, `unknown`\>, `TError`\> +[`DefinedInitialDataInfiniteOptions`](../type-aliases/DefinedInitialDataInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & [`QueryKeyWithDataTag`](../type-aliases/QueryKeyWithDataTag.md)\<`TQueryKey`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>, `TError`\> The same options object, typed so that `queryKey` carries the inferred data type. diff --git a/docs/framework/vue/reference/functions/isCancelledError.md b/docs/framework/vue/reference/functions/isCancelledError.md new file mode 100644 index 00000000000..c8f57c4b94d --- /dev/null +++ b/docs/framework/vue/reference/functions/isCancelledError.md @@ -0,0 +1,24 @@ +--- +id: isCancelledError +title: isCancelledError +--- + +```ts +function isCancelledError(value): value is CancelledError; +``` + +Defined in: [packages/query-core/src/retryer.ts:90](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L90) + +## Parameters + +### value + +`any` + +## Returns + +`value is CancelledError` + +## Deprecated + +Use instanceof `CancelledError` instead. diff --git a/docs/framework/vue/reference/functions/keepPreviousData.md b/docs/framework/vue/reference/functions/keepPreviousData.md new file mode 100644 index 00000000000..d41c7d7c726 --- /dev/null +++ b/docs/framework/vue/reference/functions/keepPreviousData.md @@ -0,0 +1,40 @@ +--- +id: keepPreviousData +title: keepPreviousData +--- + +```ts +function keepPreviousData(previousData): T | undefined; +``` + +Defined in: [packages/query-core/src/utils.ts:491](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L491) + +Intended to be passed as a query's `placeholderData` option, for example +`placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new +query key is fetching, it keeps displaying the previously fetched data until the new data arrives. + +## Type Parameters + +### T + +`T` + +## Parameters + +### previousData + +`T` | `undefined` + +## Returns + +`T` \| `undefined` + +## Example + +```ts +new QueryObserver(queryClient, { + queryKey: ['posts', page], + queryFn: () => fetchPosts(page), + placeholderData: keepPreviousData, +}) +``` diff --git a/docs/framework/vue/reference/functions/matchMutation.md b/docs/framework/vue/reference/functions/matchMutation.md new file mode 100644 index 00000000000..ec5e171547d --- /dev/null +++ b/docs/framework/vue/reference/functions/matchMutation.md @@ -0,0 +1,38 @@ +--- +id: matchMutation +title: matchMutation +--- + +```ts +function matchMutation(filters, mutation): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:235](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L235) + +Checks whether a mutation matches the given [MutationFilters](../type-aliases/MutationFilters.md). +Every filter that is specified must match; filters that are left unspecified are ignored. +If a `mutationKey` filter is provided but the mutation has no `mutationKey` of its own, it does not match. + +## Parameters + +### filters + +`MutationFilters` + +### mutation + +[`Mutation`](../classes/Mutation.md)\<`any`, `any`\> + +## Returns + +`boolean` + +## Example + +```ts +const mutationCache = queryClient.getMutationCache() + +const matchingMutations = mutationCache + .getAll() + .filter((mutation) => matchMutation({ mutationKey: ['addPost'] }, mutation)) +``` diff --git a/docs/framework/vue/reference/functions/matchQuery.md b/docs/framework/vue/reference/functions/matchQuery.md new file mode 100644 index 00000000000..793edf87117 --- /dev/null +++ b/docs/framework/vue/reference/functions/matchQuery.md @@ -0,0 +1,37 @@ +--- +id: matchQuery +title: matchQuery +--- + +```ts +function matchQuery(filters, query): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L173) + +Checks whether a query matches the given [QueryFilters](../type-aliases/QueryFilters.md). +Every filter that is specified must match; filters that are left unspecified are ignored. + +## Parameters + +### filters + +`QueryFilters` + +### query + +[`Query`](../classes/Query.md)\<`any`, `any`, `any`, `any`\> + +## Returns + +`boolean` + +## Example + +```ts +const queryCache = queryClient.getQueryCache() + +const matchingQueries = queryCache + .getAll() + .filter((query) => matchQuery({ queryKey: ['posts'] }, query)) +``` diff --git a/docs/framework/vue/reference/functions/mutationOptions.md b/docs/framework/vue/reference/functions/mutationOptions.md index fdf3af339b7..04c7166203b 100644 --- a/docs/framework/vue/reference/functions/mutationOptions.md +++ b/docs/framework/vue/reference/functions/mutationOptions.md @@ -9,7 +9,7 @@ title: mutationOptions function mutationOptions(options): WithRequired, "mutationKey">; ``` -Defined in: [vue-query/src/mutationOptions.ts:34](https://github.com/TanStack/query/blob/main/packages/vue-query/src/mutationOptions.ts#L34) +Defined in: [packages/vue-query/src/mutationOptions.ts:34](https://github.com/TanStack/query/blob/main/packages/vue-query/src/mutationOptions.ts#L34) You can generally pass everything to `mutationOptions` that you can also pass to `useMutation`. A `mutationKey` is required on this overload so the mutation can be looked up later, e.g. with @@ -37,14 +37,14 @@ You can generally pass everything to `mutationOptions` that you can also pass to #### options -`WithRequired`\<[`MutationOptions`](../type-aliases/MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> +[`WithRequired`](../type-aliases/WithRequired.md)\<[`MutationOptions`](../type-aliases/MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> The mutation options to use, identical to what you'd pass to `useMutation`, with a required `mutationKey`. ### Returns -`WithRequired`\<[`MutationOptions`](../type-aliases/MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> +[`WithRequired`](../type-aliases/WithRequired.md)\<[`MutationOptions`](../type-aliases/MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> The same options object, unchanged. @@ -79,7 +79,7 @@ const isCreatingPost = computed(() => creatingPosts.value.length > 0) function mutationOptions(options): () => WithRequired, "mutationKey">; ``` -Defined in: [vue-query/src/mutationOptions.ts:80](https://github.com/TanStack/query/blob/main/packages/vue-query/src/mutationOptions.ts#L80) +Defined in: [packages/vue-query/src/mutationOptions.ts:80](https://github.com/TanStack/query/blob/main/packages/vue-query/src/mutationOptions.ts#L80) Same as the plain-object overload with a required `mutationKey`, but for options that close over reactive state (`ref`s read inside the function body). Wrap them in a getter so `useMutation` and the other consumers @@ -107,7 +107,7 @@ always read the current values instead of the ones captured when the options wer #### options -() => `WithRequired`\<[`MutationOptions`](../type-aliases/MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> +() => [`WithRequired`](../type-aliases/WithRequired.md)\<[`MutationOptions`](../type-aliases/MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> A function returning the mutation options to use, with a required `mutationKey`, re-evaluated on demand. @@ -122,7 +122,7 @@ A function that returns the same options object, unchanged. #### Returns -`WithRequired`\<[`MutationOptions`](../type-aliases/MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> +[`WithRequired`](../type-aliases/WithRequired.md)\<[`MutationOptions`](../type-aliases/MutationOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\> ### See @@ -156,7 +156,7 @@ const mutation = useMutation(createPostOptions) function mutationOptions(options): Omit, "mutationKey">; ``` -Defined in: [vue-query/src/mutationOptions.ts:124](https://github.com/TanStack/query/blob/main/packages/vue-query/src/mutationOptions.ts#L124) +Defined in: [packages/vue-query/src/mutationOptions.ts:124](https://github.com/TanStack/query/blob/main/packages/vue-query/src/mutationOptions.ts#L124) You can generally pass everything to `mutationOptions` that you can also pass to `useMutation`. No `mutationKey` is required on this overload — use this when you don't need to target the mutation via a @@ -228,7 +228,7 @@ const mutation = useMutation(createPostOptions) function mutationOptions(options): () => Omit, "mutationKey">; ``` -Defined in: [vue-query/src/mutationOptions.ts:169](https://github.com/TanStack/query/blob/main/packages/vue-query/src/mutationOptions.ts#L169) +Defined in: [packages/vue-query/src/mutationOptions.ts:169](https://github.com/TanStack/query/blob/main/packages/vue-query/src/mutationOptions.ts#L169) Same as the plain-object overload without a `mutationKey`, but for options that close over reactive state (`ref`s read inside the function body). Wrap them in a getter so `useMutation` and the other consumers diff --git a/docs/framework/vue/reference/functions/noop.md b/docs/framework/vue/reference/functions/noop.md new file mode 100644 index 00000000000..fd1b8dc2ad0 --- /dev/null +++ b/docs/framework/vue/reference/functions/noop.md @@ -0,0 +1,32 @@ +--- +id: noop +title: noop +--- + +## Call Signature + +```ts +function noop(): void; +``` + +Defined in: [packages/query-core/src/utils.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L117) + +A function that does nothing. + +### Returns + +`void` + +## Call Signature + +```ts +function noop(): undefined; +``` + +Defined in: [packages/query-core/src/utils.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L118) + +A function that does nothing. + +### Returns + +`undefined` diff --git a/docs/framework/vue/reference/functions/partialMatchKey.md b/docs/framework/vue/reference/functions/partialMatchKey.md new file mode 100644 index 00000000000..3795de85b95 --- /dev/null +++ b/docs/framework/vue/reference/functions/partialMatchKey.md @@ -0,0 +1,26 @@ +--- +id: partialMatchKey +title: partialMatchKey +--- + +```ts +function partialMatchKey(a, b): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L298) + +Checks if key `b` partially matches with key `a`. + +## Parameters + +### a + +readonly `unknown`[] + +### b + +readonly `unknown`[] + +## Returns + +`boolean` diff --git a/docs/framework/vue/reference/functions/queryOptions.md b/docs/framework/vue/reference/functions/queryOptions.md index 812e61478e0..2745dfdd55e 100644 --- a/docs/framework/vue/reference/functions/queryOptions.md +++ b/docs/framework/vue/reference/functions/queryOptions.md @@ -9,7 +9,7 @@ title: queryOptions function queryOptions(options): DefinedInitialQueryOptionsWithDataTag; ``` -Defined in: [vue-query/src/queryOptions.ts:168](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryOptions.ts#L168) +Defined in: [packages/vue-query/src/queryOptions.ts:168](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryOptions.ts#L168) You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and @@ -78,7 +78,7 @@ const { data, isError, error } = useQuery(postsOptions) function queryOptions(options): () => DefinedInitialQueryOptionsWithDataTag; ``` -Defined in: [vue-query/src/queryOptions.ts:205](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryOptions.ts#L205) +Defined in: [packages/vue-query/src/queryOptions.ts:205](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryOptions.ts#L205) Same as the plain-object overload, but for options that close over reactive state (`ref`s read inside the function body). Wrap them in a getter so `queryClient` methods like `invalidateQueries`/`fetchQuery` always @@ -152,7 +152,7 @@ const { data } = useQuery(postOptions) function queryOptions(options): UndefinedInitialQueryOptionsWithDataTag; ``` -Defined in: [vue-query/src/queryOptions.ts:250](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryOptions.ts#L250) +Defined in: [packages/vue-query/src/queryOptions.ts:250](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryOptions.ts#L250) You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and @@ -218,7 +218,7 @@ const { data, isPending, isError, error } = useQuery(postOptions('1')) function queryOptions(options): () => UndefinedInitialQueryOptionsWithDataTag; ``` -Defined in: [vue-query/src/queryOptions.ts:316](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryOptions.ts#L316) +Defined in: [packages/vue-query/src/queryOptions.ts:316](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryOptions.ts#L316) Same as the plain-object overload, but for options that close over reactive state (`ref`s read inside the function body). Wrap them in a getter so the `queryKey` — and anything else derived from a `ref` — reacts diff --git a/docs/framework/vue/reference/functions/replaceEqualDeep.md b/docs/framework/vue/reference/functions/replaceEqualDeep.md new file mode 100644 index 00000000000..77a393196ef --- /dev/null +++ b/docs/framework/vue/reference/functions/replaceEqualDeep.md @@ -0,0 +1,41 @@ +--- +id: replaceEqualDeep +title: replaceEqualDeep +--- + +```ts +function replaceEqualDeep( + a, + b, + depth?): T; +``` + +Defined in: [packages/query-core/src/utils.ts:337](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L337) + +This function returns `a` if `b` is deeply equal. +If not, it will replace any deeply equal children of `b` with those of `a`. +This can be used for structural sharing between JSON values for example. + +## Type Parameters + +### T + +`T` + +## Parameters + +### a + +`unknown` + +### b + +`T` + +### depth? + +`number` + +## Returns + +`T` diff --git a/docs/framework/vue/reference/functions/shouldThrowError.md b/docs/framework/vue/reference/functions/shouldThrowError.md new file mode 100644 index 00000000000..3146617391e --- /dev/null +++ b/docs/framework/vue/reference/functions/shouldThrowError.md @@ -0,0 +1,45 @@ +--- +id: shouldThrowError +title: shouldThrowError +--- + +```ts +function shouldThrowError(throwOnError, params): boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L574) + +Resolves a `throwOnError` option to a boolean. +If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller, +additional context such as the query or mutation) and its result is returned, allowing the throwing +behavior to be decided per error. Otherwise, `throwOnError` itself is coerced to a boolean (`undefined` +resolves to `false`). + +## Type Parameters + +### T + +`T` *extends* (...`args`) => `boolean` + +## Parameters + +### throwOnError + +`boolean` | `T` | `undefined` + +### params + +`Parameters`\<`T`\> + +## Returns + +`boolean` + +## Example + +```ts +const throwOnError = + query.state.error && typeof options.throwOnError === 'function' + ? shouldThrowError(options.throwOnError, [query.state.error, query]) + : options.throwOnError +``` diff --git a/docs/framework/vue/reference/functions/useInfiniteQuery.md b/docs/framework/vue/reference/functions/useInfiniteQuery.md index c41b2af7691..83f022d402e 100644 --- a/docs/framework/vue/reference/functions/useInfiniteQuery.md +++ b/docs/framework/vue/reference/functions/useInfiniteQuery.md @@ -9,7 +9,7 @@ title: useInfiniteQuery function useInfiniteQuery(options, queryClient?): UseInfiniteQueryReturnType; ``` -Defined in: [vue-query/src/useInfiniteQuery.ts:117](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useInfiniteQuery.ts#L117) +Defined in: [packages/vue-query/src/useInfiniteQuery.ts:117](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useInfiniteQuery.ts#L117) The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`. @@ -32,7 +32,7 @@ individual entries — the array itself can't be a bare getter. #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -106,7 +106,7 @@ const { data, isError, error } = useInfiniteQuery({ function useInfiniteQuery(options, queryClient?): UseInfiniteQueryReturnType; ``` -Defined in: [vue-query/src/useInfiniteQuery.ts:251](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useInfiniteQuery.ts#L251) +Defined in: [packages/vue-query/src/useInfiniteQuery.ts:251](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useInfiniteQuery.ts#L251) The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`. @@ -127,7 +127,7 @@ individual entries — the array itself can't be a bare getter. #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey @@ -269,7 +269,7 @@ onUnmounted(() => observer?.disconnect()) function useInfiniteQuery(options, queryClient?): UseInfiniteQueryReturnType; ``` -Defined in: [vue-query/src/useInfiniteQuery.ts:347](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useInfiniteQuery.ts#L347) +Defined in: [packages/vue-query/src/useInfiniteQuery.ts:347](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useInfiniteQuery.ts#L347) Fallback overload for options whose `initialData` presence isn't statically known — for example, a `ref`/reactive object built up conditionally, rather than a plain object literal. Prefer one of the other @@ -291,7 +291,7 @@ individual entries — the array itself can't be a bare getter. #### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> #### TQueryKey diff --git a/docs/framework/vue/reference/functions/useIsFetching.md b/docs/framework/vue/reference/functions/useIsFetching.md index 3f4a5ea6495..d4b625520a0 100644 --- a/docs/framework/vue/reference/functions/useIsFetching.md +++ b/docs/framework/vue/reference/functions/useIsFetching.md @@ -7,7 +7,7 @@ title: useIsFetching function useIsFetching(fetchingFilters, queryClient?): Ref; ``` -Defined in: [vue-query/src/useIsFetching.ts:52](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useIsFetching.ts#L52) +Defined in: [packages/vue-query/src/useIsFetching.ts:52](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useIsFetching.ts#L52) The `useIsFetching` composable returns a `ref` to the `number` of the queries that your application is loading or fetching in the background (useful for app-wide loading indicators). diff --git a/docs/framework/vue/reference/functions/useIsMutating.md b/docs/framework/vue/reference/functions/useIsMutating.md index fc46618834b..8c61c366387 100644 --- a/docs/framework/vue/reference/functions/useIsMutating.md +++ b/docs/framework/vue/reference/functions/useIsMutating.md @@ -7,7 +7,7 @@ title: useIsMutating function useIsMutating(filters, queryClient?): Ref; ``` -Defined in: [vue-query/src/useMutationState.ts:49](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutationState.ts#L49) +Defined in: [packages/vue-query/src/useMutationState.ts:49](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutationState.ts#L49) The `useIsMutating` composable returns a `ref` to the `number` of mutations that your application currently has `pending` (useful for app-wide loading indicators). diff --git a/docs/framework/vue/reference/functions/useMutation.md b/docs/framework/vue/reference/functions/useMutation.md index 9ec0c218da0..0a749c571ed 100644 --- a/docs/framework/vue/reference/functions/useMutation.md +++ b/docs/framework/vue/reference/functions/useMutation.md @@ -7,7 +7,7 @@ title: useMutation function useMutation(options, queryClient?): UseMutationReturnType; ``` -Defined in: [vue-query/src/useMutation.ts:231](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutation.ts#L231) +Defined in: [packages/vue-query/src/useMutation.ts:231](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutation.ts#L231) Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects. `useMutation` is the composable for that. diff --git a/docs/framework/vue/reference/functions/useMutationState.md b/docs/framework/vue/reference/functions/useMutationState.md index c09346c2d17..5956266c1a3 100644 --- a/docs/framework/vue/reference/functions/useMutationState.md +++ b/docs/framework/vue/reference/functions/useMutationState.md @@ -7,7 +7,7 @@ title: useMutationState function useMutationState(options, queryClient?): Readonly>; ``` -Defined in: [vue-query/src/useMutationState.ts:192](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutationState.ts#L192) +Defined in: [packages/vue-query/src/useMutationState.ts:192](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutationState.ts#L192) `useMutationState` is a composable that gives you access to all mutations in the `MutationCache`. You can pass `filters` ([MutationFilters](../type-aliases/MutationFilters.md)) to narrow down your mutations, and `select` to transform the @@ -20,11 +20,11 @@ themselves depend on other reactive state. ### TResult -`TResult` = `MutationState`\<`unknown`, `Error`, `unknown`, `unknown`\> +`TResult` = [`MutationState`](../interfaces/MutationState.md)\<`unknown`, `Error`, `unknown`, `unknown`\> ### TMutation -`TMutation` *extends* `Mutation`\<`any`, `any`, `any`, `any`\> = `MutationTypeFromResult`\<`TResult`\> +`TMutation` *extends* [`Mutation`](../classes/Mutation.md)\<`any`, `any`, `any`, `any`\> = `MutationTypeFromResult`\<`TResult`\> ## Parameters diff --git a/docs/framework/vue/reference/functions/usePrefetchInfiniteQuery.md b/docs/framework/vue/reference/functions/usePrefetchInfiniteQuery.md index f2278bd02fd..d2c92fe5c44 100644 --- a/docs/framework/vue/reference/functions/usePrefetchInfiniteQuery.md +++ b/docs/framework/vue/reference/functions/usePrefetchInfiniteQuery.md @@ -7,7 +7,7 @@ title: usePrefetchInfiniteQuery function usePrefetchInfiniteQuery(options, queryClient?): void; ``` -Defined in: [vue-query/src/usePrefetchInfiniteQuery.ts:94](https://github.com/TanStack/query/blob/main/packages/vue-query/src/usePrefetchInfiniteQuery.ts#L94) +Defined in: [packages/vue-query/src/usePrefetchInfiniteQuery.ts:94](https://github.com/TanStack/query/blob/main/packages/vue-query/src/usePrefetchInfiniteQuery.ts#L94) `usePrefetchInfiniteQuery` does not return anything — it fires a prefetch as a reactive side effect, useful for kicking off a fetch ahead of the component that will actually render the data with `useInfiniteQuery`. @@ -38,7 +38,7 @@ Fire this during render, before a suspense boundary that wraps a component using ### TData -`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\> ### TQueryKey diff --git a/docs/framework/vue/reference/functions/usePrefetchQuery.md b/docs/framework/vue/reference/functions/usePrefetchQuery.md index 873c8437506..e9c6aa823ec 100644 --- a/docs/framework/vue/reference/functions/usePrefetchQuery.md +++ b/docs/framework/vue/reference/functions/usePrefetchQuery.md @@ -7,7 +7,7 @@ title: usePrefetchQuery function usePrefetchQuery(options, queryClient?): void; ``` -Defined in: [vue-query/src/usePrefetchQuery.ts:86](https://github.com/TanStack/query/blob/main/packages/vue-query/src/usePrefetchQuery.ts#L86) +Defined in: [packages/vue-query/src/usePrefetchQuery.ts:86](https://github.com/TanStack/query/blob/main/packages/vue-query/src/usePrefetchQuery.ts#L86) `usePrefetchQuery` does not return anything — it fires a prefetch as a reactive side effect, useful for kicking off a fetch ahead of the component that will actually render the data with `useQuery`. You can pass diff --git a/docs/framework/vue/reference/functions/useQueries.md b/docs/framework/vue/reference/functions/useQueries.md index cc5c587b8c7..39f4d4229ad 100644 --- a/docs/framework/vue/reference/functions/useQueries.md +++ b/docs/framework/vue/reference/functions/useQueries.md @@ -7,7 +7,7 @@ title: useQueries function useQueries(__namedParameters, queryClient?): Readonly>; ``` -Defined in: [vue-query/src/useQueries.ts:357](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQueries.ts#L357) +Defined in: [packages/vue-query/src/useQueries.ts:357](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQueries.ts#L357) The `useQueries` composable can be used to fetch a variable number of queries. diff --git a/docs/framework/vue/reference/functions/useQuery.md b/docs/framework/vue/reference/functions/useQuery.md index d27c031cdd8..6604d955202 100644 --- a/docs/framework/vue/reference/functions/useQuery.md +++ b/docs/framework/vue/reference/functions/useQuery.md @@ -9,7 +9,7 @@ title: useQuery function useQuery(options, queryClient?): UseQueryDefinedReturnType; ``` -Defined in: [vue-query/src/useQuery.ts:138](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L138) +Defined in: [packages/vue-query/src/useQuery.ts:138](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L138) This overload is selected when `initialData` is set, so the resulting `data` is never `undefined`. @@ -88,7 +88,7 @@ const { data, isError, error } = useQuery({ function useQuery(options, queryClient?): UseQueryReturnType; ``` -Defined in: [vue-query/src/useQuery.ts:279](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L279) +Defined in: [packages/vue-query/src/useQuery.ts:279](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L279) `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as @@ -257,7 +257,7 @@ const { data, isPlaceholderData, isError, error } = useQuery({ function useQuery(options, queryClient?): UseQueryReturnType; ``` -Defined in: [vue-query/src/useQuery.ts:355](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L355) +Defined in: [packages/vue-query/src/useQuery.ts:355](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L355) Fallback overload for options whose `initialData` presence isn't statically known — for example, a `ref`/reactive object built up conditionally, rather than a plain object literal. Prefer one of the other diff --git a/docs/framework/vue/reference/functions/useQueryClient.md b/docs/framework/vue/reference/functions/useQueryClient.md index d605ababd9c..b229c52ef00 100644 --- a/docs/framework/vue/reference/functions/useQueryClient.md +++ b/docs/framework/vue/reference/functions/useQueryClient.md @@ -7,7 +7,7 @@ title: useQueryClient function useQueryClient(id): QueryClient; ``` -Defined in: [vue-query/src/useQueryClient.ts:27](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQueryClient.ts#L27) +Defined in: [packages/vue-query/src/useQueryClient.ts:27](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQueryClient.ts#L27) Retrieves the `QueryClient` installed by `VueQueryPlugin`, via Vue's `inject`. Must be called inside `setup()` or another function that supports an injection context. diff --git a/docs/framework/vue/reference/index.md b/docs/framework/vue/reference/index.md index 00eac42f674..7ed5bdc968f 100644 --- a/docs/framework/vue/reference/index.md +++ b/docs/framework/vue/reference/index.md @@ -5,23 +5,142 @@ title: "@tanstack/vue-query" ## Classes +- [CancelledError](classes/CancelledError.md) +- [InfiniteQueryObserver](classes/InfiniteQueryObserver.md) +- [Mutation](classes/Mutation.md) - [MutationCache](classes/MutationCache.md) +- [MutationObserver](classes/MutationObserver.md) +- [QueriesObserver](classes/QueriesObserver.md) +- [Query](classes/Query.md) - [QueryCache](classes/QueryCache.md) - [QueryClient](classes/QueryClient.md) +- [QueryObserver](classes/QueryObserver.md) + +## Interfaces + +- [CancelOptions](interfaces/CancelOptions.md) +- [DefaultOptions](interfaces/DefaultOptions.md) +- [DehydratedState](interfaces/DehydratedState.md) +- [DehydrateOptions](interfaces/DehydrateOptions.md) +- [~~EnsureQueryDataOptions~~](interfaces/EnsureQueryDataOptions.md) +- [FetchNextPageOptions](interfaces/FetchNextPageOptions.md) +- [FetchPreviousPageOptions](interfaces/FetchPreviousPageOptions.md) +- [~~FetchQueryOptions~~](interfaces/FetchQueryOptions.md) +- [HydrateOptions](interfaces/HydrateOptions.md) +- [InfiniteData](interfaces/InfiniteData.md) +- [InfiniteQueryObserverBaseResult](interfaces/InfiniteQueryObserverBaseResult.md) +- [InfiniteQueryObserverLoadingErrorResult](interfaces/InfiniteQueryObserverLoadingErrorResult.md) +- [InfiniteQueryObserverLoadingResult](interfaces/InfiniteQueryObserverLoadingResult.md) +- [InfiniteQueryObserverOptions](interfaces/InfiniteQueryObserverOptions.md) +- [InfiniteQueryObserverPendingResult](interfaces/InfiniteQueryObserverPendingResult.md) +- [InfiniteQueryObserverPlaceholderResult](interfaces/InfiniteQueryObserverPlaceholderResult.md) +- [InfiniteQueryObserverRefetchErrorResult](interfaces/InfiniteQueryObserverRefetchErrorResult.md) +- [InfiniteQueryObserverSuccessResult](interfaces/InfiniteQueryObserverSuccessResult.md) +- [InfiniteQueryPageParamsOptions](interfaces/InfiniteQueryPageParamsOptions.md) +- [InitialPageParam](interfaces/InitialPageParam.md) +- [InvalidateOptions](interfaces/InvalidateOptions.md) +- [InvalidateQueryFilters](interfaces/InvalidateQueryFilters.md) +- [MutateOptions](interfaces/MutateOptions.md) +- [MutationCacheConfig](interfaces/MutationCacheConfig.md) +- [MutationObserverBaseResult](interfaces/MutationObserverBaseResult.md) +- [MutationObserverErrorResult](interfaces/MutationObserverErrorResult.md) +- [MutationObserverIdleResult](interfaces/MutationObserverIdleResult.md) +- [MutationObserverLoadingResult](interfaces/MutationObserverLoadingResult.md) +- [MutationObserverOptions](interfaces/MutationObserverOptions.md) +- [MutationObserverSuccessResult](interfaces/MutationObserverSuccessResult.md) +- [MutationState](interfaces/MutationState.md) +- [NotifyEvent](interfaces/NotifyEvent.md) +- [QueriesObserverOptions](interfaces/QueriesObserverOptions.md) +- [QueryCacheConfig](interfaces/QueryCacheConfig.md) +- [QueryClientConfig](interfaces/QueryClientConfig.md) +- [QueryExecuteOptions](interfaces/QueryExecuteOptions.md) +- [QueryObserverBaseResult](interfaces/QueryObserverBaseResult.md) +- [QueryObserverLoadingErrorResult](interfaces/QueryObserverLoadingErrorResult.md) +- [QueryObserverLoadingResult](interfaces/QueryObserverLoadingResult.md) +- [QueryObserverOptions](interfaces/QueryObserverOptions.md) +- [QueryObserverPendingResult](interfaces/QueryObserverPendingResult.md) +- [QueryObserverPlaceholderResult](interfaces/QueryObserverPlaceholderResult.md) +- [QueryObserverRefetchErrorResult](interfaces/QueryObserverRefetchErrorResult.md) +- [QueryObserverSuccessResult](interfaces/QueryObserverSuccessResult.md) +- [QueryState](interfaces/QueryState.md) +- [RefetchOptions](interfaces/RefetchOptions.md) +- [RefetchQueryFilters](interfaces/RefetchQueryFilters.md) +- [Register](interfaces/Register.md) +- [ResetOptions](interfaces/ResetOptions.md) +- [ResultOptions](interfaces/ResultOptions.md) +- [SetDataOptions](interfaces/SetDataOptions.md) ## Type Aliases +- [AnyDataTag](type-aliases/AnyDataTag.md) +- [DataTag](type-aliases/DataTag.md) +- [dataTagErrorSymbol](type-aliases/dataTagErrorSymbol.md) +- [dataTagSymbol](type-aliases/dataTagSymbol.md) +- [DefaultedInfiniteQueryObserverOptions](type-aliases/DefaultedInfiniteQueryObserverOptions.md) +- [DefaultedQueryObserverOptions](type-aliases/DefaultedQueryObserverOptions.md) +- [DefaultError](type-aliases/DefaultError.md) +- [DefinedInfiniteQueryObserverResult](type-aliases/DefinedInfiniteQueryObserverResult.md) - [DefinedInitialDataInfiniteOptions](type-aliases/DefinedInitialDataInfiniteOptions.md) - [DefinedInitialQueryOptions](type-aliases/DefinedInitialQueryOptions.md) - [DefinedInitialQueryOptionsWithDataTag](type-aliases/DefinedInitialQueryOptionsWithDataTag.md) +- [DefinedQueryObserverResult](type-aliases/DefinedQueryObserverResult.md) +- [DistributiveOmit](type-aliases/DistributiveOmit.md) +- [~~EnsureInfiniteQueryDataOptions~~](type-aliases/EnsureInfiniteQueryDataOptions.md) +- [~~FetchInfiniteQueryOptions~~](type-aliases/FetchInfiniteQueryOptions.md) +- [FetchStatus](type-aliases/FetchStatus.md) +- [GetNextPageParamFunction](type-aliases/GetNextPageParamFunction.md) +- [GetPreviousPageParamFunction](type-aliases/GetPreviousPageParamFunction.md) +- [InferDataFromTag](type-aliases/InferDataFromTag.md) +- [InferErrorFromTag](type-aliases/InferErrorFromTag.md) +- [InfiniteQueryExecuteOptions](type-aliases/InfiniteQueryExecuteOptions.md) +- [InfiniteQueryObserverResult](type-aliases/InfiniteQueryObserverResult.md) +- [InitialDataFunction](type-aliases/InitialDataFunction.md) +- [ManagedTimerId](type-aliases/ManagedTimerId.md) +- [MutateFunction](type-aliases/MutateFunction.md) +- [MutateFunctionRest](type-aliases/MutateFunctionRest.md) +- [MutationCacheNotifyEvent](type-aliases/MutationCacheNotifyEvent.md) - [MutationFilters](type-aliases/MutationFilters.md) +- [MutationFunction](type-aliases/MutationFunction.md) +- [MutationFunctionContext](type-aliases/MutationFunctionContext.md) +- [MutationKey](type-aliases/MutationKey.md) +- [MutationMeta](type-aliases/MutationMeta.md) +- [MutationObserverResult](type-aliases/MutationObserverResult.md) - [MutationOptions](type-aliases/MutationOptions.md) +- [MutationScope](type-aliases/MutationScope.md) - [MutationStateOptions](type-aliases/MutationStateOptions.md) +- [MutationStatus](type-aliases/MutationStatus.md) +- [NetworkMode](type-aliases/NetworkMode.md) +- [NonUndefinedGuard](type-aliases/NonUndefinedGuard.md) +- [NotifyEventType](type-aliases/NotifyEventType.md) +- [NotifyOnChangeProps](type-aliases/NotifyOnChangeProps.md) +- [OmitKeyof](type-aliases/OmitKeyof.md) +- [Override](type-aliases/Override.md) +- [PlaceholderDataFunction](type-aliases/PlaceholderDataFunction.md) +- [QueriesPlaceholderDataFunction](type-aliases/QueriesPlaceholderDataFunction.md) +- [QueryBooleanOption](type-aliases/QueryBooleanOption.md) +- [QueryCacheNotifyEvent](type-aliases/QueryCacheNotifyEvent.md) - [QueryFilters](type-aliases/QueryFilters.md) +- [QueryFunction](type-aliases/QueryFunction.md) +- [QueryFunctionContext](type-aliases/QueryFunctionContext.md) +- [QueryKey](type-aliases/QueryKey.md) +- [QueryKeyHashFunction](type-aliases/QueryKeyHashFunction.md) +- [QueryKeyWithDataTag](type-aliases/QueryKeyWithDataTag.md) +- [QueryMeta](type-aliases/QueryMeta.md) +- [QueryObserverResult](type-aliases/QueryObserverResult.md) - [QueryOptions](type-aliases/QueryOptions.md) +- [QueryPersister](type-aliases/QueryPersister.md) +- [QueryStatus](type-aliases/QueryStatus.md) +- [SkipToken](type-aliases/SkipToken.md) +- [StaleTime](type-aliases/StaleTime.md) +- [StaleTimeFunction](type-aliases/StaleTimeFunction.md) +- [ThrowOnError](type-aliases/ThrowOnError.md) +- [TimeoutCallback](type-aliases/TimeoutCallback.md) +- [TimeoutProvider](type-aliases/TimeoutProvider.md) - [UndefinedInitialDataInfiniteOptions](type-aliases/UndefinedInitialDataInfiniteOptions.md) - [UndefinedInitialQueryOptions](type-aliases/UndefinedInitialQueryOptions.md) - [UndefinedInitialQueryOptionsWithDataTag](type-aliases/UndefinedInitialQueryOptionsWithDataTag.md) +- [UnsetMarker](type-aliases/UnsetMarker.md) +- [Updater](type-aliases/Updater.md) - [UseInfiniteQueryOptions](type-aliases/UseInfiniteQueryOptions.md) - [UseInfiniteQueryReturnType](type-aliases/UseInfiniteQueryReturnType.md) - [UseMutationOptions](type-aliases/UseMutationOptions.md) @@ -34,16 +153,43 @@ title: "@tanstack/vue-query" - [UseQueryOptions](type-aliases/UseQueryOptions.md) - [UseQueryReturnType](type-aliases/UseQueryReturnType.md) - [VueQueryPluginOptions](type-aliases/VueQueryPluginOptions.md) +- [WithRequired](type-aliases/WithRequired.md) ## Variables +- [dataTagErrorSymbol](variables/dataTagErrorSymbol.md) +- [dataTagSymbol](variables/dataTagSymbol.md) +- [defaultScheduler](variables/defaultScheduler.md) +- [environmentManager](variables/environmentManager.md) +- [focusManager](variables/focusManager.md) +- [~~isServer~~](variables/isServer.md) +- [notifyManager](variables/notifyManager.md) +- [onlineManager](variables/onlineManager.md) +- [skipToken](variables/skipToken.md) +- [timeoutManager](variables/timeoutManager.md) +- [unsetMarker](variables/unsetMarker.md) - [VueQueryPlugin](variables/VueQueryPlugin.md) ## Functions +- [defaultShouldDehydrateMutation](functions/defaultShouldDehydrateMutation.md) +- [defaultShouldDehydrateQuery](functions/defaultShouldDehydrateQuery.md) +- [dehydrate](functions/dehydrate.md) +- [dehydrateQuery](functions/dehydrateQuery.md) +- [experimental\_streamedQuery](functions/experimental_streamedQuery.md) +- [hashKey](functions/hashKey.md) +- [hydrate](functions/hydrate.md) - [infiniteQueryOptions](functions/infiniteQueryOptions.md) +- [~~isCancelledError~~](functions/isCancelledError.md) +- [keepPreviousData](functions/keepPreviousData.md) +- [matchMutation](functions/matchMutation.md) +- [matchQuery](functions/matchQuery.md) - [mutationOptions](functions/mutationOptions.md) +- [noop](functions/noop.md) +- [partialMatchKey](functions/partialMatchKey.md) - [queryOptions](functions/queryOptions.md) +- [replaceEqualDeep](functions/replaceEqualDeep.md) +- [shouldThrowError](functions/shouldThrowError.md) - [useInfiniteQuery](functions/useInfiniteQuery.md) - [useIsFetching](functions/useIsFetching.md) - [useIsMutating](functions/useIsMutating.md) diff --git a/docs/framework/vue/reference/interfaces/CancelOptions.md b/docs/framework/vue/reference/interfaces/CancelOptions.md new file mode 100644 index 00000000000..2b9293712d2 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/CancelOptions.md @@ -0,0 +1,26 @@ +--- +id: CancelOptions +title: CancelOptions +--- + +Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) + +## Properties + +### revert? + +```ts +optional revert: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1444) + +*** + +### silent? + +```ts +optional silent: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1445](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1445) diff --git a/docs/framework/vue/reference/interfaces/DefaultOptions.md b/docs/framework/vue/reference/interfaces/DefaultOptions.md new file mode 100644 index 00000000000..149ef5b3444 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/DefaultOptions.md @@ -0,0 +1,76 @@ +--- +id: DefaultOptions +title: DefaultOptions +--- + +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) + +## Type Parameters + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### dehydrate? + +```ts +optional dehydrate: DehydrateOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) + +*** + +### hydrate? + +```ts +optional hydrate: object; +``` + +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) + +#### deserializeData? + +```ts +optional deserializeData: TransformerFn; +``` + +Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. + +#### mutations? + +```ts +optional mutations: MutationOptions; +``` + +Default options merged into every mutation restored from the dehydrated state. + +#### queries? + +```ts +optional queries: QueryOptions; +``` + +Default options merged into every query restored from the dehydrated state. + +*** + +### mutations? + +```ts +optional mutations: MutationObserverOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) + +*** + +### queries? + +```ts +optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; +``` + +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) diff --git a/docs/framework/vue/reference/interfaces/DehydrateOptions.md b/docs/framework/vue/reference/interfaces/DehydrateOptions.md new file mode 100644 index 00000000000..e862ae88b43 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/DehydrateOptions.md @@ -0,0 +1,89 @@ +--- +id: DehydrateOptions +title: DehydrateOptions +--- + +Defined in: [packages/query-core/src/hydration.ts:42](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L42) + +Options for `dehydrate`, controlling which queries/mutations are included in the resulting `DehydratedState` and +how their data/errors are transformed before being serialized (e.g. for embedding in server-rendered markup). + +## Properties + +### serializeData? + +```ts +optional serializeData: TransformerFn; +``` + +Defined in: [packages/query-core/src/hydration.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L44) + +Transforms a query's `data` before it is dehydrated. Useful for non-JSON-serializable data. + +*** + +### shouldDehydrateMutation()? + +```ts +optional shouldDehydrateMutation: (mutation) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:46](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L46) + +Predicate to decide whether a given `Mutation` should be dehydrated. Defaults to `defaultShouldDehydrateMutation`. + +#### Parameters + +##### mutation + +[`Mutation`](../classes/Mutation.md) + +#### Returns + +`boolean` + +*** + +### shouldDehydrateQuery()? + +```ts +optional shouldDehydrateQuery: (query) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:48](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L48) + +Predicate to decide whether a given `Query` should be dehydrated. Defaults to `defaultShouldDehydrateQuery`. + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +*** + +### shouldRedactErrors()? + +```ts +optional shouldRedactErrors: (error) => boolean; +``` + +Defined in: [packages/query-core/src/hydration.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L54) + +Predicate to decide whether a query's error should be redacted before dehydration. Errors are redacted +(replaced with a generic `Error('redacted')`) unless this function is provided and returns `false` for the +given error, in which case the original error is kept. + +#### Parameters + +##### error + +`unknown` + +#### Returns + +`boolean` diff --git a/docs/framework/vue/reference/interfaces/DehydratedState.md b/docs/framework/vue/reference/interfaces/DehydratedState.md new file mode 100644 index 00000000000..7edce60a00d --- /dev/null +++ b/docs/framework/vue/reference/interfaces/DehydratedState.md @@ -0,0 +1,30 @@ +--- +id: DehydratedState +title: DehydratedState +--- + +Defined in: [packages/query-core/src/hydration.ts:97](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L97) + +A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically +transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data +that has already been fetched, avoiding a redundant fetch on the client. + +## Properties + +### mutations + +```ts +mutations: DehydratedMutation[]; +``` + +Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L98) + +*** + +### queries + +```ts +queries: DehydratedQuery[]; +``` + +Defined in: [packages/query-core/src/hydration.ts:99](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L99) diff --git a/docs/framework/vue/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/vue/reference/interfaces/EnsureQueryDataOptions.md new file mode 100644 index 00000000000..d7b4751a9d3 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/EnsureQueryDataOptions.md @@ -0,0 +1,343 @@ +--- +id: EnsureQueryDataOptions +title: EnsureQueryDataOptions +--- + +Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) + +## Deprecated + +## Extends + +- [`FetchQueryOptions`](FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### ~~gcTime?~~ + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`gcTime`](FetchQueryOptions.md#gctime) + +*** + +### ~~initialData?~~ + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialData`](FetchQueryOptions.md#initialdata) + +*** + +### ~~initialDataUpdatedAt?~~ + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialDataUpdatedAt`](FetchQueryOptions.md#initialdataupdatedat) + +*** + +### ~~initialPageParam?~~ + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`initialPageParam`](FetchQueryOptions.md#initialpageparam) + +*** + +### ~~maxPages?~~ + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`maxPages`](FetchQueryOptions.md#maxpages) + +*** + +### ~~meta?~~ + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`meta`](FetchQueryOptions.md#meta) + +*** + +### ~~networkMode?~~ + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`networkMode`](FetchQueryOptions.md#networkmode) + +*** + +### ~~persister?~~ + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`persister`](FetchQueryOptions.md#persister) + +*** + +### ~~queryFn?~~ + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryFn`](FetchQueryOptions.md#queryfn) + +*** + +### ~~queryHash?~~ + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryHash`](FetchQueryOptions.md#queryhash) + +*** + +### ~~queryKey~~ + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryKey`](FetchQueryOptions.md#querykey) + +*** + +### ~~queryKeyHashFn?~~ + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`queryKeyHashFn`](FetchQueryOptions.md#querykeyhashfn) + +*** + +### ~~retry?~~ + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`retry`](FetchQueryOptions.md#retry) + +*** + +### ~~retryDelay?~~ + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`retryDelay`](FetchQueryOptions.md#retrydelay) + +*** + +### ~~revalidateIfStale?~~ + +```ts +optional revalidateIfStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L608) + +*** + +### ~~staleTime?~~ + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`staleTime`](FetchQueryOptions.md#staletime) + +*** + +### ~~structuralSharing?~~ + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +[`FetchQueryOptions`](FetchQueryOptions.md).[`structuralSharing`](FetchQueryOptions.md#structuralsharing) diff --git a/docs/framework/vue/reference/interfaces/FetchNextPageOptions.md b/docs/framework/vue/reference/interfaces/FetchNextPageOptions.md new file mode 100644 index 00000000000..fefe7f30c13 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/FetchNextPageOptions.md @@ -0,0 +1,41 @@ +--- +id: FetchNextPageOptions +title: FetchNextPageOptions +--- + +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) + +If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, +whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + +If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/vue/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/vue/reference/interfaces/FetchPreviousPageOptions.md new file mode 100644 index 00000000000..ad3c3c736c9 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/FetchPreviousPageOptions.md @@ -0,0 +1,41 @@ +--- +id: FetchPreviousPageOptions +title: FetchPreviousPageOptions +--- + +Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) + +If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, +whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + +If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/vue/reference/interfaces/FetchQueryOptions.md b/docs/framework/vue/reference/interfaces/FetchQueryOptions.md new file mode 100644 index 00000000000..27d7aa63d3d --- /dev/null +++ b/docs/framework/vue/reference/interfaces/FetchQueryOptions.md @@ -0,0 +1,357 @@ +--- +id: FetchQueryOptions +title: FetchQueryOptions +--- + +Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L576) + +## Deprecated + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<`QueryOptions`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Extended by + +- [`EnsureQueryDataOptions`](EnsureQueryDataOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### ~~gcTime?~~ + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### ~~initialData?~~ + +```ts +optional initialData: + | TData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### ~~initialDataUpdatedAt?~~ + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### ~~initialPageParam?~~ + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) + +*** + +### ~~maxPages?~~ + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### ~~meta?~~ + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### ~~networkMode?~~ + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### ~~persister?~~ + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### ~~queryFn?~~ + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### ~~queryHash?~~ + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### ~~queryKey~~ + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### ~~queryKeyHashFn?~~ + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### ~~retry?~~ + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### ~~retryDelay?~~ + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### ~~staleTime?~~ + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +*** + +### ~~structuralSharing?~~ + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` diff --git a/docs/framework/vue/reference/interfaces/HydrateOptions.md b/docs/framework/vue/reference/interfaces/HydrateOptions.md new file mode 100644 index 00000000000..fe8b92317e3 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/HydrateOptions.md @@ -0,0 +1,43 @@ +--- +id: HydrateOptions +title: HydrateOptions +--- + +Defined in: [packages/query-core/src/hydration.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L61) + +Options for `hydrate`, controlling the default options applied to queries/mutations restored from a +`DehydratedState`, and how to reverse any transformation applied by `DehydrateOptions.serializeData`. + +## Properties + +### defaultOptions? + +```ts +optional defaultOptions: object; +``` + +Defined in: [packages/query-core/src/hydration.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L62) + +#### deserializeData? + +```ts +optional deserializeData: TransformerFn; +``` + +Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. + +#### mutations? + +```ts +optional mutations: MutationOptions; +``` + +Default options merged into every mutation restored from the dehydrated state. + +#### queries? + +```ts +optional queries: QueryOptions; +``` + +Default options merged into every query restored from the dehydrated state. diff --git a/docs/framework/vue/reference/interfaces/InfiniteData.md b/docs/framework/vue/reference/interfaces/InfiniteData.md new file mode 100644 index 00000000000..4d7ad595c2d --- /dev/null +++ b/docs/framework/vue/reference/interfaces/InfiniteData.md @@ -0,0 +1,36 @@ +--- +id: InfiniteData +title: InfiniteData +--- + +Defined in: [packages/query-core/src/types.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L210) + +## Type Parameters + +### TData + +`TData` + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### pageParams + +```ts +pageParams: TPageParam[]; +``` + +Defined in: [packages/query-core/src/types.ts:212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L212) + +*** + +### pages + +```ts +pages: TData[]; +``` + +Defined in: [packages/query-core/src/types.ts:211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L211) diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult.md new file mode 100644 index 00000000000..94347ea2e40 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -0,0 +1,577 @@ +--- +id: InfiniteQueryObserverBaseResult +title: InfiniteQueryObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Extended by + +- [`InfiniteQueryObserverPendingResult`](InfiniteQueryObserverPendingResult.md) +- [`InfiniteQueryObserverLoadingResult`](InfiniteQueryObserverLoadingResult.md) +- [`InfiniteQueryObserverLoadingErrorResult`](InfiniteQueryObserverLoadingErrorResult.md) +- [`InfiniteQueryObserverRefetchErrorResult`](InfiniteQueryObserverRefetchErrorResult.md) +- [`InfiniteQueryObserverSuccessResult`](InfiniteQueryObserverSuccessResult.md) +- [`InfiniteQueryObserverPlaceholderResult`](InfiniteQueryObserverPlaceholderResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) + +The last successfully resolved data for the query. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) + +Will be `true` if the query failed while fetching the next page. + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) + +Will be `true` if the query failed while fetching the previous page. + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) + +Will be `true` if the query failed while fetching for the first time. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) + +Will be `true` if the data shown is the placeholder data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) + +Will be `true` if the query failed while refetching. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md new file mode 100644 index 00000000000..3e0d3a79fa1 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverLoadingErrorResult +title: InfiniteQueryObserverLoadingErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult.md new file mode 100644 index 00000000000..f6400f44b52 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverLoadingResult +title: InfiniteQueryObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: true; +``` + +Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverOptions.md new file mode 100644 index 00000000000..db1ca7f18fe --- /dev/null +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverOptions.md @@ -0,0 +1,605 @@ +--- +id: InfiniteQueryObserverOptions +title: InfiniteQueryObserverOptions +--- + +Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) + +## Extends + +- [`QueryObserverOptions`](QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`, `TPageParam`\>.[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md)\<`TQueryFnData`, `TPageParam`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### enabled? + +```ts +optional enabled: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`enabled`](QueryObserverOptions.md#enabled) + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`gcTime`](QueryObserverOptions.md#gctime) + +*** + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`getNextPageParam`](InfiniteQueryPageParamsOptions.md#getnextpageparam) + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`getPreviousPageParam`](InfiniteQueryPageParamsOptions.md#getpreviouspageparam) + +*** + +### initialData? + +```ts +optional initialData: + | InfiniteData +| InitialDataFunction>; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialData`](QueryObserverOptions.md#initialdata) + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`initialDataUpdatedAt`](QueryObserverOptions.md#initialdataupdatedat) + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +[`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md).[`initialPageParam`](InfiniteQueryPageParamsOptions.md#initialpageparam) + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`maxPages`](QueryObserverOptions.md#maxpages) + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`meta`](QueryObserverOptions.md#meta) + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`networkMode`](QueryObserverOptions.md#networkmode) + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`notifyOnChangeProps`](QueryObserverOptions.md#notifyonchangeprops) + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`persister`](QueryObserverOptions.md#persister) + +*** + +### placeholderData? + +```ts +optional placeholderData: + | InfiniteData +| PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`placeholderData`](QueryObserverOptions.md#placeholderdata) + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryFn`](QueryObserverOptions.md#queryfn) + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryHash`](QueryObserverOptions.md#queryhash) + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKey`](QueryObserverOptions.md#querykey) + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`queryKeyHashFn`](QueryObserverOptions.md#querykeyhashfn) + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchInterval`](QueryObserverOptions.md#refetchinterval) + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchIntervalInBackground`](QueryObserverOptions.md#refetchintervalinbackground) + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnMount`](QueryObserverOptions.md#refetchonmount) + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnReconnect`](QueryObserverOptions.md#refetchonreconnect) + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`refetchOnWindowFocus`](QueryObserverOptions.md#refetchonwindowfocus) + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retry`](QueryObserverOptions.md#retry) + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`retryOnMount`](QueryObserverOptions.md#retryonmount) + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +[`InfiniteData`](InfiniteData.md) + +#### Returns + +`TData` + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`select`](QueryObserverOptions.md#select) + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`staleTime`](QueryObserverOptions.md#staletime) + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`structuralSharing`](QueryObserverOptions.md#structuralsharing) + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`suspense`](QueryObserverOptions.md#suspense) + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. + +#### Inherited from + +[`QueryObserverOptions`](QueryObserverOptions.md).[`throwOnError`](QueryObserverOptions.md#throwonerror) diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult.md new file mode 100644 index 00000000000..53d910f545d --- /dev/null +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverPendingResult +title: InfiniteQueryObserverPendingResult +--- + +Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1009) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1013](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1013) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1017](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1017) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1016](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1016) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1021](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1021) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1023](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1023) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md new file mode 100644 index 00000000000..5949179bc6f --- /dev/null +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverPlaceholderResult +title: InfiniteQueryObserverPlaceholderResult +--- + +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: true; +``` + +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md new file mode 100644 index 00000000000..e299e60ddc3 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverRefetchErrorResult +title: InfiniteQueryObserverRefetchErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) + +Will be `true` if the query failed while fetching the next page. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) + +Will be `true` if the query failed while fetching the previous page. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult.md new file mode 100644 index 00000000000..7b550e0a90b --- /dev/null +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -0,0 +1,600 @@ +--- +id: InfiniteQueryObserverSuccessResult +title: InfiniteQueryObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) + +## Extends + +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) + +The last successfully resolved data for the query. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`data`](InfiniteQueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`dataUpdatedAt`](InfiniteQueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`error`](InfiniteQueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdateCount`](InfiniteQueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`errorUpdatedAt`](InfiniteQueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureCount`](InfiniteQueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`failureReason`](InfiniteQueryObserverBaseResult.md#failurereason) + +*** + +### fetchNextPage() + +```ts +fetchNextPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) + +This function allows you to fetch the next "page" of results. + +#### Parameters + +##### options? + +[`FetchNextPageOptions`](FetchNextPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchNextPage`](InfiniteQueryObserverBaseResult.md#fetchnextpage) + +*** + +### fetchPreviousPage() + +```ts +fetchPreviousPage: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) + +This function allows you to fetch the previous "page" of results. + +#### Parameters + +##### options? + +[`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +#### Returns + +`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchPreviousPage`](InfiniteQueryObserverBaseResult.md#fetchpreviouspage) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`fetchStatus`](InfiniteQueryObserverBaseResult.md#fetchstatus) + +*** + +### hasNextPage + +```ts +hasNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) + +Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasNextPage`](InfiniteQueryObserverBaseResult.md#hasnextpage) + +*** + +### hasPreviousPage + +```ts +hasPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) + +Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`hasPreviousPage`](InfiniteQueryObserverBaseResult.md#haspreviouspage) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isEnabled`](InfiniteQueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isError`](InfiniteQueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetched`](InfiniteQueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchedAfterMount`](InfiniteQueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetching`](InfiniteQueryObserverBaseResult.md#isfetching) + +*** + +### isFetchingNextPage + +```ts +isFetchingNextPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) + +Will be `true` while fetching the next page with `fetchNextPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingNextPage`](InfiniteQueryObserverBaseResult.md#isfetchingnextpage) + +*** + +### isFetchingPreviousPage + +```ts +isFetchingPreviousPage: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) + +Will be `true` while fetching the previous page with `fetchPreviousPage`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchingPreviousPage`](InfiniteQueryObserverBaseResult.md#isfetchingpreviouspage) + +*** + +### isFetchNextPageError + +```ts +isFetchNextPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) + +Will be `true` if the query failed while fetching the next page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchNextPageError`](InfiniteQueryObserverBaseResult.md#isfetchnextpageerror) + +*** + +### isFetchPreviousPageError + +```ts +isFetchPreviousPageError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) + +Will be `true` if the query failed while fetching the previous page. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isFetchPreviousPageError`](InfiniteQueryObserverBaseResult.md#isfetchpreviouspageerror) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isInitialLoading`](InfiniteQueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoading`](InfiniteQueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isLoadingError`](InfiniteQueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPaused`](InfiniteQueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPending`](InfiniteQueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isPlaceholderData`](InfiniteQueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetchError`](InfiniteQueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isRefetching`](InfiniteQueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isStale`](InfiniteQueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`isSuccess`](InfiniteQueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`refetch`](InfiniteQueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md).[`status`](InfiniteQueryObserverBaseResult.md#status) diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/vue/reference/interfaces/InfiniteQueryPageParamsOptions.md new file mode 100644 index 00000000000..bfab8bfc319 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -0,0 +1,64 @@ +--- +id: InfiniteQueryPageParamsOptions +title: InfiniteQueryPageParamsOptions +--- + +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) + +## Extends + +- [`InitialPageParam`](InitialPageParam.md)\<`TPageParam`\> + +## Extended by + +- [`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### getNextPageParam + +```ts +getNextPageParam: GetNextPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) + +This function can be set to automatically get the next cursor for infinite queries. +The result will also be used to determine the value of `hasNextPage`. + +*** + +### getPreviousPageParam? + +```ts +optional getPreviousPageParam: GetPreviousPageParamFunction; +``` + +Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) + +This function can be set to automatically get the previous cursor for infinite queries. +The result will also be used to determine the value of `hasPreviousPage`. + +*** + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) + +#### Inherited from + +[`InitialPageParam`](InitialPageParam.md).[`initialPageParam`](InitialPageParam.md#initialpageparam) diff --git a/docs/framework/vue/reference/interfaces/InitialPageParam.md b/docs/framework/vue/reference/interfaces/InitialPageParam.md new file mode 100644 index 00000000000..ffbf32ae0d6 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/InitialPageParam.md @@ -0,0 +1,26 @@ +--- +id: InitialPageParam +title: InitialPageParam +--- + +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) + +## Extended by + +- [`InfiniteQueryPageParamsOptions`](InfiniteQueryPageParamsOptions.md) + +## Type Parameters + +### TPageParam + +`TPageParam` = `unknown` + +## Properties + +### initialPageParam + +```ts +initialPageParam: TPageParam; +``` + +Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) diff --git a/docs/framework/vue/reference/interfaces/InvalidateOptions.md b/docs/framework/vue/reference/interfaces/InvalidateOptions.md new file mode 100644 index 00000000000..494afe1c465 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/InvalidateOptions.md @@ -0,0 +1,44 @@ +--- +id: InvalidateOptions +title: InvalidateOptions +--- + +Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L700) + +## Extends + +- [`RefetchOptions`](RefetchOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`cancelRefetch`](RefetchOptions.md#cancelrefetch) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`throwOnError`](RefetchOptions.md#throwonerror) diff --git a/docs/framework/vue/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/vue/reference/interfaces/InvalidateQueryFilters.md new file mode 100644 index 00000000000..63720ea4ef3 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/InvalidateQueryFilters.md @@ -0,0 +1,144 @@ +--- +id: InvalidateQueryFilters +title: InvalidateQueryFilters +--- + +Defined in: [packages/query-core/src/types.ts:690](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L690) + +## Extends + +- `QueryFilters`\<`TQueryKey`\> + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +#### Inherited from + +```ts +QueryFilters.exact +``` + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +#### Inherited from + +```ts +QueryFilters.fetchStatus +``` + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +QueryFilters.predicate +``` + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +#### Inherited from + +```ts +QueryFilters.queryKey +``` + +*** + +### refetchType? + +```ts +optional refetchType: QueryTypeFilter | "none"; +``` + +Defined in: [packages/query-core/src/types.ts:693](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L693) + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +#### Inherited from + +```ts +QueryFilters.stale +``` + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries + +#### Inherited from + +```ts +QueryFilters.type +``` diff --git a/docs/framework/vue/reference/interfaces/MutateOptions.md b/docs/framework/vue/reference/interfaces/MutateOptions.md new file mode 100644 index 00000000000..a0af091a997 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/MutateOptions.md @@ -0,0 +1,124 @@ +--- +id: MutateOptions +title: MutateOptions +--- + +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1228) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1234) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => void; +``` + +Defined in: [packages/query-core/src/types.ts:1222](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1222) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`void` diff --git a/docs/framework/vue/reference/interfaces/MutationCacheConfig.md b/docs/framework/vue/reference/interfaces/MutationCacheConfig.md new file mode 100644 index 00000000000..c38d2dc26f4 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/MutationCacheConfig.md @@ -0,0 +1,161 @@ +--- +id: MutationCacheConfig +title: MutationCacheConfig +--- + +Defined in: [packages/query-core/src/mutationCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L26) + +Global callbacks that fire for every mutation handled by a `MutationCache`, regardless of which +component or observer triggered it. They differ from the `defaultOptions` provided to a +`QueryClient` in two ways: `defaultOptions` can be overridden by each mutation, while these +callbacks are always called, and `onMutate` here does not allow returning a result. + +If a callback returns a promise, it will be awaited before the mutation continues. + +## Properties + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L28) + +Called when any mutation in the cache encounters an error. + +#### Parameters + +##### error + +`Error` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L44) + +Called before any mutation in the cache executes. + +#### Parameters + +##### variables + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:50](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L50) + +Called when any mutation in the cache is settled, either successfully or with an error. + +#### Parameters + +##### data + +`unknown` + +##### error + +`Error` | `null` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, mutation, context) => unknown; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:36](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L36) + +Called when any mutation in the cache is successful. + +#### Parameters + +##### data + +`unknown` + +##### variables + +`unknown` + +##### onMutateResult + +`unknown` + +##### mutation + +[`Mutation`](../classes/Mutation.md)\<`unknown`, `unknown`, `unknown`\> + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` diff --git a/docs/framework/vue/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/vue/reference/interfaces/MutationObserverBaseResult.md new file mode 100644 index 00000000000..98810323966 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/MutationObserverBaseResult.md @@ -0,0 +1,291 @@ +--- +id: MutationObserverBaseResult +title: MutationObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationState`](MutationState.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Extended by + +- [`MutationObserverIdleResult`](MutationObserverIdleResult.md) +- [`MutationObserverLoadingResult`](MutationObserverLoadingResult.md) +- [`MutationObserverErrorResult`](MutationObserverErrorResult.md) +- [`MutationObserverSuccessResult`](MutationObserverSuccessResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationState`](MutationState.md).[`context`](MutationState.md#context) + +*** + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationState`](MutationState.md).[`data`](MutationState.md#data) + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:1285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1285) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationState`](MutationState.md).[`error`](MutationState.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationState`](MutationState.md).[`failureCount`](MutationState.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationState`](MutationState.md).[`failureReason`](MutationState.md#failurereason) + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +*** + +### isIdle + +```ts +isIdle: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1295) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationState`](MutationState.md).[`isPaused`](MutationState.md#ispaused) + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1300](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1300) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1305](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1305) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +*** + +### status + +```ts +status: MutationStatus; +``` + +Defined in: [packages/query-core/src/types.ts:1314](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1314) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationState`](MutationState.md).[`status`](MutationState.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationState`](MutationState.md).[`submittedAt`](MutationState.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationState`](MutationState.md).[`variables`](MutationState.md#variables) diff --git a/docs/framework/vue/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/vue/reference/interfaces/MutationObserverErrorResult.md new file mode 100644 index 00000000000..d61f244ced4 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/MutationObserverErrorResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverErrorResult +title: MutationObserverErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:1374](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1374) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1385](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1385) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:1386](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1386) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:1388](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1388) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1389](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1389) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1390) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/vue/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/vue/reference/interfaces/MutationObserverIdleResult.md new file mode 100644 index 00000000000..93655da0aa5 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/MutationObserverIdleResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverIdleResult +title: MutationObserverIdleResult +--- + +Defined in: [packages/query-core/src/types.ts:1332](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1332) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1346](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1346) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: true; +``` + +Defined in: [packages/query-core/src/types.ts:1347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1347) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1349) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "idle"; +``` + +Defined in: [packages/query-core/src/types.ts:1350](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1350) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/vue/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/vue/reference/interfaces/MutationObserverLoadingResult.md new file mode 100644 index 00000000000..de146c45f5c --- /dev/null +++ b/docs/framework/vue/reference/interfaces/MutationObserverLoadingResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverLoadingResult +title: MutationObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1364](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1364) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1367](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1367) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:1369](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1369) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:1370](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1370) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:1371](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1371) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1365) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/vue/reference/interfaces/MutationObserverOptions.md b/docs/framework/vue/reference/interfaces/MutationObserverOptions.md new file mode 100644 index 00000000000..f1f16d6931b --- /dev/null +++ b/docs/framework/vue/reference/interfaces/MutationObserverOptions.md @@ -0,0 +1,314 @@ +--- +id: MutationObserverOptions +title: MutationObserverOptions +--- + +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) + +## Extends + +- `MutationOptions`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) + +#### Inherited from + +```ts +MutationOptions.gcTime +``` + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) + +#### Inherited from + +```ts +MutationOptions.meta +``` + +*** + +### mutationFn? + +```ts +optional mutationFn: MutationFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) + +#### Inherited from + +```ts +MutationOptions.mutationFn +``` + +*** + +### mutationKey? + +```ts +optional mutationKey: readonly unknown[]; +``` + +Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) + +#### Inherited from + +```ts +MutationOptions.mutationKey +``` + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) + +#### Inherited from + +```ts +MutationOptions.networkMode +``` + +*** + +### onError()? + +```ts +optional onError: (error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) + +#### Parameters + +##### error + +`TError` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +MutationOptions.onError +``` + +*** + +### onMutate()? + +```ts +optional onMutate: (variables, context) => TOnMutateResult | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) + +#### Parameters + +##### variables + +`TVariables` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`TOnMutateResult` \| `Promise`\<`TOnMutateResult`\> + +#### Inherited from + +```ts +MutationOptions.onMutate +``` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) + +#### Parameters + +##### data + +`TData` | `undefined` + +##### error + +`TError` | `null` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` | `undefined` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +MutationOptions.onSettled +``` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, variables, onMutateResult, context) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) + +#### Parameters + +##### data + +`TData` + +##### variables + +`TVariables` + +##### onMutateResult + +`TOnMutateResult` + +##### context + +[`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md) + +#### Returns + +`unknown` + +#### Inherited from + +```ts +MutationOptions.onSuccess +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) + +#### Inherited from + +```ts +MutationOptions.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) + +#### Inherited from + +```ts +MutationOptions.retryDelay +``` + +*** + +### scope? + +```ts +optional scope: MutationScope; +``` + +Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) + +#### Inherited from + +```ts +MutationOptions.scope +``` + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean | (error) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) diff --git a/docs/framework/vue/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/vue/reference/interfaces/MutationObserverSuccessResult.md new file mode 100644 index 00000000000..b50ec4ab6f1 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/MutationObserverSuccessResult.md @@ -0,0 +1,308 @@ +--- +id: MutationObserverSuccessResult +title: MutationObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extends + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`context`](MutationObserverBaseResult.md#context) + +*** + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:1406](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1406) + +The last successfully resolved data for the mutation. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#data) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:1407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1407) + +The error object for the mutation, if an error was encountered. +- Defaults to `null`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#error) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureCount`](MutationObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`failureReason`](MutationObserverBaseResult.md#failurereason) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:1409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1409) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt resulted in an error. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#iserror) + +*** + +### isIdle + +```ts +isIdle: false; +``` + +Defined in: [packages/query-core/src/types.ts:1410](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1410) + +A boolean variable derived from `status`. +- `true` if the mutation is in its initial state prior to executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#isidle) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPaused`](MutationObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) + +A boolean variable derived from `status`. +- `true` if the mutation is currently executing. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#ispending) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) + +A boolean variable derived from `status`. +- `true` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#issuccess) + +*** + +### mutate + +```ts +mutate: MutateFunction; +``` + +Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) + +The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + +#### Param + +The variables object to pass to the `mutationFn`. + +#### Param + +This function will fire when the mutation is successful and will be passed the mutation's result. + +#### Param + +This function will fire if the mutation encounters an error and will be passed the error. + +#### Param + +This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + +#### Remarks + +- If you make multiple requests, `onSuccess` will fire only after the latest call you've made. +- All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`mutate`](MutationObserverBaseResult.md#mutate) + +*** + +### reset() + +```ts +reset: () => void; +``` + +Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) + +A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + +#### Returns + +`void` + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`reset`](MutationObserverBaseResult.md#reset) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) + +The status of the mutation. +- Will be: + - `idle` initial status prior to the mutation function executing. + - `pending` if the mutation is currently executing. + - `error` if the last mutation attempt resulted in an error. + - `success` if the last mutation attempt was successful. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#status) + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +#### Inherited from + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`submittedAt`](MutationObserverBaseResult.md#submittedat) + +*** + +### variables + +```ts +variables: TVariables; +``` + +Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) + +The variables object passed to the `mutationFn`. + +#### Overrides + +[`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#variables) diff --git a/docs/framework/vue/reference/interfaces/MutationState.md b/docs/framework/vue/reference/interfaces/MutationState.md new file mode 100644 index 00000000000..bec050ec1d3 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/MutationState.md @@ -0,0 +1,142 @@ +--- +id: MutationState +title: MutationState +--- + +Defined in: [packages/query-core/src/mutation.ts:30](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L30) + +The raw state stored on a `Mutation` instance. This is the underlying state +that observer results (e.g. `MutationObserverResult`) are derived from. + +## Extended by + +- [`MutationObserverBaseResult`](MutationObserverBaseResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TVariables + +`TVariables` = `unknown` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Properties + +### context + +```ts +context: TOnMutateResult | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) + +The value returned by `onMutate`, if defined. Passed to `onSuccess`, +`onError` and `onSettled` as the mutation's context. + +*** + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L44) + +The last successfully resolved data for the mutation. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L49) + +The error object for the mutation, if the last attempt resulted in an error. +- Defaults to `null`. + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) + +The number of times the mutation function has failed for the current attempt. + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) + +The reason the current attempt failed, as reported by the retryer. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) + +Whether the mutation is currently paused (see network mode), or is +waiting for another mutation with the same `scope` to finish. + +*** + +### status + +```ts +status: MutationStatus; +``` + +Defined in: [packages/query-core/src/mutation.ts:66](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L66) + +The status of the mutation. + +*** + +### submittedAt + +```ts +submittedAt: number; +``` + +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) + +The timestamp for when the mutation was submitted. + +*** + +### variables + +```ts +variables: TVariables | undefined; +``` + +Defined in: [packages/query-core/src/mutation.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L70) + +The variables the mutation was last called with. diff --git a/docs/framework/vue/reference/interfaces/NotifyEvent.md b/docs/framework/vue/reference/interfaces/NotifyEvent.md new file mode 100644 index 00000000000..1dc93464df1 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/NotifyEvent.md @@ -0,0 +1,16 @@ +--- +id: NotifyEvent +title: NotifyEvent +--- + +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) + +## Properties + +### type + +```ts +type: NotifyEventType; +``` + +Defined in: [packages/query-core/src/types.ts:1462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1462) diff --git a/docs/framework/vue/reference/interfaces/QueriesObserverOptions.md b/docs/framework/vue/reference/interfaces/QueriesObserverOptions.md new file mode 100644 index 00000000000..16035c45714 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/QueriesObserverOptions.md @@ -0,0 +1,27 @@ +--- +id: QueriesObserverOptions +title: QueriesObserverOptions +--- + +Defined in: [packages/query-core/src/queriesObserver.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L23) + +## Type Parameters + +### TCombinedResult + +`TCombinedResult` = [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[] + +## Properties + +### combine? + +```ts +optional combine: CombineFn; +``` + +Defined in: [packages/query-core/src/queriesObserver.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L32) + +A function that combines the array of `QueryObserverResult`s (one per +observed query) into a single value. The combined value is memoized and +only recomputed when one of the underlying results, the query hashes, or +the `combine` function itself changes. diff --git a/docs/framework/vue/reference/interfaces/QueryCacheConfig.md b/docs/framework/vue/reference/interfaces/QueryCacheConfig.md new file mode 100644 index 00000000000..69ea600366c --- /dev/null +++ b/docs/framework/vue/reference/interfaces/QueryCacheConfig.md @@ -0,0 +1,92 @@ +--- +id: QueryCacheConfig +title: QueryCacheConfig +--- + +Defined in: [packages/query-core/src/queryCache.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L24) + +Global callbacks that fire for every query handled by a `QueryCache`, regardless of which +component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can +override, these callbacks are always called. + +## Properties + +### onError()? + +```ts +optional onError: (error, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L26) + +Called when any query in the cache encounters an error. + +#### Parameters + +##### error + +`Error` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` + +*** + +### onSettled()? + +```ts +optional onSettled: (data, error, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L33) + +Called when any query in the cache is settled, either successfully or with an error. + +#### Parameters + +##### data + +`unknown` + +##### error + +`Error` | `null` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` + +*** + +### onSuccess()? + +```ts +optional onSuccess: (data, query) => void; +``` + +Defined in: [packages/query-core/src/queryCache.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L31) + +Called when any query in the cache is successful. + +#### Parameters + +##### data + +`unknown` + +##### query + +[`Query`](../classes/Query.md)\<`unknown`, `unknown`, `unknown`\> + +#### Returns + +`void` diff --git a/docs/framework/vue/reference/interfaces/QueryClientConfig.md b/docs/framework/vue/reference/interfaces/QueryClientConfig.md new file mode 100644 index 00000000000..7c9bc255b35 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/QueryClientConfig.md @@ -0,0 +1,36 @@ +--- +id: QueryClientConfig +title: QueryClientConfig +--- + +Defined in: [packages/query-core/src/types.ts:1427](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1427) + +## Properties + +### defaultOptions? + +```ts +optional defaultOptions: DefaultOptions; +``` + +Defined in: [packages/query-core/src/types.ts:1430](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1430) + +*** + +### mutationCache? + +```ts +optional mutationCache: MutationCache; +``` + +Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) + +*** + +### queryCache? + +```ts +optional queryCache: QueryCache; +``` + +Defined in: [packages/query-core/src/types.ts:1428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1428) diff --git a/docs/framework/vue/reference/interfaces/QueryExecuteOptions.md b/docs/framework/vue/reference/interfaces/QueryExecuteOptions.md new file mode 100644 index 00000000000..ce40aa09805 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/QueryExecuteOptions.md @@ -0,0 +1,375 @@ +--- +id: QueryExecuteOptions +title: QueryExecuteOptions +--- + +Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L555) + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<`QueryOptions`\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### initialPageParam? + +```ts +optional initialPageParam: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L567) + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:572](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L572) + +The time in milliseconds after data is considered stale. +If the data is fresh it will be returned from the cache. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` diff --git a/docs/framework/vue/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/vue/reference/interfaces/QueryObserverBaseResult.md new file mode 100644 index 00000000000..2840be27e27 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/QueryObserverBaseResult.md @@ -0,0 +1,358 @@ +--- +id: QueryObserverBaseResult +title: QueryObserverBaseResult +--- + +Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) + +## Extended by + +- [`QueryObserverPendingResult`](QueryObserverPendingResult.md) +- [`QueryObserverLoadingResult`](QueryObserverLoadingResult.md) +- [`QueryObserverLoadingErrorResult`](QueryObserverLoadingErrorResult.md) +- [`QueryObserverRefetchErrorResult`](QueryObserverRefetchErrorResult.md) +- [`QueryObserverSuccessResult`](QueryObserverSuccessResult.md) +- [`QueryObserverPlaceholderResult`](QueryObserverPlaceholderResult.md) +- [`InfiniteQueryObserverBaseResult`](InfiniteQueryObserverBaseResult.md) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) + +The last successfully resolved data for the query. + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +*** + +### isError + +```ts +isError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +*** + +### isLoadingError + +```ts +isLoadingError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) + +Will be `true` if the query failed while fetching for the first time. + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) + +Will be `true` if the data shown is the placeholder data. + +*** + +### isRefetchError + +```ts +isRefetchError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) + +Will be `true` if the query failed while refetching. + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +*** + +### isSuccess + +```ts +isSuccess: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. diff --git a/docs/framework/vue/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/vue/reference/interfaces/QueryObserverLoadingErrorResult.md new file mode 100644 index 00000000000..97d5d5125a7 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverLoadingErrorResult +title: QueryObserverLoadingErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: true; +``` + +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/vue/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/vue/reference/interfaces/QueryObserverLoadingResult.md new file mode 100644 index 00000000000..1f442f18130 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/QueryObserverLoadingResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverLoadingResult +title: QueryObserverLoadingResult +--- + +Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L873) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: true; +``` + +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:885](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L885) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:884](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L884) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/vue/reference/interfaces/QueryObserverOptions.md b/docs/framework/vue/reference/interfaces/QueryObserverOptions.md new file mode 100644 index 00000000000..bdaefab7baa --- /dev/null +++ b/docs/framework/vue/reference/interfaces/QueryObserverOptions.md @@ -0,0 +1,541 @@ +--- +id: QueryObserverOptions +title: QueryObserverOptions +--- + +Defined in: [packages/query-core/src/types.ts:373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L373) + +## Extends + +- [`WithRequired`](../type-aliases/WithRequired.md)\<`QueryOptions`\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`, `TPageParam`\>, `"queryKey"`\> + +## Extended by + +- [`InfiniteQueryObserverOptions`](InfiniteQueryObserverOptions.md) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Properties + +### enabled? + +```ts +optional enabled: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) + +Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. +To refetch the query, use the `refetch` method returned from the `useQuery` instance. +Accepts a boolean or function that returns a boolean. +Defaults to `true`. + +*** + +### gcTime? + +```ts +optional gcTime: number; +``` + +Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) + +The time in milliseconds that unused/inactive cache data remains in memory. +When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. +When different garbage collection times are specified, the longest one will be used. +Setting it to `Infinity` will disable garbage collection. +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + +Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see +`timeoutManager.setTimeoutProvider` for a workaround. + +#### Inherited from + +```ts +WithRequired.gcTime +``` + +*** + +### initialData? + +```ts +optional initialData: + | TQueryData +| InitialDataFunction; +``` + +Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) + +If set, this value will be used as the initial data for the query cache (as long as the query hasn't been +created or cached yet). +If set to a function, the function will be called **once** during the shared/root query initialization, and be +expected to synchronously return the initial data. +Initial data is considered stale by default unless a `staleTime` has been set. +`initialData` **is persisted** to the cache. + +#### Inherited from + +```ts +WithRequired.initialData +``` + +*** + +### initialDataUpdatedAt? + +```ts +optional initialDataUpdatedAt: number | () => number | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) + +If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + +#### Inherited from + +```ts +WithRequired.initialDataUpdatedAt +``` + +*** + +### maxPages? + +```ts +optional maxPages: number; +``` + +Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) + +Maximum number of pages to store in the data of an infinite query. + +#### Inherited from + +```ts +WithRequired.maxPages +``` + +*** + +### meta? + +```ts +optional meta: Record; +``` + +Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) + +Additional payload to be stored on each query. +Use this property to pass information that can be used in other places. + +#### Inherited from + +```ts +WithRequired.meta +``` + +*** + +### networkMode? + +```ts +optional networkMode: NetworkMode; +``` + +Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +```ts +WithRequired.networkMode +``` + +*** + +### notifyOnChangeProps? + +```ts +optional notifyOnChangeProps: NotifyOnChangeProps; +``` + +Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) + +If set, the component will only re-render if any of the listed properties change. +When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. +When set to `'all'`, the component will re-render whenever a query is updated. +When set to a function, the function will be executed to compute the list of properties. +By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +*** + +### persister? + +```ts +optional persister: QueryPersister, TPageParam>; +``` + +Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) + +This option can be used to persist the result of a query to an external storage, bypassing the need to actually +call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + +#### Inherited from + +```ts +WithRequired.persister +``` + +*** + +### placeholderData? + +```ts +optional placeholderData: + | NonFunctionGuard +| PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; +``` + +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) + +If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + +*** + +### queryFn? + +```ts +optional queryFn: + | typeof skipToken +| QueryFunction; +``` + +Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) + +The function that the query will use to request data. +Required, unless a default query function has been set via `queryClient.setQueryDefaults` or +`queryClient.setDefaultOptions`. +Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). +Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + +#### Inherited from + +```ts +WithRequired.queryFn +``` + +*** + +### queryHash? + +```ts +optional queryHash: string; +``` + +Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) + +The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used +as the actual cache key internally. + +#### Inherited from + +```ts +WithRequired.queryHash +``` + +*** + +### queryKey + +```ts +queryKey: TQueryKey & object; +``` + +Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) + +The query key to use for this query. + +The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) +for more information. + +The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + +#### Inherited from + +```ts +WithRequired.queryKey +``` + +*** + +### queryKeyHashFn? + +```ts +optional queryKeyHashFn: QueryKeyHashFunction; +``` + +Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) + +If specified, this function is used to hash the `queryKey` to a string. + +#### Inherited from + +```ts +WithRequired.queryKeyHashFn +``` + +*** + +### refetchInterval? + +```ts +optional refetchInterval: number | false | (query) => number | false | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) + +If set to a number, the query will continuously refetch at this frequency in milliseconds. +If set to a function, the function will be executed with the latest data and query to compute a frequency +Defaults to `false`. + +*** + +### refetchIntervalInBackground? + +```ts +optional refetchIntervalInBackground: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) + +If set to `true`, the query will continue to refetch while their tab/window is in the background. +Defaults to `false`. + +*** + +### refetchOnMount? + +```ts +optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) + +If set to `true`, the query will refetch on mount if the data is stale. +If set to `false`, will disable additional instances of a query to trigger background refetch. +If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value +Defaults to `true`. + +*** + +### refetchOnReconnect? + +```ts +optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) + +If set to `true`, the query will refetch on reconnect if the data is stale. +If set to `false`, the query will not refetch on reconnect. +If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true` unless `networkMode` is `'always'`. + +*** + +### refetchOnWindowFocus? + +```ts +optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; +``` + +Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) + +If set to `true`, the query will refetch on window focus if the data is stale. +If set to `false`, the query will not refetch on window focus. +If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). +If set to a function, the function will be executed with the latest data and query to compute the value. +Defaults to `true`. + +*** + +### retry? + +```ts +optional retry: RetryValue; +``` + +Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) + +If `false`, failed queries will not retry by default. +If `true`, failed queries will retry infinitely. +If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. +If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. +Defaults to `3` on the client and `0` on the server. + +#### Inherited from + +```ts +WithRequired.retry +``` + +*** + +### retryDelay? + +```ts +optional retryDelay: RetryDelayValue; +``` + +Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential +backoff. + +A function like `attempt => attempt * 1000` applies linear backoff. + +#### Inherited from + +```ts +WithRequired.retryDelay +``` + +*** + +### retryOnMount? + +```ts +optional retryOnMount: QueryBooleanOption; +``` + +Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) + +If set to `false`, the query will not be retried on mount if it contains an error. +If set to a function, the function will be executed with the query to compute the value. +Defaults to `true`. + +*** + +### select()? + +```ts +optional select: (data) => TData; +``` + +Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) + +This option can be used to transform or select a part of the data returned by the query function. It affects +the returned `data` value, but does not affect what gets stored in the query cache. +The `select` function will only run if `data` changed, or if the reference to the `select` function itself +changes. To optimize, memoize the function so its reference stays stable across calls. + +#### Parameters + +##### data + +`TQueryData` + +#### Returns + +`TData` + +*** + +### staleTime? + +```ts +optional staleTime: StaleTimeFunction; +``` + +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) + +The time in milliseconds after data is considered stale. +If set to `Infinity`, the data will never be considered stale. +If set to `'static'`, the data will never be considered stale. +If set to a function, the function will be executed with the query to compute a `staleTime`. +Defaults to `0`. + +*** + +### structuralSharing? + +```ts +optional structuralSharing: boolean | (oldData, newData) => unknown; +``` + +Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) + +Set this to `false` to disable structural sharing between query results. +Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. +Defaults to `true`. + +#### Inherited from + +```ts +WithRequired.structuralSharing +``` + +*** + +### suspense? + +```ts +optional suspense: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) + +If set to `true`, the query will suspend when `status === 'pending'` +and throw errors when `status === 'error'`. +Defaults to `false`. + +*** + +### throwOnError? + +```ts +optional throwOnError: ThrowOnError; +``` + +Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. +If set to `false` and `suspense` is `false`, errors are returned as state. +If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). +Defaults to `false`. diff --git a/docs/framework/vue/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/vue/reference/interfaces/QueryObserverPendingResult.md new file mode 100644 index 00000000000..ad040ff9cc5 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/QueryObserverPendingResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverPendingResult +title: QueryObserverPendingResult +--- + +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: undefined; +``` + +Defined in: [packages/query-core/src/types.ts:862](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L862) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:864](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L864) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:866](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L866) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: true; +``` + +Defined in: [packages/query-core/src/types.ts:865](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L865) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:869](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L869) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "pending"; +``` + +Defined in: [packages/query-core/src/types.ts:870](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L870) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/vue/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/vue/reference/interfaces/QueryObserverPlaceholderResult.md new file mode 100644 index 00000000000..8a1ae61dee9 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/QueryObserverPlaceholderResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverPlaceholderResult +title: QueryObserverPlaceholderResult +--- + +Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: true; +``` + +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/vue/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/vue/reference/interfaces/QueryObserverRefetchErrorResult.md new file mode 100644 index 00000000000..c8d5274697a --- /dev/null +++ b/docs/framework/vue/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverRefetchErrorResult +title: QueryObserverRefetchErrorResult +--- + +Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: TError; +``` + +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: true; +``` + +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: true; +``` + +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: false; +``` + +Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "error"; +``` + +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/vue/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/vue/reference/interfaces/QueryObserverSuccessResult.md new file mode 100644 index 00000000000..e3c834e6c3a --- /dev/null +++ b/docs/framework/vue/reference/interfaces/QueryObserverSuccessResult.md @@ -0,0 +1,452 @@ +--- +id: QueryObserverSuccessResult +title: QueryObserverSuccessResult +--- + +Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) + +## Extends + +- [`QueryObserverBaseResult`](QueryObserverBaseResult.md)\<`TData`, `TError`\> + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData; +``` + +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) + +The last successfully resolved data for the query. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`data`](QueryObserverBaseResult.md#data) + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`dataUpdatedAt`](QueryObserverBaseResult.md#dataupdatedat) + +*** + +### error + +```ts +error: null; +``` + +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) + +The error object for the query, if an error was thrown. +- Defaults to `null`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`error`](QueryObserverBaseResult.md#error) + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) + +The sum of all errors. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdateCount`](QueryObserverBaseResult.md#errorupdatecount) + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`errorUpdatedAt`](QueryObserverBaseResult.md#errorupdatedat) + +*** + +### failureCount + +```ts +failureCount: number; +``` + +Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) + +The failure count for the query. +- Incremented every time the query fails. +- Reset to `0` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureCount`](QueryObserverBaseResult.md#failurecount) + +*** + +### failureReason + +```ts +failureReason: TError | null; +``` + +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) + +The failure reason for the query retry. +- Reset to `null` when the query succeeds. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`failureReason`](QueryObserverBaseResult.md#failurereason) + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) + +The fetch status of the query. +- `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. +- `paused`: The query wanted to fetch, but has been `paused`. +- `idle`: The query is not fetching. +- See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`fetchStatus`](QueryObserverBaseResult.md#fetchstatus) + +*** + +### isEnabled + +```ts +isEnabled: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) + +`true` if this observer is enabled, `false` otherwise. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isEnabled`](QueryObserverBaseResult.md#isenabled) + +*** + +### isError + +```ts +isError: false; +``` + +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query attempt resulted in an error. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isError`](QueryObserverBaseResult.md#iserror) + +*** + +### isFetched + +```ts +isFetched: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) + +Will be `true` if the query has been fetched. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetched`](QueryObserverBaseResult.md#isfetched) + +*** + +### isFetchedAfterMount + +```ts +isFetchedAfterMount: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) + +Will be `true` if the query has been fetched after the component mounted. +- This property can be used to not show any previously cached data. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetchedAfterMount`](QueryObserverBaseResult.md#isfetchedaftermount) + +*** + +### isFetching + +```ts +isFetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isFetching`](QueryObserverBaseResult.md#isfetching) + +*** + +### ~~isInitialLoading~~ + +```ts +isInitialLoading: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) + +#### Deprecated + +`isInitialLoading` is being deprecated in favor of `isLoading` +and will be removed in the next major version. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isInitialLoading`](QueryObserverBaseResult.md#isinitialloading) + +*** + +### isLoading + +```ts +isLoading: false; +``` + +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) + +Is `true` whenever the first fetch for a query is in-flight. +- Is the same as `isFetching && isPending`. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoading`](QueryObserverBaseResult.md#isloading) + +*** + +### isLoadingError + +```ts +isLoadingError: false; +``` + +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) + +Will be `true` if the query failed while fetching for the first time. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isLoadingError`](QueryObserverBaseResult.md#isloadingerror) + +*** + +### isPaused + +```ts +isPaused: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) + +A derived boolean from the `fetchStatus` variable, provided for convenience. +- The query wanted to fetch, but has been `paused`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPaused`](QueryObserverBaseResult.md#ispaused) + +*** + +### isPending + +```ts +isPending: false; +``` + +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) + +Will be `pending` if there's no cached data and no query attempt was finished yet. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPending`](QueryObserverBaseResult.md#ispending) + +*** + +### isPlaceholderData + +```ts +isPlaceholderData: false; +``` + +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) + +Will be `true` if the data shown is the placeholder data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isPlaceholderData`](QueryObserverBaseResult.md#isplaceholderdata) + +*** + +### isRefetchError + +```ts +isRefetchError: false; +``` + +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) + +Will be `true` if the query failed while refetching. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetchError`](QueryObserverBaseResult.md#isrefetcherror) + +*** + +### isRefetching + +```ts +isRefetching: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) + +Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. +- Is the same as `isFetching && !isPending`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isRefetching`](QueryObserverBaseResult.md#isrefetching) + +*** + +### isStale + +```ts +isStale: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) + +Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isStale`](QueryObserverBaseResult.md#isstale) + +*** + +### isSuccess + +```ts +isSuccess: true; +``` + +Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) + +A derived boolean from the `status` variable, provided for convenience. +- `true` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`isSuccess`](QueryObserverBaseResult.md#issuccess) + +*** + +### refetch() + +```ts +refetch: (options?) => Promise>; +``` + +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) + +A function to manually refetch the query. + +#### Parameters + +##### options? + +[`RefetchOptions`](RefetchOptions.md) + +#### Returns + +`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\> + +#### Inherited from + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`refetch`](QueryObserverBaseResult.md#refetch) + +*** + +### status + +```ts +status: "success"; +``` + +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) + +The status of the query. +- Will be: + - `pending` if there's no cached data and no query attempt was finished yet. + - `error` if the query attempt resulted in an error. + - `success` if the query has received a response with no errors and is ready to display its data. + +#### Overrides + +[`QueryObserverBaseResult`](QueryObserverBaseResult.md).[`status`](QueryObserverBaseResult.md#status) diff --git a/docs/framework/vue/reference/interfaces/QueryState.md b/docs/framework/vue/reference/interfaces/QueryState.md new file mode 100644 index 00000000000..7dce476d743 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/QueryState.md @@ -0,0 +1,175 @@ +--- +id: QueryState +title: QueryState +--- + +Defined in: [packages/query-core/src/query.ts:52](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L52) + +The raw state stored on a `Query` instance. This is the underlying state +that observer results (e.g. `QueryObserverResult`) are derived from. + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](../type-aliases/DefaultError.md) + +## Properties + +### data + +```ts +data: TData | undefined; +``` + +Defined in: [packages/query-core/src/query.ts:56](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L56) + +The last successfully resolved data for the query. + +*** + +### dataUpdateCount + +```ts +dataUpdateCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L60) + +The number of times the query has successfully resolved. + +*** + +### dataUpdatedAt + +```ts +dataUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/query.ts:64](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L64) + +The timestamp for when the query most recently returned the `status` as `"success"`. + +*** + +### error + +```ts +error: TError | null; +``` + +Defined in: [packages/query-core/src/query.ts:69](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L69) + +The error object for the query, if the last attempt resulted in an error. +- Defaults to `null`. + +*** + +### errorUpdateCount + +```ts +errorUpdateCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:73](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L73) + +The sum of all errors, incremented every time the query resolves with an error. + +*** + +### errorUpdatedAt + +```ts +errorUpdatedAt: number; +``` + +Defined in: [packages/query-core/src/query.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L77) + +The timestamp for when the query most recently returned the `status` as `"error"`. + +*** + +### fetchFailureCount + +```ts +fetchFailureCount: number; +``` + +Defined in: [packages/query-core/src/query.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L83) + +The failure count for the current fetch. +- Incremented every time the fetch fails. +- Reset to `0` when the fetch succeeds. + +*** + +### fetchFailureReason + +```ts +fetchFailureReason: TError | null; +``` + +Defined in: [packages/query-core/src/query.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L88) + +The reason the current fetch failed, as reported by the retryer. +- Reset to `null` when the fetch succeeds. + +*** + +### fetchMeta + +```ts +fetchMeta: FetchMeta | null; +``` + +Defined in: [packages/query-core/src/query.ts:93](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L93) + +Metadata passed to the currently in-flight (or most recent) fetch, e.g. the +`fetchMore` direction for infinite queries. + +*** + +### fetchStatus + +```ts +fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/query.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L112) + +The fetch status of the query. +- `fetching`: the `queryFn` is currently executing. +- `paused`: a fetch wanted to run but has been paused (see network mode). +- `idle`: the query is not fetching. + +*** + +### isInvalidated + +```ts +isInvalidated: boolean; +``` + +Defined in: [packages/query-core/src/query.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L98) + +Whether the query has been marked as invalidated via `invalidate()`. +- Reset to `false` whenever the query resolves successfully. + +*** + +### status + +```ts +status: QueryStatus; +``` + +Defined in: [packages/query-core/src/query.ts:105](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L105) + +The status of the query. +- `pending` if there's no cached data and no attempt was finished yet. +- `error` if the last attempt resulted in an error. +- `success` if the query has data. diff --git a/docs/framework/vue/reference/interfaces/RefetchOptions.md b/docs/framework/vue/reference/interfaces/RefetchOptions.md new file mode 100644 index 00000000000..a3db94b1674 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/RefetchOptions.md @@ -0,0 +1,45 @@ +--- +id: RefetchOptions +title: RefetchOptions +--- + +Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L679) + +## Extends + +- [`ResultOptions`](ResultOptions.md) + +## Extended by + +- [`InvalidateOptions`](InvalidateOptions.md) +- [`ResetOptions`](ResetOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`ResultOptions`](ResultOptions.md).[`throwOnError`](ResultOptions.md#throwonerror) diff --git a/docs/framework/vue/reference/interfaces/RefetchQueryFilters.md b/docs/framework/vue/reference/interfaces/RefetchQueryFilters.md new file mode 100644 index 00000000000..05896110edc --- /dev/null +++ b/docs/framework/vue/reference/interfaces/RefetchQueryFilters.md @@ -0,0 +1,134 @@ +--- +id: RefetchQueryFilters +title: RefetchQueryFilters +--- + +Defined in: [packages/query-core/src/types.ts:696](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L696) + +## Extends + +- `QueryFilters`\<`TQueryKey`\> + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md) + +## Properties + +### exact? + +```ts +optional exact: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) + +Match query key exactly + +#### Inherited from + +```ts +QueryFilters.exact +``` + +*** + +### fetchStatus? + +```ts +optional fetchStatus: FetchStatus; +``` + +Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) + +Include queries matching their fetchStatus + +#### Inherited from + +```ts +QueryFilters.fetchStatus +``` + +*** + +### predicate()? + +```ts +optional predicate: (query) => boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) + +Include queries matching this predicate function + +#### Parameters + +##### query + +[`Query`](../classes/Query.md) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +QueryFilters.predicate +``` + +*** + +### queryKey? + +```ts +optional queryKey: TQueryKey | TuplePrefixes; +``` + +Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) + +Include queries matching this query key + +#### Inherited from + +```ts +QueryFilters.queryKey +``` + +*** + +### stale? + +```ts +optional stale: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) + +Include or exclude stale queries + +#### Inherited from + +```ts +QueryFilters.stale +``` + +*** + +### type? + +```ts +optional type: QueryTypeFilter; +``` + +Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) + +Filter to active queries, inactive queries or all queries + +#### Inherited from + +```ts +QueryFilters.type +``` diff --git a/docs/framework/vue/reference/interfaces/Register.md b/docs/framework/vue/reference/interfaces/Register.md new file mode 100644 index 00000000000..4f442442b48 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/Register.md @@ -0,0 +1,6 @@ +--- +id: Register +title: Register +--- + +Defined in: [packages/query-core/src/types.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L37) diff --git a/docs/framework/vue/reference/interfaces/ResetOptions.md b/docs/framework/vue/reference/interfaces/ResetOptions.md new file mode 100644 index 00000000000..bfa931717f8 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/ResetOptions.md @@ -0,0 +1,44 @@ +--- +id: ResetOptions +title: ResetOptions +--- + +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) + +## Extends + +- [`RefetchOptions`](RefetchOptions.md) + +## Properties + +### cancelRefetch? + +```ts +optional cancelRefetch: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) + +If set to `true`, a currently running request will be cancelled before a new request is made + +If set to `false`, no refetch will be made if there is already a request running. + +Defaults to `true`. + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`cancelRefetch`](RefetchOptions.md#cancelrefetch) + +*** + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) + +#### Inherited from + +[`RefetchOptions`](RefetchOptions.md).[`throwOnError`](RefetchOptions.md#throwonerror) diff --git a/docs/framework/vue/reference/interfaces/ResultOptions.md b/docs/framework/vue/reference/interfaces/ResultOptions.md new file mode 100644 index 00000000000..dbf00d6c67e --- /dev/null +++ b/docs/framework/vue/reference/interfaces/ResultOptions.md @@ -0,0 +1,22 @@ +--- +id: ResultOptions +title: ResultOptions +--- + +Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) + +## Extended by + +- [`RefetchOptions`](RefetchOptions.md) +- [`FetchNextPageOptions`](FetchNextPageOptions.md) +- [`FetchPreviousPageOptions`](FetchPreviousPageOptions.md) + +## Properties + +### throwOnError? + +```ts +optional throwOnError: boolean; +``` + +Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) diff --git a/docs/framework/vue/reference/interfaces/SetDataOptions.md b/docs/framework/vue/reference/interfaces/SetDataOptions.md new file mode 100644 index 00000000000..5fcbcfdf7cd --- /dev/null +++ b/docs/framework/vue/reference/interfaces/SetDataOptions.md @@ -0,0 +1,16 @@ +--- +id: SetDataOptions +title: SetDataOptions +--- + +Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1448) + +## Properties + +### updatedAt? + +```ts +optional updatedAt: number; +``` + +Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) diff --git a/docs/framework/vue/reference/type-aliases/AnyDataTag.md b/docs/framework/vue/reference/type-aliases/AnyDataTag.md new file mode 100644 index 00000000000..d3d5e33bb3e --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/AnyDataTag.md @@ -0,0 +1,30 @@ +--- +id: AnyDataTag +title: AnyDataTag +--- + +```ts +type AnyDataTag = object; +``` + +Defined in: [packages/query-core/src/types.ts:67](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L67) + +## Properties + +### \[dataTagErrorSymbol\] + +```ts +[dataTagErrorSymbol]: any; +``` + +Defined in: [packages/query-core/src/types.ts:69](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L69) + +*** + +### \[dataTagSymbol\] + +```ts +[dataTagSymbol]: any; +``` + +Defined in: [packages/query-core/src/types.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L68) diff --git a/docs/framework/vue/reference/type-aliases/DataTag.md b/docs/framework/vue/reference/type-aliases/DataTag.md new file mode 100644 index 00000000000..904ca124464 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/DataTag.md @@ -0,0 +1,24 @@ +--- +id: DataTag +title: DataTag +--- + +```ts +type DataTag = TType extends AnyDataTag ? TType : TType & object; +``` + +Defined in: [packages/query-core/src/types.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L71) + +## Type Parameters + +### TType + +`TType` + +### TValue + +`TValue` + +### TError + +`TError` = [`UnsetMarker`](UnsetMarker.md) diff --git a/docs/framework/vue/reference/type-aliases/DefaultError.md b/docs/framework/vue/reference/type-aliases/DefaultError.md new file mode 100644 index 00000000000..da9f615482f --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/DefaultError.md @@ -0,0 +1,10 @@ +--- +id: DefaultError +title: DefaultError +--- + +```ts +type DefaultError = Register extends object ? TError : Error; +``` + +Defined in: [packages/query-core/src/types.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L45) diff --git a/docs/framework/vue/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/vue/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md new file mode 100644 index 00000000000..733a1a5ad75 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -0,0 +1,32 @@ +--- +id: DefaultedInfiniteQueryObserverOptions +title: DefaultedInfiniteQueryObserverOptions +--- + +```ts +type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; +``` + +Defined in: [packages/query-core/src/types.ts:538](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L538) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` diff --git a/docs/framework/vue/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/vue/reference/type-aliases/DefaultedQueryObserverOptions.md new file mode 100644 index 00000000000..1b4309f150c --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -0,0 +1,32 @@ +--- +id: DefaultedQueryObserverOptions +title: DefaultedQueryObserverOptions +--- + +```ts +type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; +``` + +Defined in: [packages/query-core/src/types.ts:509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L509) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult.md new file mode 100644 index 00000000000..ced8e568299 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -0,0 +1,22 @@ +--- +id: DefinedInfiniteQueryObserverResult +title: DefinedInfiniteQueryObserverResult +--- + +```ts +type DefinedInfiniteQueryObserverResult = + | InfiniteQueryObserverRefetchErrorResult +| InfiniteQueryObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/vue/reference/type-aliases/DefinedInitialDataInfiniteOptions.md b/docs/framework/vue/reference/type-aliases/DefinedInitialDataInfiniteOptions.md index 03b1ffdd63c..f812ea8d2d8 100644 --- a/docs/framework/vue/reference/type-aliases/DefinedInitialDataInfiniteOptions.md +++ b/docs/framework/vue/reference/type-aliases/DefinedInitialDataInfiniteOptions.md @@ -7,7 +7,7 @@ title: DefinedInitialDataInfiniteOptions type DefinedInitialDataInfiniteOptions = UseInfiniteQueryOptions & object; ``` -Defined in: [vue-query/src/infiniteQueryOptions.ts:48](https://github.com/TanStack/query/blob/main/packages/vue-query/src/infiniteQueryOptions.ts#L48) +Defined in: [packages/vue-query/src/infiniteQueryOptions.ts:48](https://github.com/TanStack/query/blob/main/packages/vue-query/src/infiniteQueryOptions.ts#L48) The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is set — `data` is never `undefined`. @@ -38,20 +38,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/vue/reference/type-aliases/DefinedInitialQueryOptions.md b/docs/framework/vue/reference/type-aliases/DefinedInitialQueryOptions.md index fd07af0e22d..149f939f4de 100644 --- a/docs/framework/vue/reference/type-aliases/DefinedInitialQueryOptions.md +++ b/docs/framework/vue/reference/type-aliases/DefinedInitialQueryOptions.md @@ -7,7 +7,7 @@ title: DefinedInitialQueryOptions type DefinedInitialQueryOptions = UseQueryOptions & object; ``` -Defined in: [vue-query/src/useQuery.ts:79](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L79) +Defined in: [packages/vue-query/src/useQuery.ts:79](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L79) ## Type Declaration @@ -27,7 +27,7 @@ initialData: ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData @@ -35,4 +35,4 @@ initialData: ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/vue/reference/type-aliases/DefinedInitialQueryOptionsWithDataTag.md b/docs/framework/vue/reference/type-aliases/DefinedInitialQueryOptionsWithDataTag.md index 048fb5dec4f..634caa6b0b2 100644 --- a/docs/framework/vue/reference/type-aliases/DefinedInitialQueryOptionsWithDataTag.md +++ b/docs/framework/vue/reference/type-aliases/DefinedInitialQueryOptionsWithDataTag.md @@ -7,7 +7,7 @@ title: DefinedInitialQueryOptionsWithDataTag type DefinedInitialQueryOptionsWithDataTag = DefinedInitialQueryOptions & QueryKeyWithDataTag; ``` -Defined in: [vue-query/src/queryOptions.ts:131](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryOptions.ts#L131) +Defined in: [packages/vue-query/src/queryOptions.ts:131](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryOptions.ts#L131) ## Type Parameters @@ -17,7 +17,7 @@ Defined in: [vue-query/src/queryOptions.ts:131](https://github.com/TanStack/quer ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData @@ -25,4 +25,4 @@ Defined in: [vue-query/src/queryOptions.ts:131](https://github.com/TanStack/quer ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/vue/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/vue/reference/type-aliases/DefinedQueryObserverResult.md new file mode 100644 index 00000000000..7afdbfd38bc --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/DefinedQueryObserverResult.md @@ -0,0 +1,22 @@ +--- +id: DefinedQueryObserverResult +title: DefinedQueryObserverResult +--- + +```ts +type DefinedQueryObserverResult = + | QueryObserverRefetchErrorResult +| QueryObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/vue/reference/type-aliases/DistributiveOmit.md b/docs/framework/vue/reference/type-aliases/DistributiveOmit.md new file mode 100644 index 00000000000..33b87a5cd6e --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/DistributiveOmit.md @@ -0,0 +1,20 @@ +--- +id: DistributiveOmit +title: DistributiveOmit +--- + +```ts +type DistributiveOmit = TObject extends any ? Omit : never; +``` + +Defined in: [packages/query-core/src/types.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L14) + +## Type Parameters + +### TObject + +`TObject` + +### TKey + +`TKey` *extends* keyof `TObject` diff --git a/docs/framework/vue/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/vue/reference/type-aliases/EnsureInfiniteQueryDataOptions.md new file mode 100644 index 00000000000..305eef94893 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -0,0 +1,42 @@ +--- +id: EnsureInfiniteQueryDataOptions +title: EnsureInfiniteQueryDataOptions +--- + +```ts +type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; +``` + +Defined in: [packages/query-core/src/types.ts:612](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L612) + +## Type Declaration + +### ~~revalidateIfStale?~~ + +```ts +optional revalidateIfStale: boolean; +``` + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Deprecated diff --git a/docs/framework/vue/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/vue/reference/type-aliases/FetchInfiniteQueryOptions.md new file mode 100644 index 00000000000..1ee1470b14a --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -0,0 +1,34 @@ +--- +id: FetchInfiniteQueryOptions +title: FetchInfiniteQueryOptions +--- + +```ts +type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; +``` + +Defined in: [packages/query-core/src/types.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L656) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` + +## Deprecated diff --git a/docs/framework/vue/reference/type-aliases/FetchStatus.md b/docs/framework/vue/reference/type-aliases/FetchStatus.md new file mode 100644 index 00000000000..4dae9444af6 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/FetchStatus.md @@ -0,0 +1,10 @@ +--- +id: FetchStatus +title: FetchStatus +--- + +```ts +type FetchStatus = "fetching" | "paused" | "idle"; +``` + +Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) diff --git a/docs/framework/vue/reference/type-aliases/GetNextPageParamFunction.md b/docs/framework/vue/reference/type-aliases/GetNextPageParamFunction.md new file mode 100644 index 00000000000..81d1a1544ab --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/GetNextPageParamFunction.md @@ -0,0 +1,42 @@ +--- +id: GetNextPageParamFunction +title: GetNextPageParamFunction +--- + +```ts +type GetNextPageParamFunction = (lastPage, allPages, lastPageParam, allPageParams) => TPageParam | undefined | null; +``` + +Defined in: [packages/query-core/src/types.ts:203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L203) + +## Type Parameters + +### TPageParam + +`TPageParam` + +### TQueryFnData + +`TQueryFnData` = `unknown` + +## Parameters + +### lastPage + +`TQueryFnData` + +### allPages + +`TQueryFnData`[] + +### lastPageParam + +`TPageParam` + +### allPageParams + +`TPageParam`[] + +## Returns + +`TPageParam` \| `undefined` \| `null` diff --git a/docs/framework/vue/reference/type-aliases/GetPreviousPageParamFunction.md b/docs/framework/vue/reference/type-aliases/GetPreviousPageParamFunction.md new file mode 100644 index 00000000000..5a6d9b93d7e --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/GetPreviousPageParamFunction.md @@ -0,0 +1,42 @@ +--- +id: GetPreviousPageParamFunction +title: GetPreviousPageParamFunction +--- + +```ts +type GetPreviousPageParamFunction = (firstPage, allPages, firstPageParam, allPageParams) => TPageParam | undefined | null; +``` + +Defined in: [packages/query-core/src/types.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L196) + +## Type Parameters + +### TPageParam + +`TPageParam` + +### TQueryFnData + +`TQueryFnData` = `unknown` + +## Parameters + +### firstPage + +`TQueryFnData` + +### allPages + +`TQueryFnData`[] + +### firstPageParam + +`TPageParam` + +### allPageParams + +`TPageParam`[] + +## Returns + +`TPageParam` \| `undefined` \| `null` diff --git a/docs/framework/vue/reference/type-aliases/InferDataFromTag.md b/docs/framework/vue/reference/type-aliases/InferDataFromTag.md new file mode 100644 index 00000000000..09a15ca4b1c --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/InferDataFromTag.md @@ -0,0 +1,20 @@ +--- +id: InferDataFromTag +title: InferDataFromTag +--- + +```ts +type InferDataFromTag = TTaggedQueryKey extends DataTag ? TaggedValue : TQueryFnData; +``` + +Defined in: [packages/query-core/src/types.ts:90](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L90) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` + +### TTaggedQueryKey + +`TTaggedQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/vue/reference/type-aliases/InferErrorFromTag.md b/docs/framework/vue/reference/type-aliases/InferErrorFromTag.md new file mode 100644 index 00000000000..cd94e4b5c3f --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/InferErrorFromTag.md @@ -0,0 +1,20 @@ +--- +id: InferErrorFromTag +title: InferErrorFromTag +--- + +```ts +type InferErrorFromTag = TTaggedQueryKey extends DataTag ? TaggedError extends UnsetMarker ? TError : TaggedError : TError; +``` + +Defined in: [packages/query-core/src/types.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L95) + +## Type Parameters + +### TError + +`TError` + +### TTaggedQueryKey + +`TTaggedQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/vue/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/vue/reference/type-aliases/InfiniteQueryExecuteOptions.md new file mode 100644 index 00000000000..29c974cfddf --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -0,0 +1,32 @@ +--- +id: InfiniteQueryExecuteOptions +title: InfiniteQueryExecuteOptions +--- + +```ts +type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; +``` + +Defined in: [packages/query-core/src/types.ts:635](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L635) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `unknown` diff --git a/docs/framework/vue/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/vue/reference/type-aliases/InfiniteQueryObserverResult.md new file mode 100644 index 00000000000..95fda780d1d --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/InfiniteQueryObserverResult.md @@ -0,0 +1,25 @@ +--- +id: InfiniteQueryObserverResult +title: InfiniteQueryObserverResult +--- + +```ts +type InfiniteQueryObserverResult = + | DefinedInfiniteQueryObserverResult + | InfiniteQueryObserverLoadingErrorResult + | InfiniteQueryObserverLoadingResult + | InfiniteQueryObserverPendingResult +| InfiniteQueryObserverPlaceholderResult; +``` + +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/vue/reference/type-aliases/InitialDataFunction.md b/docs/framework/vue/reference/type-aliases/InitialDataFunction.md new file mode 100644 index 00000000000..6ba4aaabe61 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/InitialDataFunction.md @@ -0,0 +1,20 @@ +--- +id: InitialDataFunction +title: InitialDataFunction +--- + +```ts +type InitialDataFunction = () => T | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L173) + +## Type Parameters + +### T + +`T` + +## Returns + +`T` \| `undefined` diff --git a/docs/framework/vue/reference/type-aliases/ManagedTimerId.md b/docs/framework/vue/reference/type-aliases/ManagedTimerId.md new file mode 100644 index 00000000000..d7833e3e4f0 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/ManagedTimerId.md @@ -0,0 +1,19 @@ +--- +id: ManagedTimerId +title: ManagedTimerId +--- + +```ts +type ManagedTimerId = + | number + | { + [toPrimitive]: () => number; +}; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:17](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L17) + +Wrapping `setTimeout` is awkward from a typing perspective because platform +typings may extend the return type of `setTimeout`. For example, NodeJS +typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be +able to return such a type. diff --git a/docs/framework/vue/reference/type-aliases/MutateFunction.md b/docs/framework/vue/reference/type-aliases/MutateFunction.md new file mode 100644 index 00000000000..f574ca7f8ca --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/MutateFunction.md @@ -0,0 +1,38 @@ +--- +id: MutateFunction +title: MutateFunction +--- + +```ts +type MutateFunction = (...rest) => Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1258) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` + +## Parameters + +### rest + +...[`MutateFunctionRest`](MutateFunctionRest.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> + +## Returns + +`Promise`\<`TData`\> diff --git a/docs/framework/vue/reference/type-aliases/MutateFunctionRest.md b/docs/framework/vue/reference/type-aliases/MutateFunctionRest.md new file mode 100644 index 00000000000..aef21572aeb --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/MutateFunctionRest.md @@ -0,0 +1,28 @@ +--- +id: MutateFunctionRest +title: MutateFunctionRest +--- + +```ts +type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; +``` + +Defined in: [packages/query-core/src/types.ts:1243](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1243) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` diff --git a/docs/framework/vue/reference/type-aliases/MutationCacheNotifyEvent.md b/docs/framework/vue/reference/type-aliases/MutationCacheNotifyEvent.md new file mode 100644 index 00000000000..aa5e196bc72 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/MutationCacheNotifyEvent.md @@ -0,0 +1,20 @@ +--- +id: MutationCacheNotifyEvent +title: MutationCacheNotifyEvent +--- + +```ts +type MutationCacheNotifyEvent = + | NotifyEventMutationAdded + | NotifyEventMutationRemoved + | NotifyEventMutationObserverAdded + | NotifyEventMutationObserverRemoved + | NotifyEventMutationObserverOptionsUpdated + | NotifyEventMutationUpdated; +``` + +Defined in: [packages/query-core/src/mutationCache.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L98) + +The event passed to a `MutationCache` subscriber. Fired whenever a mutation is added or removed +from the cache, its state is updated, or one of its observers is added, removed, or has its +options updated. diff --git a/docs/framework/vue/reference/type-aliases/MutationFilters.md b/docs/framework/vue/reference/type-aliases/MutationFilters.md index cceadab3c02..f390b33f78c 100644 --- a/docs/framework/vue/reference/type-aliases/MutationFilters.md +++ b/docs/framework/vue/reference/type-aliases/MutationFilters.md @@ -7,4 +7,4 @@ title: MutationFilters type MutationFilters = MaybeRefDeep; ``` -Defined in: [vue-query/src/useMutationState.ts:21](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutationState.ts#L21) +Defined in: [packages/vue-query/src/useMutationState.ts:21](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutationState.ts#L21) diff --git a/docs/framework/vue/reference/type-aliases/MutationFunction.md b/docs/framework/vue/reference/type-aliases/MutationFunction.md new file mode 100644 index 00000000000..e306a5f1a48 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/MutationFunction.md @@ -0,0 +1,34 @@ +--- +id: MutationFunction +title: MutationFunction +--- + +```ts +type MutationFunction = (variables, context) => Promise; +``` + +Defined in: [packages/query-core/src/types.ts:1161](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1161) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TVariables + +`TVariables` = `unknown` + +## Parameters + +### variables + +`TVariables` + +### context + +[`MutationFunctionContext`](MutationFunctionContext.md) + +## Returns + +`Promise`\<`TData`\> diff --git a/docs/framework/vue/reference/type-aliases/MutationFunctionContext.md b/docs/framework/vue/reference/type-aliases/MutationFunctionContext.md new file mode 100644 index 00000000000..b29a54df298 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/MutationFunctionContext.md @@ -0,0 +1,40 @@ +--- +id: MutationFunctionContext +title: MutationFunctionContext +--- + +```ts +type MutationFunctionContext = object; +``` + +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) + +## Properties + +### client + +```ts +client: QueryClient; +``` + +Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) + +*** + +### meta + +```ts +meta: MutationMeta | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) + +*** + +### mutationKey? + +```ts +optional mutationKey: MutationKey; +``` + +Defined in: [packages/query-core/src/types.ts:1158](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1158) diff --git a/docs/framework/vue/reference/type-aliases/MutationKey.md b/docs/framework/vue/reference/type-aliases/MutationKey.md new file mode 100644 index 00000000000..f89c6959883 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/MutationKey.md @@ -0,0 +1,10 @@ +--- +id: MutationKey +title: MutationKey +--- + +```ts +type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; +``` + +Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) diff --git a/docs/framework/vue/reference/type-aliases/MutationMeta.md b/docs/framework/vue/reference/type-aliases/MutationMeta.md new file mode 100644 index 00000000000..e1d481cdcf1 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/MutationMeta.md @@ -0,0 +1,10 @@ +--- +id: MutationMeta +title: MutationMeta +--- + +```ts +type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; +``` + +Defined in: [packages/query-core/src/types.ts:1147](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1147) diff --git a/docs/framework/vue/reference/type-aliases/MutationObserverResult.md b/docs/framework/vue/reference/type-aliases/MutationObserverResult.md new file mode 100644 index 00000000000..cbd07f40537 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/MutationObserverResult.md @@ -0,0 +1,32 @@ +--- +id: MutationObserverResult +title: MutationObserverResult +--- + +```ts +type MutationObserverResult = + | MutationObserverIdleResult + | MutationObserverLoadingResult + | MutationObserverErrorResult +| MutationObserverSuccessResult; +``` + +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TVariables + +`TVariables` = `void` + +### TOnMutateResult + +`TOnMutateResult` = `unknown` diff --git a/docs/framework/vue/reference/type-aliases/MutationOptions.md b/docs/framework/vue/reference/type-aliases/MutationOptions.md index 6932ca0f394..c71ea9581b3 100644 --- a/docs/framework/vue/reference/type-aliases/MutationOptions.md +++ b/docs/framework/vue/reference/type-aliases/MutationOptions.md @@ -7,7 +7,7 @@ title: MutationOptions type MutationOptions = OmitKeyof, "_defaulted"> & ShallowOption; ``` -Defined in: [vue-query/src/types.ts:85](https://github.com/TanStack/query/blob/main/packages/vue-query/src/types.ts#L85) +Defined in: [packages/vue-query/src/types.ts:85](https://github.com/TanStack/query/blob/main/packages/vue-query/src/types.ts#L85) ## Type Parameters @@ -17,7 +17,7 @@ Defined in: [vue-query/src/types.ts:85](https://github.com/TanStack/query/blob/m ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TVariables diff --git a/docs/framework/vue/reference/type-aliases/MutationScope.md b/docs/framework/vue/reference/type-aliases/MutationScope.md new file mode 100644 index 00000000000..6ec14643477 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/MutationScope.md @@ -0,0 +1,20 @@ +--- +id: MutationScope +title: MutationScope +--- + +```ts +type MutationScope = object; +``` + +Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) + +## Properties + +### id + +```ts +id: string; +``` + +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) diff --git a/docs/framework/vue/reference/type-aliases/MutationStateOptions.md b/docs/framework/vue/reference/type-aliases/MutationStateOptions.md index c320b78c94a..bbd9864dc2b 100644 --- a/docs/framework/vue/reference/type-aliases/MutationStateOptions.md +++ b/docs/framework/vue/reference/type-aliases/MutationStateOptions.md @@ -7,17 +7,17 @@ title: MutationStateOptions type MutationStateOptions = object; ``` -Defined in: [vue-query/src/useMutationState.ts:88](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutationState.ts#L88) +Defined in: [packages/vue-query/src/useMutationState.ts:88](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutationState.ts#L88) ## Type Parameters ### TResult -`TResult` = `MutationState` +`TResult` = [`MutationState`](../interfaces/MutationState.md) ### TMutation -`TMutation` *extends* `Mutation`\<`any`, `any`, `any`, `any`\> = `MutationTypeFromResult`\<`TResult`\> +`TMutation` *extends* [`Mutation`](../classes/Mutation.md)\<`any`, `any`, `any`, `any`\> = `MutationTypeFromResult`\<`TResult`\> ## Properties @@ -27,7 +27,7 @@ Defined in: [vue-query/src/useMutationState.ts:88](https://github.com/TanStack/q optional filters: MutationFilters; ``` -Defined in: [vue-query/src/useMutationState.ts:93](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutationState.ts#L93) +Defined in: [packages/vue-query/src/useMutationState.ts:93](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutationState.ts#L93) *** @@ -37,7 +37,7 @@ Defined in: [vue-query/src/useMutationState.ts:93](https://github.com/TanStack/q optional select: (mutation) => TResult; ``` -Defined in: [vue-query/src/useMutationState.ts:94](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutationState.ts#L94) +Defined in: [packages/vue-query/src/useMutationState.ts:94](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutationState.ts#L94) #### Parameters diff --git a/docs/framework/vue/reference/type-aliases/MutationStatus.md b/docs/framework/vue/reference/type-aliases/MutationStatus.md new file mode 100644 index 00000000000..eedf0fb979a --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/MutationStatus.md @@ -0,0 +1,10 @@ +--- +id: MutationStatus +title: MutationStatus +--- + +```ts +type MutationStatus = "idle" | "pending" | "success" | "error"; +``` + +Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) diff --git a/docs/framework/vue/reference/type-aliases/NetworkMode.md b/docs/framework/vue/reference/type-aliases/NetworkMode.md new file mode 100644 index 00000000000..94ae0ba76ed --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/NetworkMode.md @@ -0,0 +1,10 @@ +--- +id: NetworkMode +title: NetworkMode +--- + +```ts +type NetworkMode = "online" | "always" | "offlineFirst"; +``` + +Defined in: [packages/query-core/src/types.ts:223](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L223) diff --git a/docs/framework/vue/reference/type-aliases/NonUndefinedGuard.md b/docs/framework/vue/reference/type-aliases/NonUndefinedGuard.md new file mode 100644 index 00000000000..4aaf208013b --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/NonUndefinedGuard.md @@ -0,0 +1,16 @@ +--- +id: NonUndefinedGuard +title: NonUndefinedGuard +--- + +```ts +type NonUndefinedGuard = T extends undefined ? never : T; +``` + +Defined in: [packages/query-core/src/types.ts:12](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L12) + +## Type Parameters + +### T + +`T` diff --git a/docs/framework/vue/reference/type-aliases/NotifyEventType.md b/docs/framework/vue/reference/type-aliases/NotifyEventType.md new file mode 100644 index 00000000000..7b788ced7af --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/NotifyEventType.md @@ -0,0 +1,17 @@ +--- +id: NotifyEventType +title: NotifyEventType +--- + +```ts +type NotifyEventType = + | "added" + | "removed" + | "updated" + | "observerAdded" + | "observerRemoved" + | "observerResultsUpdated" + | "observerOptionsUpdated"; +``` + +Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) diff --git a/docs/framework/vue/reference/type-aliases/NotifyOnChangeProps.md b/docs/framework/vue/reference/type-aliases/NotifyOnChangeProps.md new file mode 100644 index 00000000000..7de194fa10b --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/NotifyOnChangeProps.md @@ -0,0 +1,17 @@ +--- +id: NotifyOnChangeProps +title: NotifyOnChangeProps +--- + +```ts +type NotifyOnChangeProps = + | keyof InfiniteQueryObserverResult[] + | "all" + | undefined + | () => + | keyof InfiniteQueryObserverResult[] + | "all" + | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L225) diff --git a/docs/framework/vue/reference/type-aliases/OmitKeyof.md b/docs/framework/vue/reference/type-aliases/OmitKeyof.md new file mode 100644 index 00000000000..690a7b0a5d2 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/OmitKeyof.md @@ -0,0 +1,28 @@ +--- +id: OmitKeyof +title: OmitKeyof +--- + +```ts +type OmitKeyof = Omit; +``` + +Defined in: [packages/query-core/src/types.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L19) + +## Type Parameters + +### TObject + +`TObject` + +### TKey + +`TKey` *extends* `TStrictly` *extends* `"safely"` ? + \| keyof `TObject` + \| `string` & `Record`\<`never`, `never`\> + \| `number` & `Record`\<`never`, `never`\> + \| `symbol` & `Record`\<`never`, `never`\> : keyof `TObject` + +### TStrictly + +`TStrictly` *extends* `"strictly"` \| `"safely"` = `"strictly"` diff --git a/docs/framework/vue/reference/type-aliases/Override.md b/docs/framework/vue/reference/type-aliases/Override.md new file mode 100644 index 00000000000..8abcecd1e1b --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/Override.md @@ -0,0 +1,20 @@ +--- +id: Override +title: Override +--- + +```ts +type Override = { [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey] }; +``` + +Defined in: [packages/query-core/src/types.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L31) + +## Type Parameters + +### TTargetA + +`TTargetA` + +### TTargetB + +`TTargetB` diff --git a/docs/framework/vue/reference/type-aliases/PlaceholderDataFunction.md b/docs/framework/vue/reference/type-aliases/PlaceholderDataFunction.md new file mode 100644 index 00000000000..cd40f28b41e --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/PlaceholderDataFunction.md @@ -0,0 +1,42 @@ +--- +id: PlaceholderDataFunction +title: PlaceholderDataFunction +--- + +```ts +type PlaceholderDataFunction = (previousData, previousQuery) => TQueryData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:177](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L177) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TQueryData + +`TQueryData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +## Parameters + +### previousData + +`TQueryData` | `undefined` + +### previousQuery + +[`Query`](../classes/Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\> | `undefined` + +## Returns + +`TQueryData` \| `undefined` diff --git a/docs/framework/vue/reference/type-aliases/QueriesPlaceholderDataFunction.md b/docs/framework/vue/reference/type-aliases/QueriesPlaceholderDataFunction.md new file mode 100644 index 00000000000..5d3fca8c9e0 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/QueriesPlaceholderDataFunction.md @@ -0,0 +1,30 @@ +--- +id: QueriesPlaceholderDataFunction +title: QueriesPlaceholderDataFunction +--- + +```ts +type QueriesPlaceholderDataFunction = (previousData, previousQuery) => TQueryData | undefined; +``` + +Defined in: [packages/query-core/src/types.ts:187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L187) + +## Type Parameters + +### TQueryData + +`TQueryData` + +## Parameters + +### previousData + +`undefined` + +### previousQuery + +`undefined` + +## Returns + +`TQueryData` \| `undefined` diff --git a/docs/framework/vue/reference/type-aliases/QueryBooleanOption.md b/docs/framework/vue/reference/type-aliases/QueryBooleanOption.md new file mode 100644 index 00000000000..9759e3ddb42 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/QueryBooleanOption.md @@ -0,0 +1,28 @@ +--- +id: QueryBooleanOption +title: QueryBooleanOption +--- + +```ts +type QueryBooleanOption = boolean | (query) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L119) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/vue/reference/type-aliases/QueryCacheNotifyEvent.md b/docs/framework/vue/reference/type-aliases/QueryCacheNotifyEvent.md new file mode 100644 index 00000000000..8e52da9e279 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/QueryCacheNotifyEvent.md @@ -0,0 +1,21 @@ +--- +id: QueryCacheNotifyEvent +title: QueryCacheNotifyEvent +--- + +```ts +type QueryCacheNotifyEvent = + | NotifyEventQueryAdded + | NotifyEventQueryRemoved + | NotifyEventQueryUpdated + | NotifyEventQueryObserverAdded + | NotifyEventQueryObserverRemoved + | NotifyEventQueryObserverResultsUpdated + | NotifyEventQueryObserverOptionsUpdated; +``` + +Defined in: [packages/query-core/src/queryCache.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L84) + +The event passed to a `QueryCache` subscriber. Fired whenever a query is added or removed from +the cache, its state is updated (e.g. via `query.setState` or `queryClient.removeQueries`), or +one of its observers is added, removed, or has its results or options updated. diff --git a/docs/framework/vue/reference/type-aliases/QueryFilters.md b/docs/framework/vue/reference/type-aliases/QueryFilters.md index d8d3f13d56b..0032552ec39 100644 --- a/docs/framework/vue/reference/type-aliases/QueryFilters.md +++ b/docs/framework/vue/reference/type-aliases/QueryFilters.md @@ -7,4 +7,4 @@ title: QueryFilters type QueryFilters = MaybeRefDeep | () => MaybeRefDeep; ``` -Defined in: [vue-query/src/useIsFetching.ts:9](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useIsFetching.ts#L9) +Defined in: [packages/vue-query/src/useIsFetching.ts:9](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useIsFetching.ts#L9) diff --git a/docs/framework/vue/reference/type-aliases/QueryFunction.md b/docs/framework/vue/reference/type-aliases/QueryFunction.md new file mode 100644 index 00000000000..306367388a1 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/QueryFunction.md @@ -0,0 +1,34 @@ +--- +id: QueryFunction +title: QueryFunction +--- + +```ts +type QueryFunction = (context) => T | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L102) + +## Type Parameters + +### T + +`T` = `unknown` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` + +## Parameters + +### context + +[`QueryFunctionContext`](QueryFunctionContext.md)\<`TQueryKey`, `TPageParam`\> + +## Returns + +`T` \| `Promise`\<`T`\> diff --git a/docs/framework/vue/reference/type-aliases/QueryFunctionContext.md b/docs/framework/vue/reference/type-aliases/QueryFunctionContext.md new file mode 100644 index 00000000000..d2c9fe3e2b2 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/QueryFunctionContext.md @@ -0,0 +1,20 @@ +--- +id: QueryFunctionContext +title: QueryFunctionContext +--- + +```ts +type QueryFunctionContext = [TPageParam] extends [never] ? object : object; +``` + +Defined in: [packages/query-core/src/types.ts:144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L144) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` diff --git a/docs/framework/vue/reference/type-aliases/QueryKey.md b/docs/framework/vue/reference/type-aliases/QueryKey.md new file mode 100644 index 00000000000..1a3f34cde18 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/QueryKey.md @@ -0,0 +1,10 @@ +--- +id: QueryKey +title: QueryKey +--- + +```ts +type QueryKey = Register extends object ? TQueryKey extends ReadonlyArray ? TQueryKey : TQueryKey extends unknown[] ? TQueryKey : ReadonlyArray : ReadonlyArray; +``` + +Defined in: [packages/query-core/src/types.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L51) diff --git a/docs/framework/vue/reference/type-aliases/QueryKeyHashFunction.md b/docs/framework/vue/reference/type-aliases/QueryKeyHashFunction.md new file mode 100644 index 00000000000..feda96373cc --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/QueryKeyHashFunction.md @@ -0,0 +1,26 @@ +--- +id: QueryKeyHashFunction +title: QueryKeyHashFunction +--- + +```ts +type QueryKeyHashFunction = (queryKey) => string; +``` + +Defined in: [packages/query-core/src/types.ts:192](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L192) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) + +## Parameters + +### queryKey + +`TQueryKey` + +## Returns + +`string` diff --git a/docs/framework/vue/reference/type-aliases/QueryKeyWithDataTag.md b/docs/framework/vue/reference/type-aliases/QueryKeyWithDataTag.md new file mode 100644 index 00000000000..6613f74be9e --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/QueryKeyWithDataTag.md @@ -0,0 +1,34 @@ +--- +id: QueryKeyWithDataTag +title: QueryKeyWithDataTag +--- + +```ts +type QueryKeyWithDataTag = object; +``` + +Defined in: [packages/query-core/src/types.ts:82](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L82) + +## Type Parameters + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +## Properties + +### queryKey + +```ts +queryKey: DataTag; +``` + +Defined in: [packages/query-core/src/types.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L87) diff --git a/docs/framework/vue/reference/type-aliases/QueryMeta.md b/docs/framework/vue/reference/type-aliases/QueryMeta.md new file mode 100644 index 00000000000..c12917b2cce --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/QueryMeta.md @@ -0,0 +1,10 @@ +--- +id: QueryMeta +title: QueryMeta +--- + +```ts +type QueryMeta = Register extends object ? TQueryMeta extends Record ? TQueryMeta : Record : Record; +``` + +Defined in: [packages/query-core/src/types.ts:215](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L215) diff --git a/docs/framework/vue/reference/type-aliases/QueryObserverResult.md b/docs/framework/vue/reference/type-aliases/QueryObserverResult.md new file mode 100644 index 00000000000..f6c4118a978 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/QueryObserverResult.md @@ -0,0 +1,25 @@ +--- +id: QueryObserverResult +title: QueryObserverResult +--- + +```ts +type QueryObserverResult = + | DefinedQueryObserverResult + | QueryObserverLoadingErrorResult + | QueryObserverLoadingResult + | QueryObserverPendingResult +| QueryObserverPlaceholderResult; +``` + +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) + +## Type Parameters + +### TData + +`TData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) diff --git a/docs/framework/vue/reference/type-aliases/QueryOptions.md b/docs/framework/vue/reference/type-aliases/QueryOptions.md index 5ef9644fef2..42502ad378a 100644 --- a/docs/framework/vue/reference/type-aliases/QueryOptions.md +++ b/docs/framework/vue/reference/type-aliases/QueryOptions.md @@ -7,7 +7,7 @@ title: QueryOptions type QueryOptions = { [Property in keyof QueryObserverOptions]: Property extends "enabled" ? MaybeRefOrGetter | (() => QueryBooleanOption>) : Property extends "queryKey" ? MaybeRefOrGetter : QueryObserverOptions>[Property] } & ShallowOption; ``` -Defined in: [vue-query/src/queryOptions.ts:35](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryOptions.ts#L35) +Defined in: [packages/vue-query/src/queryOptions.ts:35](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryOptions.ts#L35) The options accepted by `queryOptions`, `useQuery`, and the other query hooks. `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter (`() => ...`). `queryKey` reacts @@ -34,7 +34,7 @@ The type your `queryFn` resolves to. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. @@ -53,6 +53,6 @@ The type of data stored in the cache, before `select` runs. Defaults to ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/vue/reference/type-aliases/QueryPersister.md b/docs/framework/vue/reference/type-aliases/QueryPersister.md new file mode 100644 index 00000000000..72e80165b0d --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/QueryPersister.md @@ -0,0 +1,24 @@ +--- +id: QueryPersister +title: QueryPersister +--- + +```ts +type QueryPersister = [TPageParam] extends [never] ? (queryFn, context, query) => T | Promise : (queryFn, context, query) => T | Promise; +``` + +Defined in: [packages/query-core/src/types.ts:128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L128) + +## Type Parameters + +### T + +`T` = `unknown` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) + +### TPageParam + +`TPageParam` = `never` diff --git a/docs/framework/vue/reference/type-aliases/QueryStatus.md b/docs/framework/vue/reference/type-aliases/QueryStatus.md new file mode 100644 index 00000000000..ed6059e03ec --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/QueryStatus.md @@ -0,0 +1,10 @@ +--- +id: QueryStatus +title: QueryStatus +--- + +```ts +type QueryStatus = "pending" | "error" | "success"; +``` + +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) diff --git a/docs/framework/vue/reference/type-aliases/SkipToken.md b/docs/framework/vue/reference/type-aliases/SkipToken.md new file mode 100644 index 00000000000..176c23830d2 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/SkipToken.md @@ -0,0 +1,12 @@ +--- +id: SkipToken +title: SkipToken +--- + +```ts +type SkipToken = typeof skipToken; +``` + +Defined in: [packages/query-core/src/utils.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L524) + +The type of the [skipToken](../variables/skipToken.md) sentinel value. diff --git a/docs/framework/vue/reference/type-aliases/StaleTime.md b/docs/framework/vue/reference/type-aliases/StaleTime.md new file mode 100644 index 00000000000..3e7e21608be --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/StaleTime.md @@ -0,0 +1,10 @@ +--- +id: StaleTime +title: StaleTime +--- + +```ts +type StaleTime = number | "static"; +``` + +Defined in: [packages/query-core/src/types.ts:108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L108) diff --git a/docs/framework/vue/reference/type-aliases/StaleTimeFunction.md b/docs/framework/vue/reference/type-aliases/StaleTimeFunction.md new file mode 100644 index 00000000000..b1c541fa64e --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/StaleTimeFunction.md @@ -0,0 +1,28 @@ +--- +id: StaleTimeFunction +title: StaleTimeFunction +--- + +```ts +type StaleTimeFunction = StaleTime | (query) => StaleTime; +``` + +Defined in: [packages/query-core/src/types.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L110) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` = `unknown` + +### TError + +`TError` = [`DefaultError`](DefaultError.md) + +### TData + +`TData` = `TQueryFnData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/vue/reference/type-aliases/ThrowOnError.md b/docs/framework/vue/reference/type-aliases/ThrowOnError.md new file mode 100644 index 00000000000..60ad44c1cd1 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/ThrowOnError.md @@ -0,0 +1,28 @@ +--- +id: ThrowOnError +title: ThrowOnError +--- + +```ts +type ThrowOnError = boolean | (error, query) => boolean; +``` + +Defined in: [packages/query-core/src/types.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L361) + +## Type Parameters + +### TQueryFnData + +`TQueryFnData` + +### TError + +`TError` + +### TQueryData + +`TQueryData` + +### TQueryKey + +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) diff --git a/docs/framework/vue/reference/type-aliases/TimeoutCallback.md b/docs/framework/vue/reference/type-aliases/TimeoutCallback.md new file mode 100644 index 00000000000..387fb1238f3 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/TimeoutCallback.md @@ -0,0 +1,27 @@ +--- +id: TimeoutCallback +title: TimeoutCallback +--- + +```ts +type TimeoutCallback = (_) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:9](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L9) + +TimeoutManager does not support passing arguments to the callback. + +`(_: void)` is the argument type inferred by TypeScript's default typings for +`setTimeout(cb, number)`. +If we don't accept a single void argument, then +`new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. + +## Parameters + +### \_ + +`void` + +## Returns + +`void` diff --git a/docs/framework/vue/reference/type-aliases/TimeoutProvider.md b/docs/framework/vue/reference/type-aliases/TimeoutProvider.md new file mode 100644 index 00000000000..6416fe4c557 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/TimeoutProvider.md @@ -0,0 +1,106 @@ +--- +id: TimeoutProvider +title: TimeoutProvider +--- + +```ts +type TimeoutProvider = object; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:22](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L22) + +Backend for timer functions. + +## Type Parameters + +### TTimerId + +`TTimerId` *extends* [`ManagedTimerId`](ManagedTimerId.md) = [`ManagedTimerId`](ManagedTimerId.md) + +## Properties + +### clearInterval() + +```ts +readonly clearInterval: (intervalId) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) + +#### Parameters + +##### intervalId + +`TTimerId` | `undefined` + +#### Returns + +`void` + +*** + +### clearTimeout() + +```ts +readonly clearTimeout: (timeoutId) => void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L25) + +#### Parameters + +##### timeoutId + +`TTimerId` | `undefined` + +#### Returns + +`void` + +*** + +### setInterval() + +```ts +readonly setInterval: (callback, delay) => TTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L27) + +#### Parameters + +##### callback + +[`TimeoutCallback`](TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +`TTimerId` + +*** + +### setTimeout() + +```ts +readonly setTimeout: (callback, delay) => TTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L24) + +#### Parameters + +##### callback + +[`TimeoutCallback`](TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +`TTimerId` diff --git a/docs/framework/vue/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md b/docs/framework/vue/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md index c4dc849c2a5..b92014e908c 100644 --- a/docs/framework/vue/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md +++ b/docs/framework/vue/reference/type-aliases/UndefinedInitialDataInfiniteOptions.md @@ -7,7 +7,7 @@ title: UndefinedInitialDataInfiniteOptions type UndefinedInitialDataInfiniteOptions = UseInfiniteQueryOptions & object; ``` -Defined in: [vue-query/src/infiniteQueryOptions.ts:21](https://github.com/TanStack/query/blob/main/packages/vue-query/src/infiniteQueryOptions.ts#L21) +Defined in: [packages/vue-query/src/infiniteQueryOptions.ts:21](https://github.com/TanStack/query/blob/main/packages/vue-query/src/infiniteQueryOptions.ts#L21) The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set — `data` may be `undefined` while the query is `pending`. @@ -30,20 +30,20 @@ The type of a single page, as your `queryFn` resolves it. ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) The type of errors your `queryFn` may throw. ### TData -`TData` = `InfiniteData`\<`TQueryFnData`\> +`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\> The type `data` ends up as after `select` runs — defaults to `InfiniteData`, the shape of all fetched pages plus their page params. ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) The type of your `queryKey`. diff --git a/docs/framework/vue/reference/type-aliases/UndefinedInitialQueryOptions.md b/docs/framework/vue/reference/type-aliases/UndefinedInitialQueryOptions.md index 96a4386cdf6..7d45fc7c8b4 100644 --- a/docs/framework/vue/reference/type-aliases/UndefinedInitialQueryOptions.md +++ b/docs/framework/vue/reference/type-aliases/UndefinedInitialQueryOptions.md @@ -7,7 +7,7 @@ title: UndefinedInitialQueryOptions type UndefinedInitialQueryOptions = UseQueryOptions & object; ``` -Defined in: [vue-query/src/useQuery.ts:67](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L67) +Defined in: [packages/vue-query/src/useQuery.ts:67](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L67) ## Type Declaration @@ -27,7 +27,7 @@ optional initialData: ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData @@ -35,4 +35,4 @@ optional initialData: ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/vue/reference/type-aliases/UndefinedInitialQueryOptionsWithDataTag.md b/docs/framework/vue/reference/type-aliases/UndefinedInitialQueryOptionsWithDataTag.md index e62b049c1c6..9467eb094ff 100644 --- a/docs/framework/vue/reference/type-aliases/UndefinedInitialQueryOptionsWithDataTag.md +++ b/docs/framework/vue/reference/type-aliases/UndefinedInitialQueryOptionsWithDataTag.md @@ -7,7 +7,7 @@ title: UndefinedInitialQueryOptionsWithDataTag type UndefinedInitialQueryOptionsWithDataTag = UndefinedInitialQueryOptions & QueryKeyWithDataTag; ``` -Defined in: [vue-query/src/queryOptions.ts:123](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryOptions.ts#L123) +Defined in: [packages/vue-query/src/queryOptions.ts:123](https://github.com/TanStack/query/blob/main/packages/vue-query/src/queryOptions.ts#L123) ## Type Parameters @@ -17,7 +17,7 @@ Defined in: [vue-query/src/queryOptions.ts:123](https://github.com/TanStack/quer ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData @@ -25,4 +25,4 @@ Defined in: [vue-query/src/queryOptions.ts:123](https://github.com/TanStack/quer ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/vue/reference/type-aliases/UnsetMarker.md b/docs/framework/vue/reference/type-aliases/UnsetMarker.md new file mode 100644 index 00000000000..8b9c14e1907 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/UnsetMarker.md @@ -0,0 +1,10 @@ +--- +id: UnsetMarker +title: UnsetMarker +--- + +```ts +type UnsetMarker = typeof unsetMarker; +``` + +Defined in: [packages/query-core/src/types.ts:66](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L66) diff --git a/docs/framework/vue/reference/type-aliases/Updater.md b/docs/framework/vue/reference/type-aliases/Updater.md new file mode 100644 index 00000000000..b6a29ccc5fc --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/Updater.md @@ -0,0 +1,35 @@ +--- +id: Updater +title: Updater +--- + +```ts +type Updater = TOutput | (input) => TOutput; +``` + +Defined in: [packages/query-core/src/utils.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L103) + +Either a plain value of type `TOutput`, or a function that receives `TInput` and returns `TOutput`. +Used for example by `setQueryData`-style updaters, which accept either the new data directly or a +function that computes it from the previous data. See functionalUpdate. + +## Type Parameters + +### TInput + +`TInput` + +### TOutput + +`TOutput` + +## Example + +```ts +queryClient.setQueryData(['posts'], newPosts) + +// Or, using an updater function that receives the current data: +queryClient.setQueryData(['posts'], (oldPosts) => + oldPosts ? [...oldPosts, newPost] : oldPosts, +) +``` diff --git a/docs/framework/vue/reference/type-aliases/UseInfiniteQueryOptions.md b/docs/framework/vue/reference/type-aliases/UseInfiniteQueryOptions.md index 84008107bd2..339888b2926 100644 --- a/docs/framework/vue/reference/type-aliases/UseInfiniteQueryOptions.md +++ b/docs/framework/vue/reference/type-aliases/UseInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: UseInfiniteQueryOptions type UseInfiniteQueryOptions = MaybeRef<{ [Property in keyof InfiniteQueryObserverOptions]: Property extends "enabled" ? MaybeRefOrGetter, TPageParam>[Property]> : MaybeRefDeep, TPageParam>[Property]> } & ShallowOption>; ``` -Defined in: [vue-query/src/useInfiniteQuery.ts:27](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useInfiniteQuery.ts#L27) +Defined in: [packages/vue-query/src/useInfiniteQuery.ts:27](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useInfiniteQuery.ts#L27) ## Type Parameters @@ -17,7 +17,7 @@ Defined in: [vue-query/src/useInfiniteQuery.ts:27](https://github.com/TanStack/q ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData @@ -25,7 +25,7 @@ Defined in: [vue-query/src/useInfiniteQuery.ts:27](https://github.com/TanStack/q ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) ### TPageParam diff --git a/docs/framework/vue/reference/type-aliases/UseInfiniteQueryReturnType.md b/docs/framework/vue/reference/type-aliases/UseInfiniteQueryReturnType.md index 8e8040cead3..d20d3262153 100644 --- a/docs/framework/vue/reference/type-aliases/UseInfiniteQueryReturnType.md +++ b/docs/framework/vue/reference/type-aliases/UseInfiniteQueryReturnType.md @@ -7,7 +7,7 @@ title: UseInfiniteQueryReturnType type UseInfiniteQueryReturnType = UseBaseQueryReturnType>; ``` -Defined in: [vue-query/src/useInfiniteQuery.ts:63](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useInfiniteQuery.ts#L63) +Defined in: [packages/vue-query/src/useInfiniteQuery.ts:63](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useInfiniteQuery.ts#L63) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/UseMutationOptions.md b/docs/framework/vue/reference/type-aliases/UseMutationOptions.md index bd2d6da1012..c00317b956e 100644 --- a/docs/framework/vue/reference/type-aliases/UseMutationOptions.md +++ b/docs/framework/vue/reference/type-aliases/UseMutationOptions.md @@ -9,7 +9,7 @@ type UseMutationOptions = | () => MaybeRefDeep>; ``` -Defined in: [vue-query/src/useMutation.ts:31](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutation.ts#L31) +Defined in: [packages/vue-query/src/useMutation.ts:31](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutation.ts#L31) ## Type Parameters @@ -19,7 +19,7 @@ Defined in: [vue-query/src/useMutation.ts:31](https://github.com/TanStack/query/ ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TVariables diff --git a/docs/framework/vue/reference/type-aliases/UseMutationReturnType.md b/docs/framework/vue/reference/type-aliases/UseMutationReturnType.md index 1c19828e046..a16b79b33d6 100644 --- a/docs/framework/vue/reference/type-aliases/UseMutationReturnType.md +++ b/docs/framework/vue/reference/type-aliases/UseMutationReturnType.md @@ -7,7 +7,7 @@ title: UseMutationReturnType type UseMutationReturnType = ToRefs> & object; ``` -Defined in: [vue-query/src/useMutation.ts:53](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutation.ts#L53) +Defined in: [packages/vue-query/src/useMutation.ts:53](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutation.ts#L53) ## Type Declaration diff --git a/docs/framework/vue/reference/type-aliases/UsePrefetchInfiniteQueryOptions.md b/docs/framework/vue/reference/type-aliases/UsePrefetchInfiniteQueryOptions.md index 6453240fbd1..1a0493ab1c9 100644 --- a/docs/framework/vue/reference/type-aliases/UsePrefetchInfiniteQueryOptions.md +++ b/docs/framework/vue/reference/type-aliases/UsePrefetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: UsePrefetchInfiniteQueryOptions type UsePrefetchInfiniteQueryOptions = DistributiveOmit, "queryFn"> & object; ``` -Defined in: [vue-query/src/usePrefetchInfiniteQuery.ts:16](https://github.com/TanStack/query/blob/main/packages/vue-query/src/usePrefetchInfiniteQuery.ts#L16) +Defined in: [packages/vue-query/src/usePrefetchInfiniteQuery.ts:16](https://github.com/TanStack/query/blob/main/packages/vue-query/src/usePrefetchInfiniteQuery.ts#L16) ## Type Declaration @@ -33,7 +33,7 @@ optional queryFn: Exclude = OmitKeyof, "queryFn"> & object; ``` -Defined in: [vue-query/src/usePrefetchQuery.ts:15](https://github.com/TanStack/query/blob/main/packages/vue-query/src/usePrefetchQuery.ts#L15) +Defined in: [packages/vue-query/src/usePrefetchQuery.ts:15](https://github.com/TanStack/query/blob/main/packages/vue-query/src/usePrefetchQuery.ts#L15) ## Type Declaration @@ -37,4 +37,4 @@ optional queryFn: Exclude = TDepth["length"] extends MAXIMUM_DEPTH ? UseQueryOptionsForUseQueries[] : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryOptionsForUseQueries] : T extends [infer Head, ...(infer Tails)] ? UseQueriesOptions<[...Tails], [...TResults, GetUseQueryOptionsForUseQueries], [...TDepth, 1]> : ReadonlyArray extends T ? T : T extends UseQueryOptionsForUseQueries[] ? UseQueryOptionsForUseQueries[] : UseQueryOptionsForUseQueries[]; ``` -Defined in: [vue-query/src/useQueries.ts:170](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQueries.ts#L170) +Defined in: [packages/vue-query/src/useQueries.ts:170](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQueries.ts#L170) UseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param diff --git a/docs/framework/vue/reference/type-aliases/UseQueriesResults.md b/docs/framework/vue/reference/type-aliases/UseQueriesResults.md index 69659a1c8af..2cfa764c2c5 100644 --- a/docs/framework/vue/reference/type-aliases/UseQueriesResults.md +++ b/docs/framework/vue/reference/type-aliases/UseQueriesResults.md @@ -7,7 +7,7 @@ title: UseQueriesResults type UseQueriesResults = TDepth["length"] extends MAXIMUM_DEPTH ? QueryObserverResult[] : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryResult] : T extends [infer Head, ...(infer Tails)] ? UseQueriesResults<[...Tails], [...TResults, GetUseQueryResult], [...TDepth, 1]> : { [K in keyof T]: GetUseQueryResult }; ``` -Defined in: [vue-query/src/useQueries.ts:212](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQueries.ts#L212) +Defined in: [packages/vue-query/src/useQueries.ts:212](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQueries.ts#L212) UseQueriesResults reducer recursively maps type param to results diff --git a/docs/framework/vue/reference/type-aliases/UseQueryDefinedReturnType.md b/docs/framework/vue/reference/type-aliases/UseQueryDefinedReturnType.md index b55e4985742..47238aef1b2 100644 --- a/docs/framework/vue/reference/type-aliases/UseQueryDefinedReturnType.md +++ b/docs/framework/vue/reference/type-aliases/UseQueryDefinedReturnType.md @@ -7,7 +7,7 @@ title: UseQueryDefinedReturnType type UseQueryDefinedReturnType = UseBaseQueryReturnType>; ``` -Defined in: [vue-query/src/useQuery.ts:95](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L95) +Defined in: [packages/vue-query/src/useQuery.ts:95](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L95) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/UseQueryOptions.md b/docs/framework/vue/reference/type-aliases/UseQueryOptions.md index 6a240ccbf6c..0aadddad555 100644 --- a/docs/framework/vue/reference/type-aliases/UseQueryOptions.md +++ b/docs/framework/vue/reference/type-aliases/UseQueryOptions.md @@ -7,7 +7,7 @@ title: UseQueryOptions type UseQueryOptions = MaybeRef<{ [Property in keyof QueryObserverOptions]: Property extends "enabled" ? MaybeRefOrGetter | (() => QueryBooleanOption>) : Property extends "queryKey" ? MaybeRef[Property]> : MaybeRefDeep>[Property]> } & ShallowOption>; ``` -Defined in: [vue-query/src/useQuery.ts:22](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L22) +Defined in: [packages/vue-query/src/useQuery.ts:22](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L22) ## Type Parameters @@ -17,7 +17,7 @@ Defined in: [vue-query/src/useQuery.ts:22](https://github.com/TanStack/query/blo ### TError -`TError` = `DefaultError` +`TError` = [`DefaultError`](DefaultError.md) ### TData @@ -29,4 +29,4 @@ Defined in: [vue-query/src/useQuery.ts:22](https://github.com/TanStack/query/blo ### TQueryKey -`TQueryKey` *extends* `QueryKey` = `QueryKey` +`TQueryKey` *extends* [`QueryKey`](QueryKey.md) = [`QueryKey`](QueryKey.md) diff --git a/docs/framework/vue/reference/type-aliases/UseQueryReturnType.md b/docs/framework/vue/reference/type-aliases/UseQueryReturnType.md index a9272507e8c..ab1849e9b9a 100644 --- a/docs/framework/vue/reference/type-aliases/UseQueryReturnType.md +++ b/docs/framework/vue/reference/type-aliases/UseQueryReturnType.md @@ -7,7 +7,7 @@ title: UseQueryReturnType type UseQueryReturnType = UseBaseQueryReturnType; ``` -Defined in: [vue-query/src/useQuery.ts:90](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L90) +Defined in: [packages/vue-query/src/useQuery.ts:90](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L90) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/VueQueryPluginOptions.md b/docs/framework/vue/reference/type-aliases/VueQueryPluginOptions.md index 5e8508f30b4..2bbbb106849 100644 --- a/docs/framework/vue/reference/type-aliases/VueQueryPluginOptions.md +++ b/docs/framework/vue/reference/type-aliases/VueQueryPluginOptions.md @@ -7,4 +7,4 @@ title: VueQueryPluginOptions type VueQueryPluginOptions = ConfigOptions | ClientOptions; ``` -Defined in: [vue-query/src/vueQueryPlugin.ts:38](https://github.com/TanStack/query/blob/main/packages/vue-query/src/vueQueryPlugin.ts#L38) +Defined in: [packages/vue-query/src/vueQueryPlugin.ts:38](https://github.com/TanStack/query/blob/main/packages/vue-query/src/vueQueryPlugin.ts#L38) diff --git a/docs/framework/vue/reference/type-aliases/WithRequired.md b/docs/framework/vue/reference/type-aliases/WithRequired.md new file mode 100644 index 00000000000..c8ef831db3c --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/WithRequired.md @@ -0,0 +1,20 @@ +--- +id: WithRequired +title: WithRequired +--- + +```ts +type WithRequired = TTarget & { [_ in TKey]: {} }; +``` + +Defined in: [packages/query-core/src/types.ts:505](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L505) + +## Type Parameters + +### TTarget + +`TTarget` + +### TKey + +`TKey` *extends* keyof `TTarget` diff --git a/docs/framework/vue/reference/type-aliases/dataTagErrorSymbol.md b/docs/framework/vue/reference/type-aliases/dataTagErrorSymbol.md new file mode 100644 index 00000000000..26148a94d6e --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/dataTagErrorSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagErrorSymbol +title: dataTagErrorSymbol +--- + +```ts +type dataTagErrorSymbol = typeof dataTagErrorSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:63](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L63) diff --git a/docs/framework/vue/reference/type-aliases/dataTagSymbol.md b/docs/framework/vue/reference/type-aliases/dataTagSymbol.md new file mode 100644 index 00000000000..0012c108cc5 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/dataTagSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagSymbol +title: dataTagSymbol +--- + +```ts +type dataTagSymbol = typeof dataTagSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L61) diff --git a/docs/framework/vue/reference/variables/VueQueryPlugin.md b/docs/framework/vue/reference/variables/VueQueryPlugin.md index 735e850b403..e9e86acf38e 100644 --- a/docs/framework/vue/reference/variables/VueQueryPlugin.md +++ b/docs/framework/vue/reference/variables/VueQueryPlugin.md @@ -7,7 +7,7 @@ title: VueQueryPlugin const VueQueryPlugin: object; ``` -Defined in: [vue-query/src/vueQueryPlugin.ts:74](https://github.com/TanStack/query/blob/main/packages/vue-query/src/vueQueryPlugin.ts#L74) +Defined in: [packages/vue-query/src/vueQueryPlugin.ts:74](https://github.com/TanStack/query/blob/main/packages/vue-query/src/vueQueryPlugin.ts#L74) Installs a `QueryClient` on the Vue app, making it available to every descendant component through `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin diff --git a/docs/framework/vue/reference/variables/dataTagErrorSymbol.md b/docs/framework/vue/reference/variables/dataTagErrorSymbol.md new file mode 100644 index 00000000000..20bab62fb01 --- /dev/null +++ b/docs/framework/vue/reference/variables/dataTagErrorSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagErrorSymbol +title: dataTagErrorSymbol +--- + +```ts +const dataTagErrorSymbol: typeof dataTagErrorSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:63](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L63) diff --git a/docs/framework/vue/reference/variables/dataTagSymbol.md b/docs/framework/vue/reference/variables/dataTagSymbol.md new file mode 100644 index 00000000000..83dd68a56e9 --- /dev/null +++ b/docs/framework/vue/reference/variables/dataTagSymbol.md @@ -0,0 +1,10 @@ +--- +id: dataTagSymbol +title: dataTagSymbol +--- + +```ts +const dataTagSymbol: typeof dataTagSymbol; +``` + +Defined in: [packages/query-core/src/types.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L61) diff --git a/docs/framework/vue/reference/variables/defaultScheduler.md b/docs/framework/vue/reference/variables/defaultScheduler.md new file mode 100644 index 00000000000..70e14d3f846 --- /dev/null +++ b/docs/framework/vue/reference/variables/defaultScheduler.md @@ -0,0 +1,13 @@ +--- +id: defaultScheduler +title: defaultScheduler +--- + +```ts +const defaultScheduler: ScheduleFunction = systemSetTimeoutZero; +``` + +Defined in: [packages/query-core/src/notifyManager.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L19) + +Default scheduling function used by the notify manager. +Schedules the callback with the system's `setTimeout(callback, 0)`. diff --git a/docs/framework/vue/reference/variables/environmentManager.md b/docs/framework/vue/reference/variables/environmentManager.md new file mode 100644 index 00000000000..caa1d70b2b6 --- /dev/null +++ b/docs/framework/vue/reference/variables/environmentManager.md @@ -0,0 +1,44 @@ +--- +id: environmentManager +title: environmentManager +--- + +```ts +const environmentManager: object; +``` + +Defined in: [packages/query-core/src/environmentManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L15) + +Manages environment detection used by TanStack Query internals. + +## Type Declaration + +### isServer() + +```ts +isServer: () => boolean; +``` + +Returns whether the current runtime should be treated as a server environment. + +#### Returns + +`boolean` + +### setIsServer() + +```ts +setIsServer(isServerValue): void; +``` + +Overrides the server check globally. + +#### Parameters + +##### isServerValue + +`IsServerValue` + +#### Returns + +`void` diff --git a/docs/framework/vue/reference/variables/focusManager.md b/docs/framework/vue/reference/variables/focusManager.md new file mode 100644 index 00000000000..cbf7fcb4a17 --- /dev/null +++ b/docs/framework/vue/reference/variables/focusManager.md @@ -0,0 +1,12 @@ +--- +id: focusManager +title: focusManager +--- + +```ts +const focusManager: FocusManager; +``` + +Defined in: [packages/query-core/src/focusManager.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L142) + +Singleton instance of FocusManager, used to manage and observe the focus state within TanStack Query. diff --git a/docs/framework/vue/reference/variables/isServer.md b/docs/framework/vue/reference/variables/isServer.md new file mode 100644 index 00000000000..28956d55cbf --- /dev/null +++ b/docs/framework/vue/reference/variables/isServer.md @@ -0,0 +1,14 @@ +--- +id: isServer +title: isServer +--- + +```ts +const isServer: boolean; +``` + +Defined in: [packages/query-core/src/utils.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L112) + +## Deprecated + +use `environmentManager.isServer()` instead. diff --git a/docs/framework/vue/reference/variables/notifyManager.md b/docs/framework/vue/reference/variables/notifyManager.md new file mode 100644 index 00000000000..e5ecca8df60 --- /dev/null +++ b/docs/framework/vue/reference/variables/notifyManager.md @@ -0,0 +1,156 @@ +--- +id: notifyManager +title: notifyManager +--- + +```ts +const notifyManager: object; +``` + +Defined in: [packages/query-core/src/notifyManager.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L135) + +Handles scheduling and batching callbacks in TanStack Query. + +## Type Declaration + +### batch() + +```ts +readonly batch: (callback) => T; +``` + +Batches all updates scheduled inside the passed callback. +This is mainly used internally to optimize query client updating. +Batches can be nested; the queue is only flushed once the outermost `batch` call finishes. +The return value of `callback` is passed through. + +#### Type Parameters + +##### T + +`T` + +#### Parameters + +##### callback + +() => `T` + +#### Returns + +`T` + +### batchCalls() + +```ts +readonly batchCalls: (callback) => BatchCallsCallback; +``` + +All calls to the wrapped function will be batched. + +#### Type Parameters + +##### T + +`T` *extends* `unknown`[] + +#### Parameters + +##### callback + +`BatchCallsCallback`\<`T`\> + +#### Returns + +`BatchCallsCallback`\<`T`\> + +### schedule() + +```ts +schedule: (callback) => void; +``` + +Schedules a function to be run on the next batch. +By default, the batch is run with a `setTimeout`, but this can be configured via `setScheduler`. + +#### Parameters + +##### callback + +`NotifyCallback` + +#### Returns + +`void` + +### setBatchNotifyFunction() + +```ts +readonly setBatchNotifyFunction: (fn) => void; +``` + +Use this method to set a custom function to batch notifications together into a single tick. +By default React Query will use the batch function provided by ReactDOM or React Native. + +#### Parameters + +##### fn + +`BatchNotifyFunction` + +#### Returns + +`void` + +### setNotifyFunction() + +```ts +readonly setNotifyFunction: (fn) => void; +``` + +Use this method to set a custom notify function. +This can be used to for example wrap notifications with `React.act` while running tests. + +#### Parameters + +##### fn + +`NotifyFunction` + +#### Returns + +`void` + +### setScheduler() + +```ts +readonly setScheduler: (fn) => void; +``` + +Configures a custom callback that schedules when the next batch runs. +The default behavior is `setTimeout(callback, 0)`. + +#### Parameters + +##### fn + +`ScheduleFunction` + +#### Returns + +`void` + +#### Example + +```ts +import { notifyManager } from '@tanstack/query-core' + +// Schedule batches in the next microtask +notifyManager.setScheduler(queueMicrotask) + +// Schedule batches before the next frame is rendered +notifyManager.setScheduler(requestAnimationFrame) + +// Schedule batches some time in the future +notifyManager.setScheduler((cb) => setTimeout(cb, 10)) +``` diff --git a/docs/framework/vue/reference/variables/onlineManager.md b/docs/framework/vue/reference/variables/onlineManager.md new file mode 100644 index 00000000000..4ae083f245b --- /dev/null +++ b/docs/framework/vue/reference/variables/onlineManager.md @@ -0,0 +1,12 @@ +--- +id: onlineManager +title: onlineManager +--- + +```ts +const onlineManager: OnlineManager; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L117) + +Singleton instance of OnlineManager, used to manage and observe the online state within TanStack Query. diff --git a/docs/framework/vue/reference/variables/skipToken.md b/docs/framework/vue/reference/variables/skipToken.md new file mode 100644 index 00000000000..3163e91c1c2 --- /dev/null +++ b/docs/framework/vue/reference/variables/skipToken.md @@ -0,0 +1,23 @@ +--- +id: skipToken +title: skipToken +--- + +```ts +const skipToken: typeof skipToken; +``` + +Defined in: [packages/query-core/src/utils.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L520) + +Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent +to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`, +a query disabled via `skipToken` cannot be triggered with `refetch`. + +## Example + +```ts +new QueryObserver(queryClient, { + queryKey: ['post', postId], + queryFn: postId != null ? () => fetchPost(postId) : skipToken, +}) +``` diff --git a/docs/framework/vue/reference/variables/timeoutManager.md b/docs/framework/vue/reference/variables/timeoutManager.md new file mode 100644 index 00000000000..2dcfa29b55a --- /dev/null +++ b/docs/framework/vue/reference/variables/timeoutManager.md @@ -0,0 +1,12 @@ +--- +id: timeoutManager +title: timeoutManager +--- + +```ts +const timeoutManager: TimeoutManager; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:226](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L226) + +Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/vue/reference/variables/unsetMarker.md b/docs/framework/vue/reference/variables/unsetMarker.md new file mode 100644 index 00000000000..d19ee65b38e --- /dev/null +++ b/docs/framework/vue/reference/variables/unsetMarker.md @@ -0,0 +1,10 @@ +--- +id: unsetMarker +title: unsetMarker +--- + +```ts +const unsetMarker: typeof unsetMarker; +``` + +Defined in: [packages/query-core/src/types.ts:65](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L65) diff --git a/packages/angular-query-experimental/tsconfig.json b/packages/angular-query-experimental/tsconfig.json index bcf51c2ffe5..3699e26689d 100644 --- a/packages/angular-query-experimental/tsconfig.json +++ b/packages/angular-query-experimental/tsconfig.json @@ -22,5 +22,5 @@ "*.config.js", "package.json" ], - "references": [{ "path": "../query-core" }, { "path": "../query-devtools" }] + "references": [{ "path": "../query-devtools" }] } diff --git a/packages/lit-query/tsconfig.json b/packages/lit-query/tsconfig.json index e143f207f38..15d8fec4c82 100644 --- a/packages/lit-query/tsconfig.json +++ b/packages/lit-query/tsconfig.json @@ -5,6 +5,5 @@ "rootDir": ".", "lib": ["ES2022", "DOM"] }, - "include": ["src", "*.config.ts", "*.config.js", "package.json"], - "references": [{ "path": "../query-core" }] + "include": ["src", "*.config.ts", "*.config.js", "package.json"] } diff --git a/packages/query-core/src/focusManager.ts b/packages/query-core/src/focusManager.ts index 21be2612d3a..ff1c50b5989 100644 --- a/packages/query-core/src/focusManager.ts +++ b/packages/query-core/src/focusManager.ts @@ -6,6 +6,11 @@ type SetupFn = ( setFocused: (focused?: boolean) => void, ) => (() => void) | undefined +/** + * The `FocusManager` manages the focus state within TanStack Query. + * + * It can be used to change the default event listeners or to manually change the focus state. + */ export class FocusManager extends Subscribable { #focused?: boolean #cleanup?: () => void @@ -44,6 +49,31 @@ export class FocusManager extends Subscribable { } } + /** + * `setEventListener` can be used to set a custom event listener that will + * be used to determine the focus state. The provided `setup` function + * receives a `setFocused` callback: call it with a `boolean` to manually + * set the focus state, or with no arguments to re-evaluate the current + * focus state and notify subscribers. + * + * @example + * ```ts + * import { focusManager } from '@tanstack/query-core' + * + * focusManager.setEventListener((handleFocus) => { + * const listener = () => handleFocus() + * // Listen to visibilitychange + * if (typeof window !== 'undefined' && window.addEventListener) { + * window.addEventListener('visibilitychange', listener, false) + * } + * + * return () => { + * // Be sure to unsubscribe if a new handler is set + * window.removeEventListener('visibilitychange', listener) + * } + * }) + * ``` + */ setEventListener(setup: SetupFn): void { this.#setup = setup this.#cleanup?.() @@ -56,6 +86,24 @@ export class FocusManager extends Subscribable { }) } + /** + * `setFocused` can be used to manually set the focus state. Set `undefined` + * to fall back to the default focus check. + * + * @example + * ```ts + * import { focusManager } from '@tanstack/query-core' + * + * // Set focused + * focusManager.setFocused(true) + * + * // Set unfocused + * focusManager.setFocused(false) + * + * // Fallback to the default focus check + * focusManager.setFocused(undefined) + * ``` + */ setFocused(focused?: boolean): void { const changed = this.#focused !== focused if (changed) { @@ -64,6 +112,9 @@ export class FocusManager extends Subscribable { } } + /** + * `onFocus` notifies all subscribed listeners with the current focus state. + */ onFocus(): void { const isFocused = this.isFocused() this.listeners.forEach((listener) => { @@ -71,6 +122,9 @@ export class FocusManager extends Subscribable { }) } + /** + * `isFocused` can be used to get the current focus state. + */ isFocused(): boolean { if (typeof this.#focused === 'boolean') { return this.#focused @@ -82,4 +136,7 @@ export class FocusManager extends Subscribable { } } +/** + * Singleton instance of {@link FocusManager}, used to manage and observe the focus state within TanStack Query. + */ export const focusManager = new FocusManager() diff --git a/packages/query-core/src/hydration.ts b/packages/query-core/src/hydration.ts index 9a4ca3f8b01..78305d8d965 100644 --- a/packages/query-core/src/hydration.ts +++ b/packages/query-core/src/hydration.ts @@ -35,17 +35,36 @@ function tryResolveSync(promise: PromiseLike) { return undefined } +/** + * Options for `dehydrate`, controlling which queries/mutations are included in the resulting `DehydratedState` and + * how their data/errors are transformed before being serialized (e.g. for embedding in server-rendered markup). + */ export interface DehydrateOptions { + /** Transforms a query's `data` before it is dehydrated. Useful for non-JSON-serializable data. */ serializeData?: TransformerFn + /** Predicate to decide whether a given `Mutation` should be dehydrated. Defaults to `defaultShouldDehydrateMutation`. */ shouldDehydrateMutation?: (mutation: Mutation) => boolean + /** Predicate to decide whether a given `Query` should be dehydrated. Defaults to `defaultShouldDehydrateQuery`. */ shouldDehydrateQuery?: (query: Query) => boolean + /** + * Predicate to decide whether a query's error should be redacted before dehydration. Errors are redacted + * (replaced with a generic `Error('redacted')`) unless this function is provided and returns `false` for the + * given error, in which case the original error is kept. + */ shouldRedactErrors?: (error: unknown) => boolean } +/** + * Options for `hydrate`, controlling the default options applied to queries/mutations restored from a + * `DehydratedState`, and how to reverse any transformation applied by `DehydrateOptions.serializeData`. + */ export interface HydrateOptions { defaultOptions?: { + /** Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. */ deserializeData?: TransformerFn + /** Default options merged into every query restored from the dehydrated state. */ queries?: QueryOptions + /** Default options merged into every mutation restored from the dehydrated state. */ mutations?: MutationOptions } } @@ -70,6 +89,11 @@ interface DehydratedQuery { dehydratedAt?: number } +/** + * A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically + * transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data + * that has already been fetched, avoiding a redundant fetch on the client. + */ export interface DehydratedState { mutations: Array queries: Array @@ -114,10 +138,16 @@ function dehydratePromise( return promise } -// Most config is not dehydrated but instead meant to configure again when -// consuming the de/rehydrated data, typically with useQuery on the client. -// Sometimes it might make sense to prefetch data on the server and include -// in the html-payload, but not consume it on the initial render. +/** + * Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g. + * `queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the + * de/rehydrated data, typically with `useQuery` on the client. If the query is still `pending`, its in-flight + * promise is dehydrated too so it can be resumed on the other side instead of re-fetched. + * @param query - The query to dehydrate. + * @param serializeData - Optional transform applied to `query.state.data` before it is included in the snapshot. + * @param shouldRedactErrors - Optional predicate; if it returns `false` for the promise's rejection error, that + * error is kept as-is instead of being redacted. + */ export function dehydrateQuery( query: Query, serializeData?: TransformerFn, @@ -143,14 +173,40 @@ export function dehydrateQuery( } } +/** + * The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are + * currently paused (e.g. paused by `networkMode` while offline). + */ export function defaultShouldDehydrateMutation(mutation: Mutation) { return mutation.state.isPaused } +/** + * The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is + * `'success'`. + */ export function defaultShouldDehydrateQuery(query: Query) { return query.state.status === 'success' } +/** + * Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`, + * typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`. + * Which queries/mutations are included, and how their data/errors are transformed, is controlled by `options`, + * falling back to the client's `dehydrate` default options, and finally to `defaultShouldDehydrateQuery` / + * `defaultShouldDehydrateMutation`. + * @example + * ```ts + * const queryClient = new QueryClient() + * + * await queryClient.prefetchQuery({ + * queryKey: ['posts'], + * queryFn: getPosts, + * }) + * + * const dehydratedState = dehydrate(queryClient) + * ``` + */ export function dehydrate( client: QueryClient, options: DehydrateOptions = {}, @@ -191,6 +247,23 @@ export function dehydrate( return { mutations, queries } } +/** + * Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the + * client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`. + * Queries not yet in the cache are built from the dehydrated snapshot; queries that already exist are only updated + * when the dehydrated data is newer than what's already cached. Newly built queries have their `fetchStatus` reset + * to `'idle'` so they don't hydrate stuck in a fetching state. If a dehydrated query still had an in-flight + * promise, it is resumed via `query.fetch()` (reusing that promise as `initialPromise`) rather than re-invoking + * `queryFn`. + * @example + * ```ts + * // dehydratedState was produced by `dehydrate` on the server + * // and sent to the client, e.g. embedded in server-rendered markup. + * const queryClient = new QueryClient() + * + * hydrate(queryClient, dehydratedState) + * ``` + */ export function hydrate( client: QueryClient, dehydratedState: Partial, diff --git a/packages/query-core/src/infiniteQueryObserver.ts b/packages/query-core/src/infiniteQueryObserver.ts index 1cdd32a8859..ed854b60ba0 100644 --- a/packages/query-core/src/infiniteQueryObserver.ts +++ b/packages/query-core/src/infiniteQueryObserver.ts @@ -19,6 +19,25 @@ type InfiniteQueryObserverListener = ( result: InfiniteQueryObserverResult, ) => void +/** + * An `InfiniteQueryObserver` extends `QueryObserver` to observe and switch + * between infinite queries. It augments the base `QueryObserverResult` with + * infinite-query-specific fields and methods, such as `hasNextPage` and + * `fetchNextPage`, and is the primitive that framework adapters (e.g. + * `useInfiniteQuery`) build their hooks on top of. + * + * @example + * ```ts + * const observer = new InfiniteQueryObserver(queryClient, { + * queryKey: ['projects'], + * queryFn: ({ pageParam }) => fetchProjects(pageParam), + * initialPageParam: 0, + * getNextPageParam: (lastPage) => lastPage.nextCursor, + * }) + * + * const unsubscribe = observer.subscribe((result) => console.log(result)) + * ``` + */ export class InfiniteQueryObserver< TQueryFnData = unknown, TError = DefaultError, @@ -80,6 +99,12 @@ export class InfiniteQueryObserver< this.fetchPreviousPage = this.fetchPreviousPage.bind(this) } + /** + * Updates the observer's options. Behaves the same as + * `QueryObserver.setOptions`, additionally marking the options as + * belonging to an infinite query before delegating to the base + * implementation. + */ setOptions( options: InfiniteQueryObserverOptions< TQueryFnData, @@ -93,6 +118,12 @@ export class InfiniteQueryObserver< super.setOptions(options) } + /** + * The infinite-query counterpart of {@link QueryObserver#getOptimisticResult}, marking the + * options as an infinite query before delegating to it. Called by framework adapters (e.g. + * `useInfiniteQuery`) ahead of subscribing, to compute the current `InfiniteQueryObserverResult` + * synchronously. + */ getOptimisticResult( options: DefaultedInfiniteQueryObserverOptions< TQueryFnData, @@ -109,6 +140,24 @@ export class InfiniteQueryObserver< > } + /** + * Fetches the next page of the infinite query and returns a promise that + * resolves with the resulting `InfiniteQueryObserverResult`. The page + * param used for the fetch is determined by `getNextPageParam`, which + * receives the current pages/page params and whose result also determines + * `hasNextPage`. + * + * @example + * ```ts + * const { hasNextPage } = observer.getCurrentResult() + * + * if (hasNextPage) { + * await observer.fetchNextPage() + * } + * ``` + * + * @see {@link InfiniteQueryObserver#fetchPreviousPage} + */ fetchNextPage( options?: FetchNextPageOptions, ): Promise> { @@ -120,6 +169,24 @@ export class InfiniteQueryObserver< }) } + /** + * Fetches the previous page of the infinite query and returns a promise + * that resolves with the resulting `InfiniteQueryObserverResult`. The page + * param used for the fetch is determined by `getPreviousPageParam`, which + * receives the current pages/page params and whose result also determines + * `hasPreviousPage`. + * + * @example + * ```ts + * const { hasPreviousPage } = observer.getCurrentResult() + * + * if (hasPreviousPage) { + * await observer.fetchPreviousPage() + * } + * ``` + * + * @see {@link InfiniteQueryObserver#fetchNextPage} + */ fetchPreviousPage( options?: FetchPreviousPageOptions, ): Promise> { diff --git a/packages/query-core/src/mutation.ts b/packages/query-core/src/mutation.ts index 6682ce3cce4..fd74ba97efa 100644 --- a/packages/query-core/src/mutation.ts +++ b/packages/query-core/src/mutation.ts @@ -23,20 +23,54 @@ interface MutationConfig { state?: MutationState } +/** + * The raw state stored on a `Mutation` instance. This is the underlying state + * that observer results (e.g. `MutationObserverResult`) are derived from. + */ export interface MutationState< TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown, > { + /** + * The value returned by `onMutate`, if defined. Passed to `onSuccess`, + * `onError` and `onSettled` as the mutation's context. + */ context: TOnMutateResult | undefined + /** + * The last successfully resolved data for the mutation. + */ data: TData | undefined + /** + * The error object for the mutation, if the last attempt resulted in an error. + * - Defaults to `null`. + */ error: TError | null + /** + * The number of times the mutation function has failed for the current attempt. + */ failureCount: number + /** + * The reason the current attempt failed, as reported by the retryer. + */ failureReason: TError | null + /** + * Whether the mutation is currently paused (see network mode), or is + * waiting for another mutation with the same `scope` to finish. + */ isPaused: boolean + /** + * The status of the mutation. + */ status: MutationStatus + /** + * The variables the mutation was last called with. + */ variables: TVariables | undefined + /** + * The timestamp for when the mutation was submitted. + */ submittedAt: number } @@ -81,6 +115,23 @@ export type Action = // CLASS +/** + * Represents a single mutation attempt. A `Mutation` holds the mutation's + * options, state (data/error/status), and the `MutationObserver`s currently + * subscribed to it. + * + * Instances are created and managed internally by `MutationCache`; application + * code typically interacts with mutations indirectly through `QueryClient` or + * a framework hook like `useMutation`. Direct access to a `Mutation` instance + * is possible via `mutationCache.find()`/`getAll()` for inspecting cache state. + * + * @example + * ```ts + * const mutationCache = queryClient.getMutationCache() + * + * const mutation = mutationCache.find({ mutationKey: ['addPost'] }) + * ``` + */ export class Mutation< TData = unknown, TError = DefaultError, @@ -113,6 +164,7 @@ export class Mutation< this.scheduleGc() } + /** @internal */ setOptions( options: MutationOptions, ): void { @@ -121,10 +173,14 @@ export class Mutation< this.updateGcTime(this.options.gcTime) } + /** + * The `meta` object passed in the mutation's options, if any. + */ get meta(): MutationMeta | undefined { return this.options.meta } + /** @internal */ addObserver(observer: MutationObserver): void { if (!this.#observers.includes(observer)) { this.#observers.push(observer) @@ -140,6 +196,7 @@ export class Mutation< } } + /** @internal */ removeObserver(observer: MutationObserver): void { this.#observers = this.#observers.filter((x) => x !== observer) @@ -162,6 +219,27 @@ export class Mutation< } } + /** + * Resumes a mutation that is currently paused or was restored from a + * dehydrated, still-`pending` state. + * + * - If this mutation has an active retryer (it paused mid-attempt, e.g. due + * to the network mode or scope-based queuing), its retryer is resumed. + * - Otherwise, if the mutation's status is still `pending` (e.g. it was + * dehydrated while an attempt was in flight and never got a retryer in + * this instance), `execute` is called again with the last known variables. + * - Otherwise the mutation has already settled and this resolves immediately + * without running anything again. + * + * @example + * ```ts + * // typically driven by reconnect handling, e.g. queryClient.resumePausedMutations() + * const mutation = mutationCache.find({ mutationKey: ['addPost'] }) + * await mutation?.continue() + * ``` + * + * @see {@link Mutation#execute} + */ continue(): Promise { return ( this.#retryer?.continue() ?? @@ -173,6 +251,36 @@ export class Mutation< ) } + /** + * Runs the mutation function for the given variables through a retryer, and + * drives the mutation's state and lifecycle callbacks through to settlement. + * + * If this mutation's state is already `pending` when `execute` is called + * (i.e. it was restored, still in-flight, from a dehydrated state), the + * `onMutate` step is skipped and a `continue` action is dispatched to + * unpause it; otherwise a `pending` action is dispatched first, then the + * mutation cache's `onMutate` and the mutation's own `onMutate` option are + * awaited in that order, and the resulting context is stored. + * + * The mutation function is then run (subject to `retry`/`retryDelay`/ + * `networkMode`, and to the mutation cache's scope-based serialization). + * On success, the cache's `onSuccess`/`onSettled` callbacks run before the + * mutation's own `onSuccess`/`onSettled` options, a `success` action is + * dispatched, and the resolved data is returned. On failure, the same + * cache-then-option ordering is used for `onError`/`onSettled`, but each of + * those four callbacks is individually caught so that a throwing callback + * cannot mask the original error; an `error` action is then dispatched and + * the original error is re-thrown. + * + * @example + * ```ts + * // Called internally by `MutationObserver.mutate` and `Mutation.continue` — + * // applications normally trigger mutations through those, not this method. + * const data = await mutation.execute(variables) + * ``` + * + * @see {@link Mutation#continue} + */ async execute(variables: TVariables): Promise { const onContinue = () => { this.#dispatch({ type: 'continue' }) diff --git a/packages/query-core/src/mutationCache.ts b/packages/query-core/src/mutationCache.ts index 109e9a94b44..761fd579cf8 100644 --- a/packages/query-core/src/mutationCache.ts +++ b/packages/query-core/src/mutationCache.ts @@ -15,7 +15,16 @@ import type { MutationFilters } from './utils' // TYPES +/** + * Global callbacks that fire for every mutation handled by a `MutationCache`, regardless of which + * component or observer triggered it. They differ from the `defaultOptions` provided to a + * `QueryClient` in two ways: `defaultOptions` can be overridden by each mutation, while these + * callbacks are always called, and `onMutate` here does not allow returning a result. + * + * If a callback returns a promise, it will be awaited before the mutation continues. + */ export interface MutationCacheConfig { + /** Called when any mutation in the cache encounters an error. */ onError?: ( error: DefaultError, variables: unknown, @@ -23,6 +32,7 @@ export interface MutationCacheConfig { mutation: Mutation, context: MutationFunctionContext, ) => Promise | unknown + /** Called when any mutation in the cache is successful. */ onSuccess?: ( data: unknown, variables: unknown, @@ -30,11 +40,13 @@ export interface MutationCacheConfig { mutation: Mutation, context: MutationFunctionContext, ) => Promise | unknown + /** Called before any mutation in the cache executes. */ onMutate?: ( variables: unknown, mutation: Mutation, context: MutationFunctionContext, ) => Promise | unknown + /** Called when any mutation in the cache is settled, either successfully or with an error. */ onSettled?: ( data: unknown | undefined, error: DefaultError | null, @@ -78,6 +90,11 @@ interface NotifyEventMutationUpdated extends NotifyEvent { action: Action } +/** + * The event passed to a `MutationCache` subscriber. Fired whenever a mutation is added or removed + * from the cache, its state is updated, or one of its observers is added, removed, or has its + * options updated. + */ export type MutationCacheNotifyEvent = | NotifyEventMutationAdded | NotifyEventMutationRemoved @@ -90,6 +107,13 @@ type MutationCacheListener = (event: MutationCacheNotifyEvent) => void // CLASS +/** + * The `MutationCache` is the storage for mutations. + * + * Normally, you will not interact with the `MutationCache` directly and instead use a + * `QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of + * safe/known updates to the cache, such as mutations being added, removed, or updated. + */ export class MutationCache extends Subscribable { #mutations: Set> #scopes: Map>> @@ -102,6 +126,7 @@ export class MutationCache extends Subscribable { this.#mutationId = 0 } + /** @internal */ build( client: QueryClient, options: MutationOptions, @@ -120,6 +145,7 @@ export class MutationCache extends Subscribable { return mutation } + /** @internal */ add(mutation: Mutation): void { this.#mutations.add(mutation) const scope = scopeFor(mutation) @@ -134,6 +160,7 @@ export class MutationCache extends Subscribable { this.notify({ type: 'added', mutation }) } + /** @internal */ remove(mutation: Mutation): void { if (this.#mutations.delete(mutation)) { const scope = scopeFor(mutation) @@ -157,6 +184,7 @@ export class MutationCache extends Subscribable { this.notify({ type: 'removed', mutation }) } + /** @internal */ canRun(mutation: Mutation): boolean { const scope = scopeFor(mutation) if (typeof scope === 'string') { @@ -174,6 +202,7 @@ export class MutationCache extends Subscribable { } } + /** @internal */ runNext(mutation: Mutation): Promise { const scope = scopeFor(mutation) if (typeof scope === 'string') { @@ -187,6 +216,16 @@ export class MutationCache extends Subscribable { } } + /** + * Removes all mutations from the cache. + * + * @example + * ```ts + * const mutationCache = queryClient.getMutationCache() + * + * mutationCache.clear() + * ``` + */ clear(): void { notifyManager.batch(() => { this.#mutations.forEach((mutation) => { @@ -197,10 +236,38 @@ export class MutationCache extends Subscribable { }) } + /** + * Returns all mutations within the cache. + * + * This is not typically needed for most applications, but can come in handy when needing more + * information about a mutation in rare scenarios. + * + * @example + * ```ts + * const mutationCache = queryClient.getMutationCache() + * + * const mutations = mutationCache.getAll() + * ``` + */ getAll(): Array { return Array.from(this.#mutations) } + /** + * A slightly more advanced method that can be used to get an existing mutation instance from + * the cache. If the mutation does not exist, `undefined` is returned. + * + * This is not typically needed for most applications, but can come in handy when needing more + * information about a mutation in rare scenarios. + * + * @see {@link MutationCache#findAll} + * @example + * ```ts + * const mutationCache = queryClient.getMutationCache() + * + * const mutation = mutationCache.find({ mutationKey: ['addPost'] }) + * ``` + */ find< TData = unknown, TError = DefaultError, @@ -216,10 +283,26 @@ export class MutationCache extends Subscribable { ) as Mutation | undefined } + /** + * An even more advanced method that can be used to get existing mutation instances from the + * cache that match the given filters. If no mutations match, an empty array is returned. + * + * This is not typically needed for most applications, but can come in handy when needing more + * information about mutations in rare scenarios. + * + * @see {@link MutationCache#find} + * @example + * ```ts + * const mutationCache = queryClient.getMutationCache() + * + * const mutations = mutationCache.findAll({ mutationKey: ['addPost'] }) + * ``` + */ findAll(filters: MutationFilters = {}): Array { return this.getAll().filter((mutation) => matchMutation(filters, mutation)) } + /** @internal */ notify(event: MutationCacheNotifyEvent) { notifyManager.batch(() => { this.listeners.forEach((listener) => { @@ -228,6 +311,7 @@ export class MutationCache extends Subscribable { }) } + /** @internal */ resumePausedMutations(): Promise { const pausedMutations = this.getAll().filter((x) => x.state.isPaused) diff --git a/packages/query-core/src/mutationObserver.ts b/packages/query-core/src/mutationObserver.ts index 8164e2ad024..b91157abd0a 100644 --- a/packages/query-core/src/mutationObserver.ts +++ b/packages/query-core/src/mutationObserver.ts @@ -20,6 +20,21 @@ type MutationObserverListener = ( // CLASS +/** + * Observes a single mutation and derives a `MutationObserverResult` from it. + * A framework hook like `useMutation` creates one `MutationObserver` per hook + * call, keeps it stable across re-renders, calls `setOptions` when the options + * passed to the hook change, subscribes to it to re-render on updates, and + * reads `getCurrentResult()` for the value to return. Calling `mutate()` + * builds a new underlying `Mutation` in the `MutationCache` and executes it. + * + * @example + * ```ts + * const observer = new MutationObserver(queryClient, { + * mutationFn: (variables: { title: string }) => addPost(variables), + * }) + * ``` + */ export class MutationObserver< TData = unknown, TError = DefaultError, @@ -62,6 +77,22 @@ export class MutationObserver< this.reset = this.reset.bind(this) } + /** + * Updates the observer's options. + * + * If the new `mutationKey` differs from the previous one (and both were + * defined), the observer is reset, detaching it from the mutation it was + * observing. Otherwise, if the currently observed mutation is still + * `pending`, its options are updated in place as well. + * + * @example + * ```ts + * observer.setOptions({ + * mutationFn: (variables: { title: string }) => addPost(variables), + * onSuccess: (data) => console.log(data), + * }) + * ``` + */ setOptions( options: MutationObserverOptions< TData, @@ -107,6 +138,7 @@ export class MutationObserver< } } + /** @internal */ onMutationUpdate( action: Action, ): void { @@ -115,6 +147,11 @@ export class MutationObserver< this.#notify(action) } + /** + * Returns the observer's current result, derived from the observed + * mutation's state (or the default, `idle` state if no mutation has been + * built yet, e.g. before the first `mutate()` call or after `reset()`). + */ getCurrentResult(): MutationObserverResult< TData, TError, @@ -124,6 +161,22 @@ export class MutationObserver< return this.#currentResult } + /** + * Detaches the observer from the mutation it is currently observing (if + * any) and resets the observed result back to its default, `idle` state. + * + * This does not cancel an in-flight mutation; the mutation itself keeps + * running to completion and its own callbacks still fire, but this + * observer stops reflecting its state and a subsequent `mutate()` call + * will build a brand new mutation. + * + * @example + * ```ts + * observer.reset() + * ``` + * + * @see {@link MutationObserver#mutate} + */ reset(): void { // reset needs to remove the observer from the mutation because there is no way to "get it back" // another mutate call will yield a new mutation! @@ -133,6 +186,24 @@ export class MutationObserver< this.#notify() } + /** + * Builds a new `Mutation` in the `MutationCache` using the observer's + * current options, detaches this observer from any previously observed + * mutation, attaches it to the new one, and executes it with the given + * variables. + * + * The optional per-call `options` (`onSuccess`/`onError`/`onSettled`) are + * invoked once the mutation settles, in addition to any callbacks defined + * on the observer's own options. + * + * @example + * ```ts + * await observer.mutate( + * { title: 'New post' }, + * { onSuccess: (data) => console.log(data) }, + * ) + * ``` + */ mutate( variables: TVariables, options?: MutateOptions, diff --git a/packages/query-core/src/notifyManager.ts b/packages/query-core/src/notifyManager.ts index f4deb73194b..f9db1160847 100644 --- a/packages/query-core/src/notifyManager.ts +++ b/packages/query-core/src/notifyManager.ts @@ -12,6 +12,10 @@ type BatchCallsCallback> = (...args: T) => void type ScheduleFunction = (callback: () => void) => void +/** + * Default scheduling function used by the notify manager. + * Schedules the callback with the system's `setTimeout(callback, 0)`. + */ export const defaultScheduler: ScheduleFunction = systemSetTimeoutZero export function createNotifyManager() { @@ -49,6 +53,12 @@ export function createNotifyManager() { } return { + /** + * Batches all updates scheduled inside the passed callback. + * This is mainly used internally to optimize query client updating. + * Batches can be nested; the queue is only flushed once the outermost `batch` call finishes. + * The return value of `callback` is passed through. + */ batch: (callback: () => T): T => { let result transactions++ @@ -74,6 +84,10 @@ export function createNotifyManager() { }) } }, + /** + * Schedules a function to be run on the next batch. + * By default, the batch is run with a `setTimeout`, but this can be configured via `setScheduler`. + */ schedule, /** * Use this method to set a custom notify function. @@ -89,6 +103,24 @@ export function createNotifyManager() { setBatchNotifyFunction: (fn: BatchNotifyFunction) => { batchNotifyFn = fn }, + /** + * Configures a custom callback that schedules when the next batch runs. + * The default behavior is `setTimeout(callback, 0)`. + * + * @example + * ```ts + * import { notifyManager } from '@tanstack/query-core' + * + * // Schedule batches in the next microtask + * notifyManager.setScheduler(queueMicrotask) + * + * // Schedule batches before the next frame is rendered + * notifyManager.setScheduler(requestAnimationFrame) + * + * // Schedule batches some time in the future + * notifyManager.setScheduler((cb) => setTimeout(cb, 10)) + * ``` + */ setScheduler: (fn: ScheduleFunction) => { scheduleFn = fn }, @@ -96,4 +128,8 @@ export function createNotifyManager() { } // SINGLETON + +/** + * Handles scheduling and batching callbacks in TanStack Query. + */ export const notifyManager = createNotifyManager() diff --git a/packages/query-core/src/onlineManager.ts b/packages/query-core/src/onlineManager.ts index 6c59a14b908..7a0c9b665d7 100644 --- a/packages/query-core/src/onlineManager.ts +++ b/packages/query-core/src/onlineManager.ts @@ -3,6 +3,15 @@ import { Subscribable } from './subscribable' type Listener = (online: boolean) => void type SetupFn = (setOnline: Listener) => (() => void) | undefined +/** + * The `OnlineManager` manages the online state within TanStack Query. It can + * be used to change the default event listeners or to manually change the + * online state. + * + * By default, the `onlineManager` assumes an active network connection, and + * listens to the `online` and `offline` events on the `window` object to + * detect changes. + */ export class OnlineManager extends Subscribable { #online = true #cleanup?: () => void @@ -45,12 +54,44 @@ export class OnlineManager extends Subscribable { } } + /** + * `setEventListener` can be used to set a custom event listener that will + * be used to determine the online state. The provided `setup` function + * receives a `setOnline` callback that should be called with a `boolean` + * whenever the online state changes. + * + * @example + * ```ts + * import NetInfo from '@react-native-community/netinfo' + * import { onlineManager } from '@tanstack/query-core' + * + * onlineManager.setEventListener((setOnline) => { + * return NetInfo.addEventListener((state) => { + * setOnline(!!state.isConnected) + * }) + * }) + * ``` + */ setEventListener(setup: SetupFn): void { this.#setup = setup this.#cleanup?.() this.#cleanup = setup(this.setOnline.bind(this)) } + /** + * `setOnline` can be used to manually set the online state. + * + * @example + * ```ts + * import { onlineManager } from '@tanstack/query-core' + * + * // Set to online + * onlineManager.setOnline(true) + * + * // Set to offline + * onlineManager.setOnline(false) + * ``` + */ setOnline(online: boolean): void { const changed = this.#online !== online @@ -62,9 +103,15 @@ export class OnlineManager extends Subscribable { } } + /** + * `isOnline` can be used to get the current online state. + */ isOnline(): boolean { return this.#online } } +/** + * Singleton instance of {@link OnlineManager}, used to manage and observe the online state within TanStack Query. + */ export const onlineManager = new OnlineManager() diff --git a/packages/query-core/src/queriesObserver.ts b/packages/query-core/src/queriesObserver.ts index ce348c9ca52..12ea3e1673d 100644 --- a/packages/query-core/src/queriesObserver.ts +++ b/packages/query-core/src/queriesObserver.ts @@ -23,9 +23,34 @@ type CombineFn = ( export interface QueriesObserverOptions< TCombinedResult = Array, > { + /** + * A function that combines the array of `QueryObserverResult`s (one per + * observed query) into a single value. The combined value is memoized and + * only recomputed when one of the underlying results, the query hashes, or + * the `combine` function itself changes. + */ combine?: CombineFn } +/** + * A `QueriesObserver` watches an array of queries at once, exposing them as + * a single array of `QueryObserverResult`s (or, when a `combine` option is + * given, as a combined value derived from that array). It manages one + * internal `QueryObserver` per query, and is the primitive that framework + * adapters (e.g. `useQueries`) build their hooks on top of. + * + * @example + * ```ts + * const observer = new QueriesObserver(queryClient, [ + * { queryKey: ['post', 1], queryFn: fetchPost }, + * { queryKey: ['post', 2], queryFn: fetchPost }, + * ]) + * + * const unsubscribe = observer.subscribe((result) => { + * console.log(result) + * }) + * ``` + */ export class QueriesObserver< TCombinedResult = Array, > extends Subscribable { @@ -72,6 +97,10 @@ export class QueriesObserver< } } + /** + * Stops observing all queries: clears all listeners and destroys every + * underlying `QueryObserver` this observer manages. + */ destroy(): void { this.listeners = new Set() this.#observers.forEach((observer) => { @@ -79,6 +108,20 @@ export class QueriesObserver< }) } + /** + * Replaces the set of queries being observed. Existing `QueryObserver`s + * are reused for queries that match an already-observed query hash; + * observers for queries that are no longer present are destroyed, and new + * observers are created and subscribed to for newly added queries. + * + * @example + * ```ts + * observer.setQueries([ + * { queryKey: ['post', 1], queryFn: fetchPost }, + * { queryKey: ['post', 3], queryFn: fetchPost }, + * ]) + * ``` + */ setQueries( queries: Array, options?: QueriesObserverOptions, @@ -151,18 +194,45 @@ export class QueriesObserver< }) } + /** + * Returns the most recently computed array of `QueryObserverResult`s, one + * per observed query, in the same order as the queries passed to the + * constructor or `setQueries`. + * + * @example + * ```ts + * const results = observer.getCurrentResult() + * const data = results.map((result) => result.data) + * ``` + */ getCurrentResult(): Array { return this.#result } + /** + * Returns the underlying `Query` instances currently being observed, in + * the same order as the queries passed to the constructor or `setQueries`. + */ getQueries() { return this.#observers.map((observer) => observer.getCurrentQuery()) } + /** + * Returns the underlying `QueryObserver` instances this observer manages, + * in the same order as the queries passed to the constructor or + * `setQueries`. + */ getObservers() { return this.#observers } + /** + * The `QueriesObserver` counterpart of {@link QueryObserver#getOptimisticResult} — computes + * the result for the given (already-defaulted) queries right now, synchronously. Called by + * framework adapters (e.g. `useQueries`) ahead of subscribing, returning a tuple of the raw + * per-query results, a function to compute the combined result from them, and a function to + * wrap the results for property-access tracking. + */ getOptimisticResult( queries: Array, combine: CombineFn | undefined, diff --git a/packages/query-core/src/query.ts b/packages/query-core/src/query.ts index aa18e975af7..bc35f0fceb2 100644 --- a/packages/query-core/src/query.ts +++ b/packages/query-core/src/query.ts @@ -45,18 +45,70 @@ interface QueryConfig< state?: QueryState } +/** + * The raw state stored on a `Query` instance. This is the underlying state + * that observer results (e.g. `QueryObserverResult`) are derived from. + */ export interface QueryState { + /** + * The last successfully resolved data for the query. + */ data: TData | undefined + /** + * The number of times the query has successfully resolved. + */ dataUpdateCount: number + /** + * The timestamp for when the query most recently returned the `status` as `"success"`. + */ dataUpdatedAt: number + /** + * The error object for the query, if the last attempt resulted in an error. + * - Defaults to `null`. + */ error: TError | null + /** + * The sum of all errors, incremented every time the query resolves with an error. + */ errorUpdateCount: number + /** + * The timestamp for when the query most recently returned the `status` as `"error"`. + */ errorUpdatedAt: number + /** + * The failure count for the current fetch. + * - Incremented every time the fetch fails. + * - Reset to `0` when the fetch succeeds. + */ fetchFailureCount: number + /** + * The reason the current fetch failed, as reported by the retryer. + * - Reset to `null` when the fetch succeeds. + */ fetchFailureReason: TError | null + /** + * Metadata passed to the currently in-flight (or most recent) fetch, e.g. the + * `fetchMore` direction for infinite queries. + */ fetchMeta: FetchMeta | null + /** + * Whether the query has been marked as invalidated via `invalidate()`. + * - Reset to `false` whenever the query resolves successfully. + */ isInvalidated: boolean + /** + * The status of the query. + * - `pending` if there's no cached data and no attempt was finished yet. + * - `error` if the last attempt resulted in an error. + * - `success` if the query has data. + */ status: QueryStatus + /** + * The fetch status of the query. + * - `fetching`: the `queryFn` is currently executing. + * - `paused`: a fetch wanted to run but has been paused (see network mode). + * - `idle`: the query is not fetching. + */ fetchStatus: FetchStatus } @@ -151,6 +203,25 @@ export type Action = // CLASS +/** + * Represents a single cached query. A `Query` holds the query's key, options, + * state (data/error/status), and the observers currently subscribed to it. + * + * Instances are created and managed internally by `QueryCache`; application + * code typically interacts with queries indirectly through `QueryClient` or + * a framework hook like `useQuery`. Direct access to a `Query` instance is + * possible via `queryCache.find()`/`findAll()` for inspecting cache state. + * + * @example + * ```ts + * const queryCache = queryClient.getQueryCache() + * const query = queryCache.find({ queryKey: ['posts'] }) + * + * if (query) { + * console.log(query.state.dataUpdatedAt) + * } + * ``` + */ export class Query< TQueryFnData = unknown, TError = DefaultError, @@ -187,18 +258,27 @@ export class Query< this.state = config.state ?? this.#initialState this.scheduleGc() } + /** + * The `meta` object passed in the query's options, if any. + */ get meta(): QueryMeta | undefined { return this.options.meta } + /** @internal */ get queryType() { return this.#queryType } + /** + * The promise for the currently in-flight fetch, if the query is fetching. + * `undefined` when the query is not fetching. + */ get promise(): Promise | undefined { return this.#retryer?.promise } + /** @internal */ setOptions( options?: QueryOptions, ): void { @@ -228,6 +308,7 @@ export class Query< } } + /** @internal */ setData( newData: TData, options?: SetDataOptions & { manual: boolean }, @@ -245,37 +326,77 @@ export class Query< return data } + /** + * Merges the given partial state directly into this query's state, notifying observers. Used + * by persistence and broadcast plugins to restore a state snapshot, and by devtools to let a + * user manually trigger a loading/error state or edit the cached data. + */ setState(state: Partial>): void { this.#dispatch({ type: 'setState', state }) } + /** + * Cancels the query's currently in-flight fetch, if any. + * - Returns a promise that resolves once the cancellation has settled. + * - If no fetch is in progress, resolves immediately. + * + * @example + * ```ts + * await query.cancel() + * ``` + */ cancel(options?: CancelOptions): Promise { const promise = this.#retryer?.promise this.#retryer?.cancel(options) return promise ? promise.then(noop).catch(noop) : Promise.resolve() } + /** + * Clears the query's garbage collection timeout and silently cancels any + * in-flight fetch. Called by `QueryCache` when the query is removed from + * the cache. + * + * @see {@link Query#cancel} + */ destroy(): void { super.destroy() this.cancel({ silent: true }) } + /** @internal */ get resetState(): QueryState { return this.#initialState } + /** + * Resets the query back to its initial state (the state it had when it was + * first created, e.g. any `initialData`), destroying it first to cancel any + * in-flight fetch. + */ reset(): void { this.destroy() this.setState(this.resetState) } + /** + * Returns `true` if the query has at least one observer for which `enabled` + * does not resolve to `false`. + */ isActive(): boolean { return this.observers.some( (observer) => resolveQueryValue(observer.options.enabled, this) !== false, ) } + /** + * Returns `true` if the query is disabled, meaning it will not fetch + * automatically. + * - If the query has observers, it is disabled when none of them are active + * (see `isActive`). + * - If the query has no observers, it is disabled when its `queryFn` is + * `skipToken` or it has never been fetched. + */ isDisabled(): boolean { if (this.getObserversCount() > 0) { return !this.isActive() @@ -284,10 +405,18 @@ export class Query< return this.options.queryFn === skipToken || !this.isFetched() } + /** + * Returns `true` if the query has been fetched, i.e. it has resolved with + * either data or an error at least once. + */ isFetched() { return this.state.dataUpdateCount + this.state.errorUpdateCount > 0 } + /** + * Returns `true` if the query has at least one observer configured with + * `staleTime: 'static'`, meaning it is treated as never stale. + */ isStatic(): boolean { if (this.getObserversCount() > 0) { return this.observers.some( @@ -299,6 +428,22 @@ export class Query< return false } + /** + * Returns `true` if the query is stale. + * - If the query has observers, defers to whether any observer's current + * result reports `isStale` (which accounts for each observer's own + * `staleTime` and `enabled` state). + * - If the query has no observers, it is considered stale when it has no + * data or has been invalidated. + * + * @see {@link Query#isStaleByTime} + * @example + * ```ts + * if (query.isStale()) { + * // refetch or otherwise treat the cached data as outdated + * } + * ``` + */ isStale(): boolean { // check observers first, their `isStale` has the source of truth // calculated with `isStaleByTime` and it takes `enabled` into account @@ -311,6 +456,20 @@ export class Query< return this.state.data === undefined || this.state.isInvalidated } + /** + * Returns `true` if the query's data is stale relative to the given + * `staleTime` (defaults to `0`). + * - A query with no data is always stale. + * - `staleTime: 'static'` is never stale. + * - An invalidated query is always stale. + * - Otherwise, staleness is based on elapsed time since `dataUpdatedAt`. + * + * @see {@link Query#isStale} + * @example + * ```ts + * const isStale = query.isStaleByTime(1000 * 60) + * ``` + */ isStaleByTime(staleTime: StaleTime = 0): boolean { // no data is always stale if (this.state.data === undefined) { @@ -328,6 +487,7 @@ export class Query< return !timeUntilStale(this.state.dataUpdatedAt, staleTime) } + /** @internal */ onFocus(): void { const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()) @@ -337,6 +497,7 @@ export class Query< this.#retryer?.continue() } + /** @internal */ onOnline(): void { const observer = this.observers.find((x) => x.shouldFetchOnReconnect()) @@ -346,6 +507,7 @@ export class Query< this.#retryer?.continue() } + /** @internal */ addObserver(observer: QueryObserver): void { if (!this.observers.includes(observer)) { this.observers.push(observer) @@ -357,6 +519,7 @@ export class Query< } } + /** @internal */ removeObserver(observer: QueryObserver): void { const index = this.observers.indexOf(observer) if (index !== -1) { @@ -384,16 +547,46 @@ export class Query< } } + /** + * Returns the number of observers currently subscribed to this query. + * + * @example + * ```ts + * if (query.getObserversCount() === 0) { + * // no component is currently watching this query + * } + * ``` + */ getObserversCount(): number { return this.observers.length } + /** + * Marks the query as invalidated, unless it is already invalidated. This + * updates `state.isInvalidated` and notifies observers, but does not by + * itself trigger a refetch. + * + * @example + * ```ts + * query.invalidate() + * ``` + */ invalidate(): void { if (!this.state.isInvalidated) { this.#dispatch({ type: 'invalidate' }) } } + /** + * Fetches the query, i.e. runs its `queryFn` (through any configured + * retryer/behavior) and updates the query's state with the result. + * - If a fetch is already in flight, returns its promise instead of + * starting a new one, unless `fetchOptions.cancelRefetch` is set and the + * query already has data, in which case the current fetch is silently + * cancelled first. + * - If `options` is passed, it replaces the query's current options + * before fetching. + */ async fetch( options?: QueryOptions, fetchOptions?: FetchOptions, diff --git a/packages/query-core/src/queryCache.ts b/packages/query-core/src/queryCache.ts index 030f0920427..2c38c62957d 100644 --- a/packages/query-core/src/queryCache.ts +++ b/packages/query-core/src/queryCache.ts @@ -16,12 +16,20 @@ import type { QueryObserver } from './queryObserver' // TYPES +/** + * Global callbacks that fire for every query handled by a `QueryCache`, regardless of which + * component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can + * override, these callbacks are always called. + */ export interface QueryCacheConfig { + /** Called when any query in the cache encounters an error. */ onError?: ( error: DefaultError, query: Query, ) => void + /** Called when any query in the cache is successful. */ onSuccess?: (data: unknown, query: Query) => void + /** Called when any query in the cache is settled, either successfully or with an error. */ onSettled?: ( data: unknown | undefined, error: DefaultError | null, @@ -68,6 +76,11 @@ interface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent { observer: QueryObserver } +/** + * The event passed to a `QueryCache` subscriber. Fired whenever a query is added or removed from + * the cache, its state is updated (e.g. via `query.setState` or `queryClient.removeQueries`), or + * one of its observers is added, removed, or has its results or options updated. + */ export type QueryCacheNotifyEvent = | NotifyEventQueryAdded | NotifyEventQueryRemoved @@ -89,6 +102,14 @@ export interface QueryStore { // CLASS +/** + * The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta + * information, and state of the queries it contains. + * + * Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient` + * for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of + * safe/known updates to the cache, such as queries being added, removed, or updated. + */ export class QueryCache extends Subscribable { #queries: QueryStore @@ -97,6 +118,22 @@ export class QueryCache extends Subscribable { this.#queries = new Map() } + /** + * Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or + * builds and adds a new one to the cache if none exists yet. Used by framework adapters and + * plugins (e.g. broadcast/persistence) that need to get-or-create a `Query` directly, bypassing + * the reactive `QueryObserver` machinery. + * + * @example + * ```ts + * const queryCache = queryClient.getQueryCache() + * + * const query = queryCache.build(queryClient, { + * queryKey: ['posts'], + * queryFn: fetchPosts, + * }) + * ``` + */ build< TQueryFnData = unknown, TError = DefaultError, @@ -130,6 +167,7 @@ export class QueryCache extends Subscribable { return query } + /** @internal */ add(query: Query): void { if (!this.#queries.has(query.queryHash)) { this.#queries.set(query.queryHash, query) @@ -141,6 +179,22 @@ export class QueryCache extends Subscribable { } } + /** + * Destroys the given `Query` and removes it from the cache, notifying subscribers with a + * `'removed'` event. A no-op if the query is no longer the one currently stored under its hash + * (e.g. it was already replaced). Used by plugins (e.g. the broadcast client) that mirror + * removals across `QueryCache` instances. + * + * @example + * ```ts + * const queryCache = queryClient.getQueryCache() + * const query = queryCache.find({ queryKey: ['posts'] }) + * + * if (query) { + * queryCache.remove(query) + * } + * ``` + */ remove(query: Query): void { const queryInMap = this.#queries.get(query.queryHash) @@ -155,6 +209,16 @@ export class QueryCache extends Subscribable { } } + /** + * Removes all queries from the cache. + * + * @example + * ```ts + * const queryCache = queryClient.getQueryCache() + * + * queryCache.clear() + * ``` + */ clear(): void { notifyManager.batch(() => { this.getAll().forEach((query) => { @@ -163,6 +227,20 @@ export class QueryCache extends Subscribable { }) } + /** + * Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none + * exists. Unlike {@link QueryCache#find}, this looks up by the already-computed hash rather + * than by `QueryFilters`. Used by plugins (e.g. broadcast/hydration) that already have a hash + * to look up directly. + * + * @example + * ```ts + * const queryCache = queryClient.getQueryCache() + * const queryHash = hashKey(['posts']) + * + * const query = queryCache.get(queryHash) + * ``` + */ get< TQueryFnData = unknown, TError = DefaultError, @@ -176,10 +254,38 @@ export class QueryCache extends Subscribable { | undefined } + /** + * Returns all queries within the cache. + * + * @example + * ```ts + * const queryCache = queryClient.getQueryCache() + * + * const queries = queryCache.getAll() + * ``` + */ getAll(): Array { return [...this.#queries.values()] } + /** + * A slightly more advanced method that can be used to get an existing query instance from the + * cache. This instance not only contains all the state for the query, but all of the instances, + * and underlying guts of the query as well. If the query does not exist, `undefined` is + * returned. + * + * This is not typically needed for most applications, but can come in handy when needing more + * information about a query in rare scenarios (e.g. looking at `query.state.dataUpdatedAt` to + * decide whether a query is fresh enough to be used as an initial value). + * + * @see {@link QueryCache#findAll} + * @example + * ```ts + * const queryCache = queryClient.getQueryCache() + * + * const query = queryCache.find({ queryKey: ['posts'] }) + * ``` + */ find( filters: WithRequired, ): Query | undefined { @@ -190,6 +296,21 @@ export class QueryCache extends Subscribable { ) as Query | undefined } + /** + * An even more advanced method that can be used to get existing query instances from the cache + * that partially match a query key. If no queries match, an empty array is returned. + * + * This is not typically needed for most applications, but can come in handy when needing more + * information about queries in rare scenarios. + * + * @see {@link QueryCache#find} + * @example + * ```ts + * const queryCache = queryClient.getQueryCache() + * + * const queries = queryCache.findAll({ queryKey: ['posts'] }) + * ``` + */ findAll(filters: QueryFilters = {}): Array { const queries = this.getAll() return Object.keys(filters).length > 0 @@ -197,6 +318,7 @@ export class QueryCache extends Subscribable { : queries } + /** @internal */ notify(event: QueryCacheNotifyEvent): void { notifyManager.batch(() => { this.listeners.forEach((listener) => { @@ -205,6 +327,7 @@ export class QueryCache extends Subscribable { }) } + /** @internal */ onFocus(): void { notifyManager.batch(() => { this.getAll().forEach((query) => { @@ -213,6 +336,7 @@ export class QueryCache extends Subscribable { }) } + /** @internal */ onOnline(): void { notifyManager.batch(() => { this.getAll().forEach((query) => { diff --git a/packages/query-core/src/queryClient.ts b/packages/query-core/src/queryClient.ts index 03dbcadb55c..064918c77f3 100644 --- a/packages/query-core/src/queryClient.ts +++ b/packages/query-core/src/queryClient.ts @@ -58,6 +58,23 @@ interface MutationDefaults { // CLASS +/** + * `QueryClient` is used to interact with a cache of queries and mutations. It owns a + * `QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds + * the default options that are applied to queries and mutations created through it. + * + * ```ts + * const queryClient = new QueryClient({ + * defaultOptions: { + * queries: { + * staleTime: Infinity, + * }, + * }, + * }) + * + * await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts }) + * ``` + */ export class QueryClient { #queryCache: QueryCache #mutationCache: MutationCache @@ -77,6 +94,12 @@ export class QueryClient { this.#mountCount = 0 } + /** + * Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start + * listening for focus/online events and resume paused mutations. Ref-counted via an internal + * mount count, so nested or multiple providers sharing the same `QueryClient` don't tear down + * the shared listeners until the last one unmounts. + */ mount(): void { this.#mountCount++ if (this.#mountCount !== 1) return @@ -95,6 +118,11 @@ export class QueryClient { }) } + /** + * The inverse of {@link QueryClient#mount} — called by a framework adapter's + * `QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online + * listeners once the mount count returns to `0`. + */ unmount(): void { this.#mountCount-- if (this.#mountCount !== 0) return @@ -106,6 +134,18 @@ export class QueryClient { this.#unsubscribeOnline = undefined } + /** + * Returns the number of queries in the cache that are currently fetching, optionally + * matching a set of filters. This includes background-fetching, loading new pages, and + * loading more infinite query results. + * + * @example + * ```ts + * if (queryClient.isFetching()) { + * console.log('At least one query is fetching!') + * } + * ``` + */ isFetching = QueryFilters>( filters?: TQueryFilters, ): number { @@ -113,6 +153,17 @@ export class QueryClient { .length } + /** + * Returns the number of mutations in the cache that are currently pending, optionally + * matching a set of filters. + * + * @example + * ```ts + * if (queryClient.isMutating()) { + * console.log('At least one mutation is pending!') + * } + * ``` + */ isMutating< TMutationFilters extends MutationFilters = MutationFilters, >(filters?: TMutationFilters): number { @@ -125,6 +176,8 @@ export class QueryClient { * * Hint: Do not use this function inside a component, because it won't receive updates. * Use `useQuery` to create a `QueryObserver` that subscribes to changes. + * + * @see {@link QueryClient#getQueriesData} */ getQueryData< TQueryFnData = unknown, @@ -166,6 +219,17 @@ export class QueryClient { return Promise.resolve(cachedData) } + /** + * Imperative (non-reactive) way to retrieve the cached data of multiple queries at once. + * Only queries matching the given filters are returned; if none match, an empty array is + * returned. + * + * @see {@link QueryClient#getQueryData} + * @example + * ```ts + * const data = queryClient.getQueriesData({ queryKey: ['posts'] }) + * ``` + */ getQueriesData< TQueryFnData = unknown, TQueryFilters extends QueryFilters = QueryFilters, @@ -176,6 +240,27 @@ export class QueryClient { }) } + /** + * Synchronous way to immediately update a query's cached data. If the updater (or the value + * passed) resolves to `undefined`, the cache is left untouched and no query is created; + * otherwise, if the query does not exist yet, it will be created. To update multiple queries + * at once by partially matching query keys, use {@link QueryClient#setQueriesData} instead. + * + * Updates must be performed immutably: do not mutate `oldData`, or data previously retrieved + * via {@link QueryClient#getQueryData}, in place. + * + * @param queryKey - The query key to set data for. + * @param updater - Either the new data, or a function that receives the current data (which + * may be `undefined`) and returns the new data. + * + * @example + * ```ts + * queryClient.setQueryData(['posts'], newPosts) + * + * // Or, using an updater function that receives the current data: + * queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost]) + * ``` + */ setQueryData< TQueryFnData = unknown, TTaggedQueryKey extends QueryKey = QueryKey, @@ -211,6 +296,19 @@ export class QueryClient { .setData(data, { ...options, manual: true }) } + /** + * Synchronous way to immediately update the cached data of multiple queries at once, using + * filters or partial query key matching. Only queries that already exist and match the given + * filters are updated; no new cache entries are created. Internally this calls + * {@link QueryClient#setQueryData} for each matching query. + * + * @example + * ```ts + * queryClient.setQueriesData({ queryKey: ['posts'] }, (oldPosts) => + * oldPosts ? oldPosts.filter((post) => post.id !== deletedId) : oldPosts, + * ) + * ``` + */ setQueriesData< TQueryFnData, TQueryFilters extends QueryFilters = QueryFilters, @@ -232,6 +330,16 @@ export class QueryClient { ) } + /** + * Imperative (non-reactive) way to retrieve an existing query's state. If the query does not + * exist, `undefined` is returned. + * + * @example + * ```ts + * const state = queryClient.getQueryState(['posts']) + * console.log(state?.dataUpdatedAt) + * ``` + */ getQueryState< TQueryFnData = unknown, TError = DefaultError, @@ -247,6 +355,17 @@ export class QueryClient { )?.state } + /** + * Removes queries from the cache that match the given filters. Unlike + * {@link QueryClient#invalidateQueries} or {@link QueryClient#refetchQueries}, this removes + * matching queries from the cache instead of refetching them. Without filters, every query in + * the cache is removed. + * + * @example + * ```ts + * queryClient.removeQueries({ queryKey: ['posts'], exact: true }) + * ``` + */ removeQueries( filters?: QueryFilters, ): void { @@ -258,6 +377,16 @@ export class QueryClient { }) } + /** + * Resets queries matching the given filters back to their initial state (e.g. any + * `initialData`), notifying subscribers rather than removing them. Active queries among the + * matched set are then refetched, and the returned promise resolves once that refetch settles. + * + * @example + * ```ts + * await queryClient.resetQueries({ queryKey: ['posts'], exact: true }) + * ``` + */ resetQueries( filters?: QueryFilters, options?: ResetOptions, @@ -280,6 +409,19 @@ export class QueryClient { }) } + /** + * Cancels outgoing fetches for queries matching the given filters. Most useful when performing + * optimistic updates, since any outgoing refetch that resolves afterwards would otherwise + * overwrite the optimistic update. By default (`revert: true`), a cancelled query's data is + * reverted to its state before the outgoing fetch started. + * + * The returned promise never rejects, even if individual cancellations fail. + * + * @example + * ```ts + * await queryClient.cancelQueries({ queryKey: ['posts'], exact: true }) + * ``` + */ cancelQueries( filters?: QueryFilters, cancelOptions: CancelOptions = {}, @@ -295,6 +437,19 @@ export class QueryClient { return Promise.all(promises).then(noop).catch(noop) } + /** + * Marks queries matching the given filters as invalidated. Unlike + * {@link QueryClient#removeQueries}, invalidated queries stay in the cache. + * + * Unless `filters.refetchType` is `'none'`, matching queries are then refetched via + * {@link QueryClient#refetchQueries}, using `filters.refetchType` if set, otherwise + * `filters.type`, otherwise `'active'`. + * + * @example + * ```ts + * await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' }) + * ``` + */ invalidateQueries( filters?: InvalidateQueryFilters, options: InvalidateOptions = {}, @@ -317,6 +472,21 @@ export class QueryClient { }) } + /** + * Refetches queries matching the given filters, regardless of whether they are stale. Without + * filters, every query in the cache is refetched. Queries that are disabled, or static (only + * have observers with a static `staleTime`), are never refetched. + * + * By default (`cancelRefetch: true`), a currently running fetch is cancelled before the new + * one starts. The returned promise resolves once all matching queries have settled; it does + * not reject on individual query failures unless `throwOnError` is set. + * + * @example + * ```ts + * // refetch all active queries partially matching a query key: + * await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' }) + * ``` + */ refetchQueries( filters?: RefetchQueryFilters, options: RefetchOptions = {}, @@ -343,6 +513,34 @@ export class QueryClient { return Promise.all(promises).then(noop) } + /** + * Asynchronous method to fetch and cache a query, resolving with the data or throwing with + * the error. + * + * If the query already exists in the cache and its data is not stale (per the given + * `staleTime`), the cached data is returned without fetching. Otherwise, the query is fetched + * and the promise resolves once the fetch settles. If a `select` function is provided, it is + * applied to the data in both cases (cached or freshly fetched) before it is returned. + * + * Unlike `useQuery`, retries are disabled by default here (`retry: false`) unless explicitly + * configured, since there is no component to catch a thrown error and retry through re-render. + * + * The accepted options are a subset of `useQuery`'s options: fields that only make sense for a + * reactive observer (e.g. `enabled`, `refetchInterval`, `refetchOnWindowFocus`, `notifyOnChangeProps`, + * `throwOnError`, `suspense`, `placeholderData`) are not part of this method's options. + * + * This method replaces the deprecated `fetchQuery`, and — combined with + * `{ staleTime: 'static' }` — the deprecated `ensureQueryData`. + * + * @example + * ```ts + * try { + * const data = await queryClient.query({ queryKey, queryFn, staleTime: 10000 }) + * } catch (error) { + * console.log(error) + * } + * ``` + */ async query< TQueryFnData, TError = DefaultError, @@ -434,6 +632,27 @@ export class QueryClient { return this.fetchQuery(options).then(noop).catch(noop) } + /** + * Asynchronous method to fetch and cache an infinite query, resolving with an + * {@link InfiniteData} object or throwing with the error. + * + * Behaves like {@link QueryClient#query}, accepting the same options (minus + * `initialPageParam`), plus the required `initialPageParam`, and an optional `pages` / + * `getNextPageParam` pair used to refetch a fixed number of pages from the start. + * + * This method replaces the deprecated `fetchInfiniteQuery`, and — combined with + * `{ staleTime: 'static' }` — the deprecated `ensureInfiniteQueryData`. + * + * @example + * ```ts + * try { + * const data = await queryClient.infiniteQuery({ queryKey, queryFn, initialPageParam: 0 }) + * console.log(data.pages) + * } catch (error) { + * console.log(error) + * } + * ``` + */ infiniteQuery< TQueryFnData, TError = DefaultError, @@ -523,6 +742,18 @@ export class QueryClient { return this.ensureQueryData(options as any) } + /** + * Resumes mutations that were paused because there was no network connection. Does nothing + * (resolving immediately) if the client is currently offline. + * + * @example + * ```ts + * import { QueryClient } from '@tanstack/query-core' + * + * const queryClient = new QueryClient() + * await queryClient.resumePausedMutations() + * ``` + */ resumePausedMutations(): Promise { if (onlineManager.isOnline()) { return this.#mutationCache.resumePausedMutations() @@ -530,22 +761,90 @@ export class QueryClient { return Promise.resolve() } + /** + * Returns the query cache this client is connected to. + * + * @example + * ```ts + * import { QueryClient } from '@tanstack/query-core' + * + * const queryClient = new QueryClient() + * const queryCache = queryClient.getQueryCache() + * const queries = queryCache.findAll({ queryKey: ['posts'] }) + * ``` + */ getQueryCache(): QueryCache { return this.#queryCache } + /** + * Returns the mutation cache this client is connected to. + * + * @example + * ```ts + * import { QueryClient } from '@tanstack/query-core' + * + * const queryClient = new QueryClient() + * const mutationCache = queryClient.getMutationCache() + * const mutations = mutationCache.findAll({ status: 'pending' }) + * ``` + */ getMutationCache(): MutationCache { return this.#mutationCache } + /** + * Returns the default options that were set when creating the client, or via + * {@link QueryClient#setDefaultOptions}. + * + * @example + * ```ts + * import { QueryClient } from '@tanstack/query-core' + * + * const queryClient = new QueryClient() + * const defaultOptions = queryClient.getDefaultOptions() + * ``` + */ getDefaultOptions(): DefaultOptions { return this.#defaultOptions } + /** + * Dynamically sets the default options for this client, overwriting any previously defined + * default options. + * + * @see {@link QueryClient#getDefaultOptions} + * @example + * ```ts + * import { QueryClient } from '@tanstack/query-core' + * + * const queryClient = new QueryClient() + * queryClient.setDefaultOptions({ + * queries: { + * staleTime: Infinity, + * }, + * }) + * ``` + */ setDefaultOptions(options: DefaultOptions): void { this.#defaultOptions = options } + /** + * Sets default options for queries whose query key partially matches the given `queryKey`. + * + * If several registered query defaults match a given query key, they are merged together in + * registration order by {@link QueryClient#getQueryDefaults}, so register defaults from the + * most generic key to the least generic one — more specific defaults should be registered + * after more generic ones so they take precedence. + * + * @example + * ```ts + * queryClient.setQueryDefaults(['posts'], { queryFn: fetchPosts }) + * + * await queryClient.query({ queryKey: ['posts'] }) + * ``` + */ setQueryDefaults< TQueryFnData = unknown, TError = DefaultError, @@ -566,6 +865,16 @@ export class QueryClient { }) } + /** + * Returns the default options registered for queries whose query key partially matches the + * given `queryKey`, via {@link QueryClient#setQueryDefaults}. If multiple registered defaults + * match, they are merged together in registration order. + * + * @example + * ```ts + * const defaultOptions = queryClient.getQueryDefaults(['posts']) + * ``` + */ getQueryDefaults( queryKey: QueryKey, ): OmitKeyof, 'queryKey'> { @@ -584,6 +893,17 @@ export class QueryClient { return result } + /** + * Sets default options for mutations whose mutation key partially matches the given + * `mutationKey`. As with {@link QueryClient#setQueryDefaults}, the order of registration + * matters when several registered defaults match the same mutation key. + * + * @see {@link QueryClient#getMutationDefaults} + * @example + * ```ts + * queryClient.setMutationDefaults(['addPost'], { mutationFn: addPost }) + * ``` + */ setMutationDefaults< TData = unknown, TError = DefaultError, @@ -602,6 +922,16 @@ export class QueryClient { }) } + /** + * Returns the default options registered for mutations whose mutation key partially matches + * the given `mutationKey`, via {@link QueryClient#setMutationDefaults}. If multiple registered + * defaults match, they are merged together in registration order. + * + * @example + * ```ts + * const defaultOptions = queryClient.getMutationDefaults(['addPost']) + * ``` + */ getMutationDefaults( mutationKey: MutationKey, ): OmitKeyof, 'mutationKey'> { @@ -621,6 +951,12 @@ export class QueryClient { return result } + /** + * Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the + * caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the + * given `queryKey`, then the client's own `defaultOptions.queries`, then the caller's options + * on top. A no-op if the options are already defaulted (`_defaulted: true`). + */ defaultQueryOptions< TQueryFnData = unknown, TError = DefaultError, @@ -702,6 +1038,12 @@ export class QueryClient { > } + /** + * The mutation counterpart of {@link QueryClient#defaultQueryOptions}. Called by framework + * adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the + * given `mutationKey`, then the client's `defaultOptions.mutations`, then the caller's options + * on top. A no-op if the options are already defaulted (`_defaulted: true`). + */ defaultMutationOptions>( options?: T, ): T { @@ -717,6 +1059,17 @@ export class QueryClient { } as T } + /** + * Clears both the query cache and the mutation cache this client is connected to. + * + * @example + * ```ts + * import { QueryClient } from '@tanstack/query-core' + * + * const queryClient = new QueryClient() + * queryClient.clear() + * ``` + */ clear(): void { this.#queryCache.clear() this.#mutationCache.clear() diff --git a/packages/query-core/src/queryObserver.ts b/packages/query-core/src/queryObserver.ts index c86b6fa29bf..beb3a2370bc 100644 --- a/packages/query-core/src/queryObserver.ts +++ b/packages/query-core/src/queryObserver.ts @@ -34,6 +34,26 @@ interface ObserverFetchOptions extends FetchOptions { throwOnError?: boolean } +/** + * A `QueryObserver` watches a single query in the `QueryCache` and computes a + * `QueryObserverResult` from its state, recomputing and notifying subscribers + * whenever the underlying query (or the observer's options) changes. It is + * the primitive that framework adapters (e.g. `useQuery`) build their hooks + * on top of, but it can also be used directly to observe and switch between + * queries outside of any framework. + * + * @example + * ```ts + * const observer = new QueryObserver(queryClient, { + * queryKey: ['posts'], + * queryFn: fetchPosts, + * }) + * + * const unsubscribe = observer.subscribe((result) => { + * console.log(result.data) + * }) + * ``` + */ export class QueryObserver< TQueryFnData = unknown, TError = DefaultError, @@ -107,6 +127,11 @@ export class QueryObserver< } } + /** + * Returns whether the observed query is currently stale and configured + * (via the `refetchOnReconnect` option) to refetch when the network + * reconnects. + */ shouldFetchOnReconnect(): boolean { return shouldFetchOn( this.#currentQuery, @@ -115,6 +140,11 @@ export class QueryObserver< ) } + /** + * Returns whether the observed query is currently stale and configured + * (via the `refetchOnWindowFocus` option) to refetch when the window + * regains focus. + */ shouldFetchOnWindowFocus(): boolean { return shouldFetchOn( this.#currentQuery, @@ -123,6 +153,11 @@ export class QueryObserver< ) } + /** + * Stops observing the current query: clears all listeners, cancels the + * stale and refetch-interval timers, and removes this observer from the + * query it was observing. + */ destroy(): void { this.listeners = new Set() this.#clearStaleTimeout() @@ -130,6 +165,20 @@ export class QueryObserver< this.#currentQuery.removeObserver(this) } + /** + * Updates the observer's options. This will re-resolve the query being + * observed (switching to a different query if the `queryKey` changed), + * trigger a fetch if the new options require one and the observer has + * subscribers, recompute the current result, and reschedule the stale and + * refetch-interval timers as needed. + * + * @example + * ```ts + * observer.setOptions({ queryKey: ['posts', 1], queryFn: () => fetchPost(1) }) + * // later: switch to a different query, reusing the same observer + * observer.setOptions({ queryKey: ['posts', 2], queryFn: () => fetchPost(2) }) + * ``` + */ setOptions( options: QueryObserverOptions< TQueryFnData, @@ -214,6 +263,12 @@ export class QueryObserver< } } + /** + * Computes the result the observer would produce for the given (already-defaulted) options + * right now, building the underlying `Query` if it doesn't exist yet, without waiting for a + * subscription callback. Called by framework adapters on every render (e.g. `useQuery`) so the + * returned value is available synchronously, ahead of `setOptions` triggering an actual fetch. + */ getOptimisticResult( options: DefaultedQueryObserverOptions< TQueryFnData, @@ -251,10 +306,28 @@ export class QueryObserver< return result } + /** + * Returns the most recently computed `QueryObserverResult` for the + * observed query. This is a point-in-time read; to be notified of updates + * as they happen, subscribe to the observer instead (its inherited + * `subscribe` method). + * + * @example + * ```ts + * const result = observer.getCurrentResult() + * console.log(result.status, result.data) + * ``` + */ getCurrentResult(): QueryObserverResult { return this.#currentResult } + /** + * Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via + * {@link QueryObserver#trackProp} (and an optional `onPropTracked` callback). Used by framework + * adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on + * properties you actually read" behavior. + */ trackResult( result: QueryObserverResult, onPropTracked?: (key: keyof QueryObserverResult) => void, @@ -268,14 +341,33 @@ export class QueryObserver< }) } + /** + * Records that the given `QueryObserverResult` property was read, so a subsequent update only + * notifies this observer if a tracked property actually changed. Normally called indirectly via + * {@link QueryObserver#trackResult}'s proxy; exposed directly for adapters that track property + * access themselves (e.g. through their own reactivity system) instead of via the proxy. + */ trackProp(key: keyof QueryObserverResult) { this.#trackedProps.add(key) } + /** + * Returns the `Query` instance this observer is currently observing. + */ getCurrentQuery(): Query { return this.#currentQuery } + /** + * Refetches the observed query and returns a promise that resolves with + * the resulting `QueryObserverResult`. + * + * @example + * ```ts + * const result = await observer.refetch({ cancelRefetch: false }) + * console.log(result.data) + * ``` + */ refetch({ ...options }: RefetchOptions = {}): Promise< QueryObserverResult > { @@ -284,6 +376,22 @@ export class QueryObserver< }) } + /** + * Fetches a query defined by the given options without affecting this + * observer's own tracked query or result, and returns a promise that + * resolves with the `QueryObserverResult` for that fetch. This is useful + * for prefetching data that another observer (e.g. a query about to be + * navigated to) will need, ahead of time. + * + * @example + * ```ts + * const result = await observer.fetchOptimistic({ + * queryKey: ['posts', 2], + * queryFn: () => fetchPost(2), + * }) + * console.log(result.data) + * ``` + */ fetchOptimistic( options: QueryObserverOptions< TQueryFnData, @@ -619,6 +727,11 @@ export class QueryObserver< return nextResult } + /** + * Recomputes and stores the current result from the current query/options, notifying listeners + * if it changed. Framework adapters call this right after subscribing to make sure no query + * update was missed in the gap between creating the observer and subscribing to it. + */ updateResult(): void { const prevResult = this.#currentResult as | QueryObserverResult @@ -711,6 +824,7 @@ export class QueryObserver< } } + /** @internal */ onQueryUpdate(): void { this.updateResult() diff --git a/packages/query-core/src/retryer.ts b/packages/query-core/src/retryer.ts index 73fa0746d4b..c951833e5db 100644 --- a/packages/query-core/src/retryer.ts +++ b/packages/query-core/src/retryer.ts @@ -56,6 +56,24 @@ export function canFetch(networkMode: NetworkMode | undefined): boolean { : true } +/** + * The error thrown by a `Retryer` (and surfaced to `query.promise`/`mutation`) when a fetch is cancelled, e.g. via + * `query.cancel()`. `revert`, if `true`, tells the caller to restore the state the query was in before the fetch + * started instead of surfacing the error. `silent`, if `true`, tells the caller to suppress this error and instead + * resolve with the promise of the fetch that triggered the cancellation. + * @example + * ```ts + * query.cancel() + * + * try { + * await query.promise + * } catch (error) { + * if (error instanceof CancelledError) { + * // the fetch was cancelled, e.g. via `query.cancel()` + * } + * } + * ``` + */ export class CancelledError extends Error { revert?: boolean silent?: boolean diff --git a/packages/query-core/src/streamedQuery.ts b/packages/query-core/src/streamedQuery.ts index 534ee47c092..9b1ff3ac042 100644 --- a/packages/query-core/src/streamedQuery.ts +++ b/packages/query-core/src/streamedQuery.ts @@ -47,6 +47,15 @@ type StreamedQueryParams = * @param reducer - A function to reduce the streamed chunks into the final data. * Defaults to a function that appends chunks to the end of the array. * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values. + * @example + * ```ts + * await queryClient.query({ + * queryKey: ['data'], + * queryFn: streamedQuery({ + * streamFn: fetchDataInChunks, + * }), + * }) + * ``` */ export function streamedQuery< TQueryFnData = unknown, diff --git a/packages/query-core/src/timeoutManager.ts b/packages/query-core/src/timeoutManager.ts index 6f74050b04c..c4d424d600b 100644 --- a/packages/query-core/src/timeoutManager.ts +++ b/packages/query-core/src/timeoutManager.ts @@ -72,6 +72,31 @@ export class TimeoutManager implements Omit { #provider: TimeoutProvider = defaultTimeoutProvider #providerCalled = false + /** + * `setTimeoutProvider` can be used to set a custom implementation of the + * `setTimeout`, `clearTimeout`, `setInterval`, `clearInterval` functions, + * called a `TimeoutProvider`. + * + * This may be useful if you notice event loop performance issues with + * thousands of queries. A custom TimeoutProvider could also support timer + * delays longer than the global `setTimeout` maximum delay value of about + * 24 days. + * + * It is important to call `setTimeoutProvider` before creating a + * QueryClient or queries, so that the same provider is used consistently + * for all timers in the application, since different TimeoutProviders + * cannot cancel each others' timers. + * + * @example + * ```ts + * import { timeoutManager, QueryClient } from '@tanstack/query-core' + * import { CustomTimeoutProvider } from './CustomTimeoutProvider' + * + * timeoutManager.setTimeoutProvider(new CustomTimeoutProvider()) + * + * export const queryClient = new QueryClient() + * ``` + */ setTimeoutProvider( provider: TimeoutProvider, ): void { @@ -101,6 +126,26 @@ export class TimeoutManager implements Omit { } } + /** + * `setTimeout` schedules a callback to run after approximately `delay` + * milliseconds, like the global `setTimeout` function. The callback can be + * canceled with `clearTimeout`. + * + * It returns a timer ID, which may be a number or an object that can be + * coerced to a number via `Symbol.toPrimitive`. + * + * @example + * ```ts + * import { timeoutManager } from '@tanstack/query-core' + * + * const timeoutId = timeoutManager.setTimeout( + * () => console.log('ran at:', new Date()), + * 1000, + * ) + * + * const timeoutIdNumber: number = Number(timeoutId) + * ``` + */ setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId { if (process.env.NODE_ENV !== 'production') { this.#providerCalled = true @@ -108,10 +153,44 @@ export class TimeoutManager implements Omit { return this.#provider.setTimeout(callback, delay) } + /** + * `clearTimeout` cancels a timeout callback scheduled with `setTimeout`, + * like the global `clearTimeout` function. It should be called with a + * timer ID returned by `setTimeout`. + * + * @example + * ```ts + * import { timeoutManager } from '@tanstack/query-core' + * + * const timeoutId = timeoutManager.setTimeout( + * () => console.log('ran at:', new Date()), + * 1000, + * ) + * + * timeoutManager.clearTimeout(timeoutId) + * ``` + */ clearTimeout(timeoutId: ManagedTimerId | undefined): void { this.#provider.clearTimeout(timeoutId) } + /** + * `setInterval` schedules a callback to be called approximately every + * `delay` milliseconds, like the global `setInterval` function. + * + * Like `setTimeout`, it returns a timer ID, which may be a number or an + * object that can be coerced to a number via `Symbol.toPrimitive`. + * + * @example + * ```ts + * import { timeoutManager } from '@tanstack/query-core' + * + * const intervalId = timeoutManager.setInterval( + * () => console.log('ran at:', new Date()), + * 1000, + * ) + * ``` + */ setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId { if (process.env.NODE_ENV !== 'production') { this.#providerCalled = true @@ -119,11 +198,31 @@ export class TimeoutManager implements Omit { return this.#provider.setInterval(callback, delay) } + /** + * `clearInterval` can be used to cancel an interval, like the global + * `clearInterval` function. It should be called with an interval ID + * returned by `setInterval`. + * + * @example + * ```ts + * import { timeoutManager } from '@tanstack/query-core' + * + * const intervalId = timeoutManager.setInterval( + * () => console.log('ran at:', new Date()), + * 1000, + * ) + * + * timeoutManager.clearInterval(intervalId) + * ``` + */ clearInterval(intervalId: ManagedTimerId | undefined): void { this.#provider.clearInterval(intervalId) } } +/** + * Singleton instance of {@link TimeoutManager}, used throughout TanStack Query to schedule and cancel timers. + */ export const timeoutManager = new TimeoutManager() /** diff --git a/packages/query-core/src/types.ts b/packages/query-core/src/types.ts index ad29a77f506..073d89dd775 100644 --- a/packages/query-core/src/types.ts +++ b/packages/query-core/src/types.ts @@ -240,24 +240,80 @@ export interface QueryOptions< * If `true`, failed queries will retry infinitely. * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + * Defaults to `3` on the client and `0` on the server. */ retry?: RetryValue + /** + * This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the + * next attempt in milliseconds. + * + * A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential + * backoff. + * + * A function like `attempt => attempt * 1000` applies linear backoff. + */ retryDelay?: RetryDelayValue + /** + * Defaults to `'online'`. + * @see [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + */ networkMode?: NetworkMode /** * The time in milliseconds that unused/inactive cache data remains in memory. * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. * When different garbage collection times are specified, the longest one will be used. * Setting it to `Infinity` will disable garbage collection. + * Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + * + * Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see + * `timeoutManager.setTimeoutProvider` for a workaround. */ gcTime?: number + /** + * The function that the query will use to request data. + * Required, unless a default query function has been set via `queryClient.setQueryDefaults` or + * `queryClient.setDefaultOptions`. + * Receives a {@link QueryFunctionContext}. + * Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. + */ queryFn?: QueryFunction | SkipToken + /** + * This option can be used to persist the result of a query to an external storage, bypassing the need to actually + * call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. + */ persister?: QueryPersister, TPageParam> + /** + * The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used + * as the actual cache key internally. + */ queryHash?: string + /** + * The query key to use for this query. + * + * The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) + * for more information. + * + * The query will automatically update when this key changes (as long as `enabled` is not set to `false`). + */ queryKey?: TQueryKey + /** + * If specified, this function is used to hash the `queryKey` to a string. + */ queryKeyHashFn?: QueryKeyHashFunction + /** + * If set, this value will be used as the initial data for the query cache (as long as the query hasn't been + * created or cached yet). + * If set to a function, the function will be called **once** during the shared/root query initialization, and be + * expected to synchronously return the initial data. + * Initial data is considered stale by default unless a `staleTime` has been set. + * `initialData` **is persisted** to the cache. + */ initialData?: TData | InitialDataFunction + /** + * If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. + */ initialDataUpdatedAt?: number | (() => number | undefined) + /** @internal */ behavior?: QueryBehavior /** * Set this to `false` to disable structural sharing between query results. @@ -267,7 +323,9 @@ export interface QueryOptions< structuralSharing?: | boolean | ((oldData: unknown | undefined, newData: unknown) => unknown) + /** @internal */ _defaulted?: boolean + /** @internal */ _type?: 'infinite' /** * Additional payload to be stored on each query. @@ -333,6 +391,7 @@ export interface QueryObserverOptions< /** * The time in milliseconds after data is considered stale. * If set to `Infinity`, the data will never be considered stale. + * If set to `'static'`, the data will never be considered stale. * If set to a function, the function will be executed with the query to compute a `staleTime`. * Defaults to `0`. */ @@ -356,7 +415,7 @@ export interface QueryObserverOptions< /** * If set to `true`, the query will refetch on window focus if the data is stale. * If set to `false`, the query will not refetch on window focus. - * If set to `'always'`, the query will always refetch on window focus. + * If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). * If set to a function, the function will be executed with the latest data and query to compute the value. * Defaults to `true`. */ @@ -369,7 +428,7 @@ export interface QueryObserverOptions< /** * If set to `true`, the query will refetch on reconnect if the data is stale. * If set to `false`, the query will not refetch on reconnect. - * If set to `'always'`, the query will always refetch on reconnect. + * If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). * If set to a function, the function will be executed with the latest data and query to compute the value. * Defaults to `true` unless `networkMode` is `'always'`. */ @@ -382,7 +441,7 @@ export interface QueryObserverOptions< /** * If set to `true`, the query will refetch on mount if the data is stale. * If set to `false`, will disable additional instances of a query to trigger background refetch. - * If set to `'always'`, the query will always refetch on mount. + * If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). * If set to a function, the function will be executed with the latest data and query to compute the value * Defaults to `true`. */ @@ -415,7 +474,10 @@ export interface QueryObserverOptions< */ throwOnError?: ThrowOnError /** - * This option can be used to transform or select a part of the data returned by the query function. + * This option can be used to transform or select a part of the data returned by the query function. It affects + * the returned `data` value, but does not affect what gets stored in the query cache. + * The `select` function will only run if `data` changed, or if the reference to the `select` function itself + * changes. To optimize, memoize the function so its reference stays stable across calls. */ select?: (data: TQueryData) => TData /** @@ -436,6 +498,7 @@ export interface QueryObserverOptions< TQueryKey > + /** @internal */ _optimisticResults?: 'optimistic' | 'isRestoring' } @@ -1135,6 +1198,7 @@ export interface MutationOptions< retryDelay?: RetryDelayValue networkMode?: NetworkMode gcTime?: number + /** @internal */ _defaulted?: boolean meta?: MutationMeta scope?: MutationScope diff --git a/packages/query-core/src/utils.ts b/packages/query-core/src/utils.ts index 629115e8fae..22d8f68d0c7 100644 --- a/packages/query-core/src/utils.ts +++ b/packages/query-core/src/utils.ts @@ -24,6 +24,10 @@ type TuplePrefixes> = T extends readonly [] ? readonly [] : TuplePrefixes> | T +/** + * Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. + * All provided filters must match; filters that are left unspecified are ignored. + */ export interface QueryFilters { /** * Filter to active queries, inactive queries or all queries @@ -51,6 +55,10 @@ export interface QueryFilters { fetchStatus?: FetchStatus } +/** + * Filters used to select mutations, for example in `mutationCache.findAll` or `queryClient.isMutating`. + * All provided filters must match; filters that are left unspecified are ignored. + */ export interface MutationFilters< TData = unknown, TError = DefaultError, @@ -77,6 +85,21 @@ export interface MutationFilters< status?: MutationStatus } +/** + * Either a plain value of type `TOutput`, or a function that receives `TInput` and returns `TOutput`. + * Used for example by `setQueryData`-style updaters, which accept either the new data directly or a + * function that computes it from the previous data. See {@link functionalUpdate}. + * + * @example + * ```ts + * queryClient.setQueryData(['posts'], newPosts) + * + * // Or, using an updater function that receives the current data: + * queryClient.setQueryData(['posts'], (oldPosts) => + * oldPosts ? [...oldPosts, newPost] : oldPosts, + * ) + * ``` + */ export type Updater = TOutput | ((input: TInput) => TOutput) export type QueryTypeFilter = 'all' | 'active' | 'inactive' @@ -88,6 +111,9 @@ export type QueryTypeFilter = 'all' | 'active' | 'inactive' */ export const isServer = typeof window === 'undefined' || 'Deno' in globalThis +/** + * A function that does nothing. + */ export function noop(): void export function noop(): undefined export function noop() {} @@ -131,6 +157,19 @@ export function resolveQueryValue< : value } +/** + * Checks whether a query matches the given {@link QueryFilters}. + * Every filter that is specified must match; filters that are left unspecified are ignored. + * + * @example + * ```ts + * const queryCache = queryClient.getQueryCache() + * + * const matchingQueries = queryCache + * .getAll() + * .filter((query) => matchQuery({ queryKey: ['posts'] }, query)) + * ``` + */ export function matchQuery( filters: QueryFilters, query: Query, @@ -179,6 +218,20 @@ export function matchQuery( return true } +/** + * Checks whether a mutation matches the given {@link MutationFilters}. + * Every filter that is specified must match; filters that are left unspecified are ignored. + * If a `mutationKey` filter is provided but the mutation has no `mutationKey` of its own, it does not match. + * + * @example + * ```ts + * const mutationCache = queryClient.getMutationCache() + * + * const matchingMutations = mutationCache + * .getAll() + * .filter((mutation) => matchMutation({ mutationKey: ['addPost'] }, mutation)) + * ``` + */ export function matchMutation( filters: MutationFilters, mutation: Mutation, @@ -219,6 +272,12 @@ export function hashQueryKeyByOptions( /** * Default query & mutation keys hash function. * Hashes the value into a stable hash. + * + * @example + * ```ts + * // Object keys are sorted, so key order doesn't affect the hash: + * hashKey(['todos', { page: 1, filter: 'done' }]) // === '["todos",{"filter":"done","page":1}]' + * ``` */ export function hashKey(queryKey: QueryKey | MutationKey): string { return JSON.stringify(queryKey, (_, val) => @@ -415,6 +474,20 @@ export function replaceData< return data } +/** + * Intended to be passed as a query's `placeholderData` option, for example + * `placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new + * query key is fetching, it keeps displaying the previously fetched data until the new data arrives. + * + * @example + * ```ts + * new QueryObserver(queryClient, { + * queryKey: ['posts', page], + * queryFn: () => fetchPosts(page), + * placeholderData: keepPreviousData, + * }) + * ``` + */ export function keepPreviousData( previousData: T | undefined, ): T | undefined { @@ -431,7 +504,23 @@ export function addToStart(items: Array, item: T, max = 0): Array { return max && newItems.length > max ? newItems.slice(0, -1) : newItems } +/** + * Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent + * to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`, + * a query disabled via `skipToken` cannot be triggered with `refetch`. + * + * @example + * ```ts + * new QueryObserver(queryClient, { + * queryKey: ['post', postId], + * queryFn: postId != null ? () => fetchPost(postId) : skipToken, + * }) + * ``` + */ export const skipToken = Symbol() +/** + * The type of the {@link skipToken} sentinel value. + */ export type SkipToken = typeof skipToken export function ensureQueryFn< @@ -467,6 +556,21 @@ export function ensureQueryFn< return options.queryFn } +/** + * Resolves a `throwOnError` option to a boolean. + * If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller, + * additional context such as the query or mutation) and its result is returned, allowing the throwing + * behavior to be decided per error. Otherwise, `throwOnError` itself is coerced to a boolean (`undefined` + * resolves to `false`). + * + * @example + * ```ts + * const throwOnError = + * query.state.error && typeof options.throwOnError === 'function' + * ? shouldThrowError(options.throwOnError, [query.state.error, query]) + * : options.throwOnError + * ``` + */ export function shouldThrowError) => boolean>( throwOnError: boolean | T | undefined, params: Parameters, diff --git a/packages/solid-query/tsconfig.json b/packages/solid-query/tsconfig.json index 7f3c629b174..126986ae135 100644 --- a/packages/solid-query/tsconfig.json +++ b/packages/solid-query/tsconfig.json @@ -12,6 +12,5 @@ "*.config.ts", "*.config.js", "package.json" - ], - "references": [{ "path": "../query-core" }] + ] } diff --git a/packages/svelte-query/tsconfig.json b/packages/svelte-query/tsconfig.json index 25d5b262726..305714920cf 100644 --- a/packages/svelte-query/tsconfig.json +++ b/packages/svelte-query/tsconfig.json @@ -4,6 +4,5 @@ "outDir": "./dist-ts", "rootDir": "." }, - "include": ["src", "tests", "*.config.ts", "*.config.js", "package.json"], - "references": [{ "path": "../query-core" }] + "include": ["src", "tests", "*.config.ts", "*.config.js", "package.json"] } diff --git a/packages/vue-query/tsconfig.json b/packages/vue-query/tsconfig.json index f2244eacf3a..3d82a764dc5 100644 --- a/packages/vue-query/tsconfig.json +++ b/packages/vue-query/tsconfig.json @@ -10,6 +10,5 @@ "*.config.ts", "*.config.js", "package.json" - ], - "references": [{ "path": "../query-core" }] + ] } diff --git a/scripts/generate-docs.ts b/scripts/generate-docs.ts index be0f9baadee..9b4c123e182 100644 --- a/scripts/generate-docs.ts +++ b/scripts/generate-docs.ts @@ -163,7 +163,7 @@ async function generatePackageReferenceDocs(pkg: PackageReferenceDocsConfig) { gitRevision: 'main', entryPoints: pkg.entryPoints, tsconfig: pkg.tsconfig, - exclude: pkg.exclude, + ...(pkg.exclude && { exclude: pkg.exclude }), out: outputDir, }) @@ -196,19 +196,16 @@ const packages: Array = [ '../packages/angular-query-experimental/tsconfig.json', ), outputDir: resolve(__dirname, '../docs/framework/angular/reference'), - exclude: ['./packages/query-core/**/*'], }, { entryPoints: [resolve(__dirname, '../packages/svelte-query/src/index.ts')], tsconfig: resolve(__dirname, '../packages/svelte-query/tsconfig.json'), outputDir: resolve(__dirname, '../docs/framework/svelte/reference'), - exclude: ['./packages/query-core/**/*'], }, { entryPoints: [resolve(__dirname, '../packages/solid-query/src/index.ts')], tsconfig: resolve(__dirname, '../packages/solid-query/tsconfig.json'), outputDir: resolve(__dirname, '../docs/framework/solid/reference'), - exclude: ['./packages/query-core/**/*'], redirectFrom: { 'functions/infiniteQueryOptions': [ 'framework/solid/reference/infiniteQueryOptions', @@ -234,13 +231,11 @@ const packages: Array = [ entryPoints: [resolve(__dirname, '../packages/vue-query/src/index.ts')], tsconfig: resolve(__dirname, '../packages/vue-query/tsconfig.json'), outputDir: resolve(__dirname, '../docs/framework/vue/reference'), - exclude: ['./packages/query-core/**/*'], }, { entryPoints: [resolve(__dirname, '../packages/react-query/src/index.ts')], tsconfig: resolve(__dirname, '../packages/react-query/tsconfig.json'), outputDir: resolve(__dirname, '../docs/framework/react/reference'), - exclude: ['./packages/query-core/**/*'], redirectFrom: { 'functions/infiniteQueryOptions': [ 'framework/react/reference/infiniteQueryOptions', @@ -291,13 +286,11 @@ const packages: Array = [ entryPoints: [resolve(__dirname, '../packages/preact-query/src/index.ts')], tsconfig: resolve(__dirname, '../packages/preact-query/tsconfig.json'), outputDir: resolve(__dirname, '../docs/framework/preact/reference'), - exclude: ['./packages/query-core/**/*'], }, { entryPoints: [resolve(__dirname, '../packages/lit-query/src/index.ts')], tsconfig: resolve(__dirname, '../packages/lit-query/tsconfig.json'), outputDir: resolve(__dirname, '../docs/framework/lit/reference'), - exclude: ['./packages/query-core/**/*'], excludeExternals: true, simplifyLitQueriesControllerTypes: true, trimGeneratedMarkdown: true, From 026508678cba60a6fe6045c90c88cfd48a630dbb Mon Sep 17 00:00:00 2001 From: Wonsuk Choi Date: Mon, 7 Sep 2026 03:01:15 +0900 Subject: [PATCH 2/9] docs(config.json): add sidebar entries for newly generated query-core reference docs --- docs/config.json | 5442 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 4793 insertions(+), 649 deletions(-) diff --git a/docs/config.json b/docs/config.json index ff82b31c171..e9ce7b0cc68 100644 --- a/docs/config.json +++ b/docs/config.json @@ -1029,1274 +1029,5138 @@ "to": "framework/react/reference/index" }, { - "label": "Functions / useQuery", - "to": "framework/react/reference/functions/useQuery" + "label": "Functions / HydrationBoundary", + "to": "framework/react/reference/functions/HydrationBoundary" }, { - "label": "Functions / useQueries", - "to": "framework/react/reference/functions/useQueries" + "label": "Functions / QueryClientProvider", + "to": "framework/react/reference/functions/QueryClientProvider" }, { - "label": "Functions / useInfiniteQuery", - "to": "framework/react/reference/functions/useInfiniteQuery" + "label": "Functions / QueryErrorResetBoundary", + "to": "framework/react/reference/functions/QueryErrorResetBoundary" }, { - "label": "Functions / useMutation", - "to": "framework/react/reference/functions/useMutation" + "label": "Functions / defaultShouldDehydrateMutation", + "to": "framework/react/reference/functions/defaultShouldDehydrateMutation" }, { - "label": "Functions / useIsFetching", - "to": "framework/react/reference/functions/useIsFetching" + "label": "Functions / defaultShouldDehydrateQuery", + "to": "framework/react/reference/functions/defaultShouldDehydrateQuery" }, { - "label": "Functions / useIsMutating", - "to": "framework/react/reference/functions/useIsMutating" + "label": "Functions / dehydrate", + "to": "framework/react/reference/functions/dehydrate" }, { - "label": "Functions / useMutationState", - "to": "framework/react/reference/functions/useMutationState" + "label": "Functions / dehydrateQuery", + "to": "framework/react/reference/functions/dehydrateQuery" }, { - "label": "Functions / useSuspenseQuery", - "to": "framework/react/reference/functions/useSuspenseQuery" + "label": "Functions / experimental_streamedQuery", + "to": "framework/react/reference/functions/experimental_streamedQuery" }, { - "label": "Functions / useSuspenseInfiniteQuery", - "to": "framework/react/reference/functions/useSuspenseInfiniteQuery" + "label": "Functions / hashKey", + "to": "framework/react/reference/functions/hashKey" }, { - "label": "Functions / useSuspenseQueries", - "to": "framework/react/reference/functions/useSuspenseQueries" + "label": "Functions / hydrate", + "to": "framework/react/reference/functions/hydrate" }, { - "label": "Functions / QueryClientProvider", - "to": "framework/react/reference/functions/QueryClientProvider" + "label": "Functions / infiniteQueryOptions", + "to": "framework/react/reference/functions/infiniteQueryOptions" }, { - "label": "Functions / useQueryClient", - "to": "framework/react/reference/functions/useQueryClient" + "label": "Functions / isCancelledError", + "to": "framework/react/reference/functions/isCancelledError" }, { - "label": "Functions / queryOptions", - "to": "framework/react/reference/functions/queryOptions" + "label": "Functions / keepPreviousData", + "to": "framework/react/reference/functions/keepPreviousData" }, { - "label": "Functions / infiniteQueryOptions", - "to": "framework/react/reference/functions/infiniteQueryOptions" + "label": "Functions / matchMutation", + "to": "framework/react/reference/functions/matchMutation" + }, + { + "label": "Functions / matchQuery", + "to": "framework/react/reference/functions/matchQuery" }, { "label": "Functions / mutationOptions", "to": "framework/react/reference/functions/mutationOptions" }, { - "label": "Functions / usePrefetchQuery", - "to": "framework/react/reference/functions/usePrefetchQuery" + "label": "Functions / noop", + "to": "framework/react/reference/functions/noop" }, { - "label": "Functions / usePrefetchInfiniteQuery", - "to": "framework/react/reference/functions/usePrefetchInfiniteQuery" + "label": "Functions / partialMatchKey", + "to": "framework/react/reference/functions/partialMatchKey" }, { - "label": "Functions / QueryErrorResetBoundary", - "to": "framework/react/reference/functions/QueryErrorResetBoundary" + "label": "Functions / queryOptions", + "to": "framework/react/reference/functions/queryOptions" }, { - "label": "Functions / useQueryErrorResetBoundary", - "to": "framework/react/reference/functions/useQueryErrorResetBoundary" + "label": "Functions / replaceEqualDeep", + "to": "framework/react/reference/functions/replaceEqualDeep" }, { - "label": "Functions / HydrationBoundary", - "to": "framework/react/reference/functions/HydrationBoundary" + "label": "Functions / shouldThrowError", + "to": "framework/react/reference/functions/shouldThrowError" }, { - "label": "Functions / useIsRestoring", - "to": "framework/react/reference/functions/useIsRestoring" + "label": "Functions / useInfiniteQuery", + "to": "framework/react/reference/functions/useInfiniteQuery" }, { - "label": "Interfaces / HydrationBoundaryProps", - "to": "framework/react/reference/interfaces/HydrationBoundaryProps" + "label": "Functions / useIsFetching", + "to": "framework/react/reference/functions/useIsFetching" }, { - "label": "Interfaces / QueryErrorResetBoundaryProps", - "to": "framework/react/reference/interfaces/QueryErrorResetBoundaryProps" + "label": "Functions / useIsMutating", + "to": "framework/react/reference/functions/useIsMutating" }, { - "label": "Interfaces / UseBaseQueryOptions", - "to": "framework/react/reference/interfaces/UseBaseQueryOptions" + "label": "Functions / useIsRestoring", + "to": "framework/react/reference/functions/useIsRestoring" }, { - "label": "Interfaces / UseInfiniteQueryOptions", - "to": "framework/react/reference/interfaces/UseInfiniteQueryOptions" + "label": "Functions / useMutation", + "to": "framework/react/reference/functions/useMutation" }, { - "label": "Interfaces / UseMutationOptions", - "to": "framework/react/reference/interfaces/UseMutationOptions" + "label": "Functions / useMutationState", + "to": "framework/react/reference/functions/useMutationState" }, { - "label": "Interfaces / UseQueryOptions", - "to": "framework/react/reference/interfaces/UseQueryOptions" + "label": "Functions / usePrefetchInfiniteQuery", + "to": "framework/react/reference/functions/usePrefetchInfiniteQuery" }, { - "label": "Interfaces / UseSuspenseInfiniteQueryOptions", - "to": "framework/react/reference/interfaces/UseSuspenseInfiniteQueryOptions" + "label": "Functions / usePrefetchQuery", + "to": "framework/react/reference/functions/usePrefetchQuery" }, { - "label": "Interfaces / UseSuspenseQueryOptions", - "to": "framework/react/reference/interfaces/UseSuspenseQueryOptions" + "label": "Functions / useQueries", + "to": "framework/react/reference/functions/useQueries" }, { - "label": "Types / AnyUseBaseQueryOptions", - "to": "framework/react/reference/type-aliases/AnyUseBaseQueryOptions" + "label": "Functions / useQuery", + "to": "framework/react/reference/functions/useQuery" }, { - "label": "Types / AnyUseInfiniteQueryOptions", - "to": "framework/react/reference/type-aliases/AnyUseInfiniteQueryOptions" + "label": "Functions / useQueryClient", + "to": "framework/react/reference/functions/useQueryClient" }, { - "label": "Types / AnyUseMutationOptions", - "to": "framework/react/reference/type-aliases/AnyUseMutationOptions" + "label": "Functions / useQueryErrorResetBoundary", + "to": "framework/react/reference/functions/useQueryErrorResetBoundary" }, { - "label": "Types / AnyUseQueryOptions", - "to": "framework/react/reference/type-aliases/AnyUseQueryOptions" + "label": "Functions / useSuspenseInfiniteQuery", + "to": "framework/react/reference/functions/useSuspenseInfiniteQuery" }, { - "label": "Types / AnyUseSuspenseInfiniteQueryOptions", - "to": "framework/react/reference/type-aliases/AnyUseSuspenseInfiniteQueryOptions" + "label": "Functions / useSuspenseQueries", + "to": "framework/react/reference/functions/useSuspenseQueries" }, { - "label": "Types / AnyUseSuspenseQueryOptions", - "to": "framework/react/reference/type-aliases/AnyUseSuspenseQueryOptions" + "label": "Functions / useSuspenseQuery", + "to": "framework/react/reference/functions/useSuspenseQuery" }, { - "label": "Types / DefinedInitialDataInfiniteOptions", - "to": "framework/react/reference/type-aliases/DefinedInitialDataInfiniteOptions" + "label": "Classes / CancelledError", + "to": "framework/react/reference/classes/CancelledError" }, { - "label": "Types / DefinedInitialDataOptions", - "to": "framework/react/reference/type-aliases/DefinedInitialDataOptions" + "label": "Classes / InfiniteQueryObserver", + "to": "framework/react/reference/classes/InfiniteQueryObserver" }, { - "label": "Types / DefinedUseInfiniteQueryResult", - "to": "framework/react/reference/type-aliases/DefinedUseInfiniteQueryResult" + "label": "Classes / Mutation", + "to": "framework/react/reference/classes/Mutation" }, { - "label": "Types / DefinedUseQueryResult", - "to": "framework/react/reference/type-aliases/DefinedUseQueryResult" + "label": "Classes / MutationCache", + "to": "framework/react/reference/classes/MutationCache" }, { - "label": "Types / QueriesOptions", - "to": "framework/react/reference/type-aliases/QueriesOptions" + "label": "Classes / MutationObserver", + "to": "framework/react/reference/classes/MutationObserver" }, { - "label": "Types / QueriesResults", - "to": "framework/react/reference/type-aliases/QueriesResults" + "label": "Classes / QueriesObserver", + "to": "framework/react/reference/classes/QueriesObserver" }, { - "label": "Types / QueryClientProviderProps", - "to": "framework/react/reference/type-aliases/QueryClientProviderProps" + "label": "Classes / Query", + "to": "framework/react/reference/classes/Query" }, { - "label": "Types / QueryErrorClearResetFunction", - "to": "framework/react/reference/type-aliases/QueryErrorClearResetFunction" + "label": "Classes / QueryCache", + "to": "framework/react/reference/classes/QueryCache" }, { - "label": "Types / QueryErrorIsResetFunction", - "to": "framework/react/reference/type-aliases/QueryErrorIsResetFunction" + "label": "Classes / QueryClient", + "to": "framework/react/reference/classes/QueryClient" }, { - "label": "Types / QueryErrorResetBoundaryFunction", - "to": "framework/react/reference/type-aliases/QueryErrorResetBoundaryFunction" + "label": "Classes / QueryObserver", + "to": "framework/react/reference/classes/QueryObserver" }, { - "label": "Types / QueryErrorResetFunction", - "to": "framework/react/reference/type-aliases/QueryErrorResetFunction" + "label": "Interfaces / CancelOptions", + "to": "framework/react/reference/interfaces/CancelOptions" }, { - "label": "Types / SuspenseQueriesOptions", - "to": "framework/react/reference/type-aliases/SuspenseQueriesOptions" + "label": "Interfaces / DefaultOptions", + "to": "framework/react/reference/interfaces/DefaultOptions" }, { - "label": "Types / SuspenseQueriesResults", - "to": "framework/react/reference/type-aliases/SuspenseQueriesResults" + "label": "Interfaces / DehydrateOptions", + "to": "framework/react/reference/interfaces/DehydrateOptions" }, { - "label": "Types / UndefinedInitialDataInfiniteOptions", - "to": "framework/react/reference/type-aliases/UndefinedInitialDataInfiniteOptions" + "label": "Interfaces / DehydratedState", + "to": "framework/react/reference/interfaces/DehydratedState" }, { - "label": "Types / UndefinedInitialDataOptions", - "to": "framework/react/reference/type-aliases/UndefinedInitialDataOptions" + "label": "Interfaces / EnsureQueryDataOptions", + "to": "framework/react/reference/interfaces/EnsureQueryDataOptions" }, { - "label": "Types / UnusedSkipTokenInfiniteOptions", - "to": "framework/react/reference/type-aliases/UnusedSkipTokenInfiniteOptions" + "label": "Interfaces / FetchNextPageOptions", + "to": "framework/react/reference/interfaces/FetchNextPageOptions" }, { - "label": "Types / UnusedSkipTokenOptions", - "to": "framework/react/reference/type-aliases/UnusedSkipTokenOptions" + "label": "Interfaces / FetchPreviousPageOptions", + "to": "framework/react/reference/interfaces/FetchPreviousPageOptions" }, { - "label": "Types / UseBaseMutationResult", - "to": "framework/react/reference/type-aliases/UseBaseMutationResult" + "label": "Interfaces / FetchQueryOptions", + "to": "framework/react/reference/interfaces/FetchQueryOptions" }, { - "label": "Types / UseBaseQueryResult", - "to": "framework/react/reference/type-aliases/UseBaseQueryResult" + "label": "Interfaces / HydrateOptions", + "to": "framework/react/reference/interfaces/HydrateOptions" }, { - "label": "Types / UseInfiniteQueryResult", - "to": "framework/react/reference/type-aliases/UseInfiniteQueryResult" + "label": "Interfaces / HydrationBoundaryProps", + "to": "framework/react/reference/interfaces/HydrationBoundaryProps" }, { - "label": "Types / UseMutateAsyncFunction", - "to": "framework/react/reference/type-aliases/UseMutateAsyncFunction" + "label": "Interfaces / InfiniteData", + "to": "framework/react/reference/interfaces/InfiniteData" }, { - "label": "Types / UseMutateFunction", - "to": "framework/react/reference/type-aliases/UseMutateFunction" + "label": "Interfaces / InfiniteQueryObserverBaseResult", + "to": "framework/react/reference/interfaces/InfiniteQueryObserverBaseResult" }, { - "label": "Types / UseMutationResult", - "to": "framework/react/reference/type-aliases/UseMutationResult" + "label": "Interfaces / InfiniteQueryObserverLoadingErrorResult", + "to": "framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult" }, { - "label": "Types / UsePrefetchInfiniteQueryOptions", - "to": "framework/react/reference/type-aliases/UsePrefetchInfiniteQueryOptions" + "label": "Interfaces / InfiniteQueryObserverLoadingResult", + "to": "framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult" }, { - "label": "Types / UsePrefetchQueryOptions", - "to": "framework/react/reference/type-aliases/UsePrefetchQueryOptions" + "label": "Interfaces / InfiniteQueryObserverOptions", + "to": "framework/react/reference/interfaces/InfiniteQueryObserverOptions" }, { - "label": "Types / UseQueryResult", - "to": "framework/react/reference/type-aliases/UseQueryResult" + "label": "Interfaces / InfiniteQueryObserverPendingResult", + "to": "framework/react/reference/interfaces/InfiniteQueryObserverPendingResult" }, { - "label": "Types / UseSuspenseInfiniteQueryResult", - "to": "framework/react/reference/type-aliases/UseSuspenseInfiniteQueryResult" + "label": "Interfaces / InfiniteQueryObserverPlaceholderResult", + "to": "framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult" }, { - "label": "Types / UseSuspenseQueryResult", - "to": "framework/react/reference/type-aliases/UseSuspenseQueryResult" + "label": "Interfaces / InfiniteQueryObserverRefetchErrorResult", + "to": "framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult" }, { - "label": "Variables / IsRestoringProvider", - "to": "framework/react/reference/variables/IsRestoringProvider" + "label": "Interfaces / InfiniteQueryObserverSuccessResult", + "to": "framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult" }, { - "label": "Variables / QueryClientContext", - "to": "framework/react/reference/variables/QueryClientContext" - } - ] - }, - { - "label": "vue", - "children": [ + "label": "Interfaces / InfiniteQueryPageParamsOptions", + "to": "framework/react/reference/interfaces/InfiniteQueryPageParamsOptions" + }, { - "label": "Vue Reference", - "to": "framework/vue/reference/index" + "label": "Interfaces / InitialPageParam", + "to": "framework/react/reference/interfaces/InitialPageParam" }, { - "label": "Functions / useQuery", - "to": "framework/vue/reference/functions/useQuery" + "label": "Interfaces / InvalidateOptions", + "to": "framework/react/reference/interfaces/InvalidateOptions" }, { - "label": "Functions / useQueries", - "to": "framework/vue/reference/functions/useQueries" + "label": "Interfaces / InvalidateQueryFilters", + "to": "framework/react/reference/interfaces/InvalidateQueryFilters" }, { - "label": "Functions / useInfiniteQuery", - "to": "framework/vue/reference/functions/useInfiniteQuery" + "label": "Interfaces / MutateOptions", + "to": "framework/react/reference/interfaces/MutateOptions" }, { - "label": "Functions / useMutation", - "to": "framework/vue/reference/functions/useMutation" + "label": "Interfaces / MutationCacheConfig", + "to": "framework/react/reference/interfaces/MutationCacheConfig" }, { - "label": "Functions / useIsFetching", - "to": "framework/vue/reference/functions/useIsFetching" + "label": "Interfaces / MutationFilters", + "to": "framework/react/reference/interfaces/MutationFilters" }, { - "label": "Functions / useIsMutating", - "to": "framework/vue/reference/functions/useIsMutating" + "label": "Interfaces / MutationObserverBaseResult", + "to": "framework/react/reference/interfaces/MutationObserverBaseResult" }, { - "label": "Functions / useMutationState", - "to": "framework/vue/reference/functions/useMutationState" + "label": "Interfaces / MutationObserverErrorResult", + "to": "framework/react/reference/interfaces/MutationObserverErrorResult" }, { - "label": "Functions / useQueryClient", - "to": "framework/vue/reference/functions/useQueryClient" + "label": "Interfaces / MutationObserverIdleResult", + "to": "framework/react/reference/interfaces/MutationObserverIdleResult" }, { - "label": "Functions / queryOptions", - "to": "framework/vue/reference/functions/queryOptions" + "label": "Interfaces / MutationObserverLoadingResult", + "to": "framework/react/reference/interfaces/MutationObserverLoadingResult" }, { - "label": "Functions / infiniteQueryOptions", - "to": "framework/vue/reference/functions/infiniteQueryOptions" + "label": "Interfaces / MutationObserverOptions", + "to": "framework/react/reference/interfaces/MutationObserverOptions" }, { - "label": "Functions / mutationOptions", - "to": "framework/vue/reference/functions/mutationOptions" + "label": "Interfaces / MutationObserverSuccessResult", + "to": "framework/react/reference/interfaces/MutationObserverSuccessResult" }, { - "label": "Functions / usePrefetchQuery", - "to": "framework/vue/reference/functions/usePrefetchQuery" + "label": "Interfaces / MutationOptions", + "to": "framework/react/reference/interfaces/MutationOptions" }, { - "label": "Functions / usePrefetchInfiniteQuery", - "to": "framework/vue/reference/functions/usePrefetchInfiniteQuery" + "label": "Interfaces / MutationState", + "to": "framework/react/reference/interfaces/MutationState" }, { - "label": "Classes / MutationCache", - "to": "framework/vue/reference/classes/MutationCache" + "label": "Interfaces / NotifyEvent", + "to": "framework/react/reference/interfaces/NotifyEvent" }, { - "label": "Classes / QueryCache", - "to": "framework/vue/reference/classes/QueryCache" + "label": "Interfaces / QueriesObserverOptions", + "to": "framework/react/reference/interfaces/QueriesObserverOptions" }, { - "label": "Classes / QueryClient", - "to": "framework/vue/reference/classes/QueryClient" + "label": "Interfaces / QueryCacheConfig", + "to": "framework/react/reference/interfaces/QueryCacheConfig" }, { - "label": "Types / DefinedInitialDataInfiniteOptions", - "to": "framework/vue/reference/type-aliases/DefinedInitialDataInfiniteOptions" + "label": "Interfaces / QueryClientConfig", + "to": "framework/react/reference/interfaces/QueryClientConfig" }, { - "label": "Types / DefinedInitialQueryOptions", - "to": "framework/vue/reference/type-aliases/DefinedInitialQueryOptions" + "label": "Interfaces / QueryErrorResetBoundaryProps", + "to": "framework/react/reference/interfaces/QueryErrorResetBoundaryProps" }, { - "label": "Types / DefinedInitialQueryOptionsWithDataTag", - "to": "framework/vue/reference/type-aliases/DefinedInitialQueryOptionsWithDataTag" + "label": "Interfaces / QueryExecuteOptions", + "to": "framework/react/reference/interfaces/QueryExecuteOptions" }, { - "label": "Types / MutationFilters", - "to": "framework/vue/reference/type-aliases/MutationFilters" + "label": "Interfaces / QueryFilters", + "to": "framework/react/reference/interfaces/QueryFilters" }, { - "label": "Types / MutationOptions", - "to": "framework/vue/reference/type-aliases/MutationOptions" + "label": "Interfaces / QueryObserverBaseResult", + "to": "framework/react/reference/interfaces/QueryObserverBaseResult" }, { - "label": "Types / MutationStateOptions", - "to": "framework/vue/reference/type-aliases/MutationStateOptions" + "label": "Interfaces / QueryObserverLoadingErrorResult", + "to": "framework/react/reference/interfaces/QueryObserverLoadingErrorResult" }, { - "label": "Types / QueryFilters", - "to": "framework/vue/reference/type-aliases/QueryFilters" + "label": "Interfaces / QueryObserverLoadingResult", + "to": "framework/react/reference/interfaces/QueryObserverLoadingResult" }, { - "label": "Types / QueryOptions", - "to": "framework/vue/reference/type-aliases/QueryOptions" + "label": "Interfaces / QueryObserverOptions", + "to": "framework/react/reference/interfaces/QueryObserverOptions" }, { - "label": "Types / UndefinedInitialDataInfiniteOptions", - "to": "framework/vue/reference/type-aliases/UndefinedInitialDataInfiniteOptions" + "label": "Interfaces / QueryObserverPendingResult", + "to": "framework/react/reference/interfaces/QueryObserverPendingResult" }, { - "label": "Types / UndefinedInitialQueryOptions", - "to": "framework/vue/reference/type-aliases/UndefinedInitialQueryOptions" + "label": "Interfaces / QueryObserverPlaceholderResult", + "to": "framework/react/reference/interfaces/QueryObserverPlaceholderResult" }, { - "label": "Types / UndefinedInitialQueryOptionsWithDataTag", - "to": "framework/vue/reference/type-aliases/UndefinedInitialQueryOptionsWithDataTag" + "label": "Interfaces / QueryObserverRefetchErrorResult", + "to": "framework/react/reference/interfaces/QueryObserverRefetchErrorResult" }, { - "label": "Types / UseInfiniteQueryOptions", - "to": "framework/vue/reference/type-aliases/UseInfiniteQueryOptions" + "label": "Interfaces / QueryObserverSuccessResult", + "to": "framework/react/reference/interfaces/QueryObserverSuccessResult" }, { - "label": "Types / UseInfiniteQueryReturnType", - "to": "framework/vue/reference/type-aliases/UseInfiniteQueryReturnType" + "label": "Interfaces / QueryOptions", + "to": "framework/react/reference/interfaces/QueryOptions" }, { - "label": "Types / UseMutationOptions", - "to": "framework/vue/reference/type-aliases/UseMutationOptions" + "label": "Interfaces / QueryState", + "to": "framework/react/reference/interfaces/QueryState" }, { - "label": "Types / UseMutationReturnType", - "to": "framework/vue/reference/type-aliases/UseMutationReturnType" + "label": "Interfaces / RefetchOptions", + "to": "framework/react/reference/interfaces/RefetchOptions" }, { - "label": "Types / UsePrefetchInfiniteQueryOptions", - "to": "framework/vue/reference/type-aliases/UsePrefetchInfiniteQueryOptions" + "label": "Interfaces / RefetchQueryFilters", + "to": "framework/react/reference/interfaces/RefetchQueryFilters" }, { - "label": "Types / UsePrefetchQueryOptions", - "to": "framework/vue/reference/type-aliases/UsePrefetchQueryOptions" + "label": "Interfaces / Register", + "to": "framework/react/reference/interfaces/Register" }, { - "label": "Types / UseQueriesOptions", - "to": "framework/vue/reference/type-aliases/UseQueriesOptions" + "label": "Interfaces / ResetOptions", + "to": "framework/react/reference/interfaces/ResetOptions" }, { - "label": "Types / UseQueriesResults", - "to": "framework/vue/reference/type-aliases/UseQueriesResults" + "label": "Interfaces / ResultOptions", + "to": "framework/react/reference/interfaces/ResultOptions" }, { - "label": "Types / UseQueryDefinedReturnType", - "to": "framework/vue/reference/type-aliases/UseQueryDefinedReturnType" + "label": "Interfaces / SetDataOptions", + "to": "framework/react/reference/interfaces/SetDataOptions" }, { - "label": "Types / UseQueryOptions", - "to": "framework/vue/reference/type-aliases/UseQueryOptions" + "label": "Interfaces / UseBaseQueryOptions", + "to": "framework/react/reference/interfaces/UseBaseQueryOptions" }, { - "label": "Types / UseQueryReturnType", - "to": "framework/vue/reference/type-aliases/UseQueryReturnType" + "label": "Interfaces / UseInfiniteQueryOptions", + "to": "framework/react/reference/interfaces/UseInfiniteQueryOptions" }, { - "label": "Types / VueQueryPluginOptions", - "to": "framework/vue/reference/type-aliases/VueQueryPluginOptions" + "label": "Interfaces / UseMutationOptions", + "to": "framework/react/reference/interfaces/UseMutationOptions" }, { - "label": "Variables / VueQueryPlugin", - "to": "framework/vue/reference/variables/VueQueryPlugin" - } - ] - }, - { - "label": "solid", - "children": [ - { - "label": "Solid Reference", - "to": "framework/solid/reference/index" + "label": "Interfaces / UseQueryOptions", + "to": "framework/react/reference/interfaces/UseQueryOptions" }, { - "label": "Functions / useQuery", - "to": "framework/solid/reference/functions/useQuery" + "label": "Interfaces / UseSuspenseInfiniteQueryOptions", + "to": "framework/react/reference/interfaces/UseSuspenseInfiniteQueryOptions" }, { - "label": "Functions / useQueries", - "to": "framework/solid/reference/functions/useQueries" + "label": "Interfaces / UseSuspenseQueryOptions", + "to": "framework/react/reference/interfaces/UseSuspenseQueryOptions" }, { - "label": "Functions / useInfiniteQuery", - "to": "framework/solid/reference/functions/useInfiniteQuery" + "label": "Types / AnyDataTag", + "to": "framework/react/reference/type-aliases/AnyDataTag" }, { - "label": "Functions / useMutation", - "to": "framework/solid/reference/functions/useMutation" + "label": "Types / AnyUseBaseQueryOptions", + "to": "framework/react/reference/type-aliases/AnyUseBaseQueryOptions" }, { - "label": "Functions / useIsFetching", - "to": "framework/solid/reference/functions/useIsFetching" + "label": "Types / AnyUseInfiniteQueryOptions", + "to": "framework/react/reference/type-aliases/AnyUseInfiniteQueryOptions" }, { - "label": "Functions / useIsMutating", - "to": "framework/solid/reference/functions/useIsMutating" + "label": "Types / AnyUseMutationOptions", + "to": "framework/react/reference/type-aliases/AnyUseMutationOptions" }, { - "label": "Functions / useMutationState", - "to": "framework/solid/reference/functions/useMutationState" + "label": "Types / AnyUseQueryOptions", + "to": "framework/react/reference/type-aliases/AnyUseQueryOptions" }, { - "label": "Functions / QueryClientProvider", - "to": "framework/solid/reference/functions/QueryClientProvider" + "label": "Types / AnyUseSuspenseInfiniteQueryOptions", + "to": "framework/react/reference/type-aliases/AnyUseSuspenseInfiniteQueryOptions" }, { - "label": "Functions / useQueryClient", - "to": "framework/solid/reference/functions/useQueryClient" + "label": "Types / AnyUseSuspenseQueryOptions", + "to": "framework/react/reference/type-aliases/AnyUseSuspenseQueryOptions" }, { - "label": "Functions / queryOptions", - "to": "framework/solid/reference/functions/queryOptions" + "label": "Types / DataTag", + "to": "framework/react/reference/type-aliases/DataTag" }, { - "label": "Functions / infiniteQueryOptions", - "to": "framework/solid/reference/functions/infiniteQueryOptions" + "label": "Types / DefaultError", + "to": "framework/react/reference/type-aliases/DefaultError" }, { - "label": "Functions / mutationOptions", - "to": "framework/solid/reference/functions/mutationOptions" + "label": "Types / DefaultedInfiniteQueryObserverOptions", + "to": "framework/react/reference/type-aliases/DefaultedInfiniteQueryObserverOptions" }, { - "label": "Functions / useIsRestoring", - "to": "framework/solid/reference/functions/useIsRestoring" + "label": "Types / DefaultedQueryObserverOptions", + "to": "framework/react/reference/type-aliases/DefaultedQueryObserverOptions" }, { - "label": "Classes / QueryClient", - "to": "framework/solid/reference/classes/QueryClient" + "label": "Types / DefinedInfiniteQueryObserverResult", + "to": "framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult" }, { - "label": "Interfaces / DefaultOptions", - "to": "framework/solid/reference/interfaces/DefaultOptions" + "label": "Types / DefinedInitialDataInfiniteOptions", + "to": "framework/react/reference/type-aliases/DefinedInitialDataInfiniteOptions" }, { - "label": "Interfaces / InfiniteQueryObserverOptions", - "to": "framework/solid/reference/interfaces/InfiniteQueryObserverOptions" + "label": "Types / DefinedInitialDataOptions", + "to": "framework/react/reference/type-aliases/DefinedInitialDataOptions" }, { - "label": "Interfaces / InfiniteQueryOptions", - "to": "framework/solid/reference/interfaces/InfiniteQueryOptions" + "label": "Types / DefinedQueryObserverResult", + "to": "framework/react/reference/type-aliases/DefinedQueryObserverResult" }, { - "label": "Interfaces / MutationOptions", - "to": "framework/solid/reference/interfaces/MutationOptions" + "label": "Types / DefinedUseInfiniteQueryResult", + "to": "framework/react/reference/type-aliases/DefinedUseInfiniteQueryResult" }, { - "label": "Interfaces / QueryClientConfig", - "to": "framework/solid/reference/interfaces/QueryClientConfig" + "label": "Types / DefinedUseQueryResult", + "to": "framework/react/reference/type-aliases/DefinedUseQueryResult" }, { - "label": "Interfaces / QueryObserverOptions", - "to": "framework/solid/reference/interfaces/QueryObserverOptions" + "label": "Types / DistributiveOmit", + "to": "framework/react/reference/type-aliases/DistributiveOmit" }, { - "label": "Interfaces / QueryOptions", - "to": "framework/solid/reference/interfaces/QueryOptions" + "label": "Types / EnsureInfiniteQueryDataOptions", + "to": "framework/react/reference/type-aliases/EnsureInfiniteQueryDataOptions" }, { - "label": "Interfaces / UseBaseQueryOptions", - "to": "framework/solid/reference/interfaces/UseBaseQueryOptions" + "label": "Types / FetchInfiniteQueryOptions", + "to": "framework/react/reference/type-aliases/FetchInfiniteQueryOptions" }, { - "label": "Types / DefinedInitialDataInfiniteOptions", - "to": "framework/solid/reference/type-aliases/DefinedInitialDataInfiniteOptions" + "label": "Types / FetchStatus", + "to": "framework/react/reference/type-aliases/FetchStatus" }, { - "label": "Types / DefinedInitialDataOptions", - "to": "framework/solid/reference/type-aliases/DefinedInitialDataOptions" + "label": "Types / GetNextPageParamFunction", + "to": "framework/react/reference/type-aliases/GetNextPageParamFunction" }, { - "label": "Types / DefinedUseBaseQueryResult", - "to": "framework/solid/reference/type-aliases/DefinedUseBaseQueryResult" + "label": "Types / GetPreviousPageParamFunction", + "to": "framework/react/reference/type-aliases/GetPreviousPageParamFunction" }, { - "label": "Types / DefinedUseInfiniteQueryResult", - "to": "framework/solid/reference/type-aliases/DefinedUseInfiniteQueryResult" + "label": "Types / InferDataFromTag", + "to": "framework/react/reference/type-aliases/InferDataFromTag" }, { - "label": "Types / DefinedUseQueryResult", - "to": "framework/solid/reference/type-aliases/DefinedUseQueryResult" + "label": "Types / InferErrorFromTag", + "to": "framework/react/reference/type-aliases/InferErrorFromTag" }, { - "label": "Types / QueryClientProviderProps", - "to": "framework/solid/reference/type-aliases/QueryClientProviderProps" + "label": "Types / InfiniteQueryExecuteOptions", + "to": "framework/react/reference/type-aliases/InfiniteQueryExecuteOptions" }, { - "label": "Types / UndefinedInitialDataInfiniteOptions", - "to": "framework/solid/reference/type-aliases/UndefinedInitialDataInfiniteOptions" + "label": "Types / InfiniteQueryObserverResult", + "to": "framework/react/reference/type-aliases/InfiniteQueryObserverResult" }, { - "label": "Types / UndefinedInitialDataOptions", - "to": "framework/solid/reference/type-aliases/UndefinedInitialDataOptions" + "label": "Types / InitialDataFunction", + "to": "framework/react/reference/type-aliases/InitialDataFunction" }, { - "label": "Types / UseBaseMutationResult", - "to": "framework/solid/reference/type-aliases/UseBaseMutationResult" + "label": "Types / ManagedTimerId", + "to": "framework/react/reference/type-aliases/ManagedTimerId" }, { - "label": "Types / UseBaseQueryResult", - "to": "framework/solid/reference/type-aliases/UseBaseQueryResult" + "label": "Types / MutateFunction", + "to": "framework/react/reference/type-aliases/MutateFunction" }, { - "label": "Types / UseInfiniteQueryOptions", - "to": "framework/solid/reference/type-aliases/UseInfiniteQueryOptions" + "label": "Types / MutateFunctionRest", + "to": "framework/react/reference/type-aliases/MutateFunctionRest" }, { - "label": "Types / UseInfiniteQueryResult", - "to": "framework/solid/reference/type-aliases/UseInfiniteQueryResult" + "label": "Types / MutationCacheNotifyEvent", + "to": "framework/react/reference/type-aliases/MutationCacheNotifyEvent" }, { - "label": "Types / UseMutateAsyncFunction", - "to": "framework/solid/reference/type-aliases/UseMutateAsyncFunction" + "label": "Types / MutationFunction", + "to": "framework/react/reference/type-aliases/MutationFunction" }, { - "label": "Types / UseMutateFunction", - "to": "framework/solid/reference/type-aliases/UseMutateFunction" + "label": "Types / MutationFunctionContext", + "to": "framework/react/reference/type-aliases/MutationFunctionContext" }, { - "label": "Types / UseMutationOptions", - "to": "framework/solid/reference/type-aliases/UseMutationOptions" + "label": "Types / MutationKey", + "to": "framework/react/reference/type-aliases/MutationKey" }, { - "label": "Types / UseMutationResult", - "to": "framework/solid/reference/type-aliases/UseMutationResult" + "label": "Types / MutationMeta", + "to": "framework/react/reference/type-aliases/MutationMeta" }, { - "label": "Types / UseQueryOptions", - "to": "framework/solid/reference/type-aliases/UseQueryOptions" + "label": "Types / MutationObserverResult", + "to": "framework/react/reference/type-aliases/MutationObserverResult" }, { - "label": "Types / UseQueryResult", - "to": "framework/solid/reference/type-aliases/UseQueryResult" + "label": "Types / MutationScope", + "to": "framework/react/reference/type-aliases/MutationScope" }, { - "label": "Variables / IsRestoringProvider", - "to": "framework/solid/reference/variables/IsRestoringProvider" + "label": "Types / MutationStatus", + "to": "framework/react/reference/type-aliases/MutationStatus" }, { - "label": "Variables / QueryClientContext", - "to": "framework/solid/reference/variables/QueryClientContext" + "label": "Types / NetworkMode", + "to": "framework/react/reference/type-aliases/NetworkMode" }, { - "label": "Variables / createInfiniteQuery", - "to": "framework/solid/reference/variables/createInfiniteQuery" + "label": "Types / NonUndefinedGuard", + "to": "framework/react/reference/type-aliases/NonUndefinedGuard" }, { - "label": "Variables / createMutation", - "to": "framework/solid/reference/variables/createMutation" + "label": "Types / NotifyEventType", + "to": "framework/react/reference/type-aliases/NotifyEventType" }, { - "label": "Variables / createQueries", - "to": "framework/solid/reference/variables/createQueries" + "label": "Types / NotifyOnChangeProps", + "to": "framework/react/reference/type-aliases/NotifyOnChangeProps" }, { - "label": "Variables / createQuery", - "to": "framework/solid/reference/variables/createQuery" - } - ] - }, - { - "label": "svelte", - "children": [ + "label": "Types / OmitKeyof", + "to": "framework/react/reference/type-aliases/OmitKeyof" + }, { - "label": "Svelte Reference", - "to": "framework/svelte/reference/index" + "label": "Types / Override", + "to": "framework/react/reference/type-aliases/Override" }, { - "label": "Functions / createQuery", - "to": "framework/svelte/reference/functions/createQuery" + "label": "Types / PlaceholderDataFunction", + "to": "framework/react/reference/type-aliases/PlaceholderDataFunction" }, { - "label": "Functions / createQueries", - "to": "framework/svelte/reference/functions/createQueries" + "label": "Types / QueriesOptions", + "to": "framework/react/reference/type-aliases/QueriesOptions" }, { - "label": "Functions / createInfiniteQuery", - "to": "framework/svelte/reference/functions/createInfiniteQuery" + "label": "Types / QueriesPlaceholderDataFunction", + "to": "framework/react/reference/type-aliases/QueriesPlaceholderDataFunction" }, { - "label": "Functions / createMutation", - "to": "framework/svelte/reference/functions/createMutation" + "label": "Types / QueriesResults", + "to": "framework/react/reference/type-aliases/QueriesResults" }, { - "label": "Functions / useIsFetching", - "to": "framework/svelte/reference/functions/useIsFetching" + "label": "Types / QueryBooleanOption", + "to": "framework/react/reference/type-aliases/QueryBooleanOption" }, { - "label": "Functions / useIsMutating", - "to": "framework/svelte/reference/functions/useIsMutating" + "label": "Types / QueryCacheNotifyEvent", + "to": "framework/react/reference/type-aliases/QueryCacheNotifyEvent" }, { - "label": "Functions / useMutationState", - "to": "framework/svelte/reference/functions/useMutationState" + "label": "Types / QueryClientProviderProps", + "to": "framework/react/reference/type-aliases/QueryClientProviderProps" }, { - "label": "Functions / useQueryClient", - "to": "framework/svelte/reference/functions/useQueryClient" + "label": "Types / QueryErrorClearResetFunction", + "to": "framework/react/reference/type-aliases/QueryErrorClearResetFunction" }, { - "label": "Functions / queryOptions", - "to": "framework/svelte/reference/functions/queryOptions" + "label": "Types / QueryErrorIsResetFunction", + "to": "framework/react/reference/type-aliases/QueryErrorIsResetFunction" }, { - "label": "Functions / infiniteQueryOptions", - "to": "framework/svelte/reference/functions/infiniteQueryOptions" + "label": "Types / QueryErrorResetBoundaryFunction", + "to": "framework/react/reference/type-aliases/QueryErrorResetBoundaryFunction" }, { - "label": "Functions / mutationOptions", - "to": "framework/svelte/reference/functions/mutationOptions" + "label": "Types / QueryErrorResetFunction", + "to": "framework/react/reference/type-aliases/QueryErrorResetFunction" }, { - "label": "Functions / useHydrate", - "to": "framework/svelte/reference/functions/useHydrate" + "label": "Types / QueryFunction", + "to": "framework/react/reference/type-aliases/QueryFunction" }, { - "label": "Functions / getIsRestoringContext", - "to": "framework/svelte/reference/functions/getIsRestoringContext" + "label": "Types / QueryFunctionContext", + "to": "framework/react/reference/type-aliases/QueryFunctionContext" }, { - "label": "Functions / getQueryClientContext", - "to": "framework/svelte/reference/functions/getQueryClientContext" + "label": "Types / QueryKey", + "to": "framework/react/reference/type-aliases/QueryKey" }, { - "label": "Functions / setIsRestoringContext", - "to": "framework/svelte/reference/functions/setIsRestoringContext" + "label": "Types / QueryKeyHashFunction", + "to": "framework/react/reference/type-aliases/QueryKeyHashFunction" }, { - "label": "Functions / setQueryClientContext", - "to": "framework/svelte/reference/functions/setQueryClientContext" + "label": "Types / QueryKeyWithDataTag", + "to": "framework/react/reference/type-aliases/QueryKeyWithDataTag" }, { - "label": "Functions / useIsRestoring", - "to": "framework/svelte/reference/functions/useIsRestoring" + "label": "Types / QueryMeta", + "to": "framework/react/reference/type-aliases/QueryMeta" }, { - "label": "Types / Accessor", - "to": "framework/svelte/reference/type-aliases/Accessor" + "label": "Types / QueryObserverResult", + "to": "framework/react/reference/type-aliases/QueryObserverResult" }, { - "label": "Types / CreateBaseMutationResult", - "to": "framework/svelte/reference/type-aliases/CreateBaseMutationResult" + "label": "Types / QueryPersister", + "to": "framework/react/reference/type-aliases/QueryPersister" }, { - "label": "Types / CreateBaseQueryOptions", - "to": "framework/svelte/reference/type-aliases/CreateBaseQueryOptions" + "label": "Types / QueryStatus", + "to": "framework/react/reference/type-aliases/QueryStatus" }, { - "label": "Types / CreateBaseQueryResult", - "to": "framework/svelte/reference/type-aliases/CreateBaseQueryResult" + "label": "Types / SkipToken", + "to": "framework/react/reference/type-aliases/SkipToken" }, { - "label": "Types / CreateInfiniteQueryOptions", - "to": "framework/svelte/reference/type-aliases/CreateInfiniteQueryOptions" + "label": "Types / StaleTime", + "to": "framework/react/reference/type-aliases/StaleTime" }, { - "label": "Types / CreateInfiniteQueryResult", - "to": "framework/svelte/reference/type-aliases/CreateInfiniteQueryResult" + "label": "Types / StaleTimeFunction", + "to": "framework/react/reference/type-aliases/StaleTimeFunction" }, { - "label": "Types / CreateMutateAsyncFunction", - "to": "framework/svelte/reference/type-aliases/CreateMutateAsyncFunction" + "label": "Types / SuspenseQueriesOptions", + "to": "framework/react/reference/type-aliases/SuspenseQueriesOptions" }, { - "label": "Types / CreateMutateFunction", - "to": "framework/svelte/reference/type-aliases/CreateMutateFunction" + "label": "Types / SuspenseQueriesResults", + "to": "framework/react/reference/type-aliases/SuspenseQueriesResults" }, { - "label": "Types / CreateMutationOptions", - "to": "framework/svelte/reference/type-aliases/CreateMutationOptions" + "label": "Types / ThrowOnError", + "to": "framework/react/reference/type-aliases/ThrowOnError" }, { - "label": "Types / CreateMutationResult", - "to": "framework/svelte/reference/type-aliases/CreateMutationResult" + "label": "Types / TimeoutCallback", + "to": "framework/react/reference/type-aliases/TimeoutCallback" }, { - "label": "Types / CreateQueryOptions", - "to": "framework/svelte/reference/type-aliases/CreateQueryOptions" + "label": "Types / TimeoutProvider", + "to": "framework/react/reference/type-aliases/TimeoutProvider" }, { - "label": "Types / CreateQueryResult", - "to": "framework/svelte/reference/type-aliases/CreateQueryResult" + "label": "Types / UndefinedInitialDataInfiniteOptions", + "to": "framework/react/reference/type-aliases/UndefinedInitialDataInfiniteOptions" }, { - "label": "Types / DefinedCreateBaseQueryResult", - "to": "framework/svelte/reference/type-aliases/DefinedCreateBaseQueryResult" + "label": "Types / UndefinedInitialDataOptions", + "to": "framework/react/reference/type-aliases/UndefinedInitialDataOptions" }, { - "label": "Types / DefinedCreateQueryResult", - "to": "framework/svelte/reference/type-aliases/DefinedCreateQueryResult" + "label": "Types / UnsetMarker", + "to": "framework/react/reference/type-aliases/UnsetMarker" }, { - "label": "Types / DefinedInitialDataOptions", - "to": "framework/svelte/reference/type-aliases/DefinedInitialDataOptions" + "label": "Types / UnusedSkipTokenInfiniteOptions", + "to": "framework/react/reference/type-aliases/UnusedSkipTokenInfiniteOptions" }, { - "label": "Types / HydrationBoundary", - "to": "framework/svelte/reference/type-aliases/HydrationBoundary" + "label": "Types / UnusedSkipTokenOptions", + "to": "framework/react/reference/type-aliases/UnusedSkipTokenOptions" }, { - "label": "Types / MutationStateOptions", - "to": "framework/svelte/reference/type-aliases/MutationStateOptions" + "label": "Types / Updater", + "to": "framework/react/reference/type-aliases/Updater" }, { - "label": "Types / MutationTypeFromResult", - "to": "framework/svelte/reference/type-aliases/MutationTypeFromResult" + "label": "Types / UseBaseMutationResult", + "to": "framework/react/reference/type-aliases/UseBaseMutationResult" }, { - "label": "Types / QueriesOptions", - "to": "framework/svelte/reference/type-aliases/QueriesOptions" + "label": "Types / UseBaseQueryResult", + "to": "framework/react/reference/type-aliases/UseBaseQueryResult" }, { - "label": "Types / QueriesResults", - "to": "framework/svelte/reference/type-aliases/QueriesResults" + "label": "Types / UseInfiniteQueryResult", + "to": "framework/react/reference/type-aliases/UseInfiniteQueryResult" }, { - "label": "Types / QueryClientProviderProps", - "to": "framework/svelte/reference/type-aliases/QueryClientProviderProps" + "label": "Types / UseMutateAsyncFunction", + "to": "framework/react/reference/type-aliases/UseMutateAsyncFunction" }, { - "label": "Types / UndefinedInitialDataOptions", - "to": "framework/svelte/reference/type-aliases/UndefinedInitialDataOptions" + "label": "Types / UseMutateFunction", + "to": "framework/react/reference/type-aliases/UseMutateFunction" }, { - "label": "Variables / HydrationBoundary", - "to": "framework/svelte/reference/variables/HydrationBoundary" + "label": "Types / UseMutationResult", + "to": "framework/react/reference/type-aliases/UseMutationResult" + }, + { + "label": "Types / UsePrefetchInfiniteQueryOptions", + "to": "framework/react/reference/type-aliases/UsePrefetchInfiniteQueryOptions" + }, + { + "label": "Types / UsePrefetchQueryOptions", + "to": "framework/react/reference/type-aliases/UsePrefetchQueryOptions" + }, + { + "label": "Types / UseQueryResult", + "to": "framework/react/reference/type-aliases/UseQueryResult" + }, + { + "label": "Types / UseSuspenseInfiniteQueryResult", + "to": "framework/react/reference/type-aliases/UseSuspenseInfiniteQueryResult" + }, + { + "label": "Types / UseSuspenseQueryResult", + "to": "framework/react/reference/type-aliases/UseSuspenseQueryResult" + }, + { + "label": "Types / WithRequired", + "to": "framework/react/reference/type-aliases/WithRequired" + }, + { + "label": "Types / dataTagErrorSymbol", + "to": "framework/react/reference/type-aliases/dataTagErrorSymbol" + }, + { + "label": "Types / dataTagSymbol", + "to": "framework/react/reference/type-aliases/dataTagSymbol" + }, + { + "label": "Variables / IsRestoringProvider", + "to": "framework/react/reference/variables/IsRestoringProvider" + }, + { + "label": "Variables / QueryClientContext", + "to": "framework/react/reference/variables/QueryClientContext" + }, + { + "label": "Variables / dataTagErrorSymbol", + "to": "framework/react/reference/variables/dataTagErrorSymbol" + }, + { + "label": "Variables / dataTagSymbol", + "to": "framework/react/reference/variables/dataTagSymbol" + }, + { + "label": "Variables / defaultScheduler", + "to": "framework/react/reference/variables/defaultScheduler" + }, + { + "label": "Variables / environmentManager", + "to": "framework/react/reference/variables/environmentManager" + }, + { + "label": "Variables / focusManager", + "to": "framework/react/reference/variables/focusManager" + }, + { + "label": "Variables / isServer", + "to": "framework/react/reference/variables/isServer" + }, + { + "label": "Variables / notifyManager", + "to": "framework/react/reference/variables/notifyManager" + }, + { + "label": "Variables / onlineManager", + "to": "framework/react/reference/variables/onlineManager" + }, + { + "label": "Variables / skipToken", + "to": "framework/react/reference/variables/skipToken" + }, + { + "label": "Variables / timeoutManager", + "to": "framework/react/reference/variables/timeoutManager" + }, + { + "label": "Variables / unsetMarker", + "to": "framework/react/reference/variables/unsetMarker" } ] }, { - "label": "lit", + "label": "vue", "children": [ { - "label": "Lit Reference", - "to": "framework/lit/reference/index" + "label": "Vue Reference", + "to": "framework/vue/reference/index" }, { - "label": "Classes / QueryClientProvider", - "to": "framework/lit/reference/classes/QueryClientProvider" + "label": "Functions / defaultShouldDehydrateMutation", + "to": "framework/vue/reference/functions/defaultShouldDehydrateMutation" }, { - "label": "Functions / createQueryController", - "to": "framework/lit/reference/functions/createQueryController" + "label": "Functions / defaultShouldDehydrateQuery", + "to": "framework/vue/reference/functions/defaultShouldDehydrateQuery" }, { - "label": "Functions / createQueriesController", - "to": "framework/lit/reference/functions/createQueriesController" + "label": "Functions / dehydrate", + "to": "framework/vue/reference/functions/dehydrate" }, { - "label": "Functions / createInfiniteQueryController", - "to": "framework/lit/reference/functions/createInfiniteQueryController" + "label": "Functions / dehydrateQuery", + "to": "framework/vue/reference/functions/dehydrateQuery" }, { - "label": "Functions / createMutationController", - "to": "framework/lit/reference/functions/createMutationController" + "label": "Functions / experimental_streamedQuery", + "to": "framework/vue/reference/functions/experimental_streamedQuery" }, { - "label": "Functions / useIsFetching", - "to": "framework/lit/reference/functions/useIsFetching" + "label": "Functions / hashKey", + "to": "framework/vue/reference/functions/hashKey" }, { - "label": "Functions / useIsMutating", - "to": "framework/lit/reference/functions/useIsMutating" + "label": "Functions / hydrate", + "to": "framework/vue/reference/functions/hydrate" }, { - "label": "Functions / useMutationState", - "to": "framework/lit/reference/functions/useMutationState" + "label": "Functions / infiniteQueryOptions", + "to": "framework/vue/reference/functions/infiniteQueryOptions" }, { - "label": "Functions / useQueryClient", - "to": "framework/lit/reference/functions/useQueryClient" + "label": "Functions / isCancelledError", + "to": "framework/vue/reference/functions/isCancelledError" }, { - "label": "Functions / queryOptions", - "to": "framework/lit/reference/functions/queryOptions" + "label": "Functions / keepPreviousData", + "to": "framework/vue/reference/functions/keepPreviousData" }, { - "label": "Functions / infiniteQueryOptions", - "to": "framework/lit/reference/functions/infiniteQueryOptions" + "label": "Functions / matchMutation", + "to": "framework/vue/reference/functions/matchMutation" + }, + { + "label": "Functions / matchQuery", + "to": "framework/vue/reference/functions/matchQuery" }, { "label": "Functions / mutationOptions", - "to": "framework/lit/reference/functions/mutationOptions" + "to": "framework/vue/reference/functions/mutationOptions" }, { - "label": "Context / queryClientContext", - "to": "framework/lit/reference/variables/queryClientContext" + "label": "Functions / noop", + "to": "framework/vue/reference/functions/noop" }, { - "label": "Context / getDefaultQueryClient", - "to": "framework/lit/reference/functions/getDefaultQueryClient" + "label": "Functions / partialMatchKey", + "to": "framework/vue/reference/functions/partialMatchKey" }, { - "label": "Context / registerDefaultQueryClient", - "to": "framework/lit/reference/functions/registerDefaultQueryClient" + "label": "Functions / queryOptions", + "to": "framework/vue/reference/functions/queryOptions" }, { - "label": "Context / unregisterDefaultQueryClient", - "to": "framework/lit/reference/functions/unregisterDefaultQueryClient" + "label": "Functions / replaceEqualDeep", + "to": "framework/vue/reference/functions/replaceEqualDeep" }, { - "label": "Context / resolveQueryClient", - "to": "framework/lit/reference/functions/resolveQueryClient" + "label": "Functions / shouldThrowError", + "to": "framework/vue/reference/functions/shouldThrowError" }, { - "label": "Types / Accessor", - "to": "framework/lit/reference/type-aliases/Accessor" + "label": "Functions / useInfiniteQuery", + "to": "framework/vue/reference/functions/useInfiniteQuery" }, { - "label": "Types / CreateInfiniteQueryOptions", - "to": "framework/lit/reference/type-aliases/CreateInfiniteQueryOptions" + "label": "Functions / useIsFetching", + "to": "framework/vue/reference/functions/useIsFetching" }, { - "label": "Types / CreateMutationOptions", - "to": "framework/lit/reference/type-aliases/CreateMutationOptions" + "label": "Functions / useIsMutating", + "to": "framework/vue/reference/functions/useIsMutating" }, { - "label": "Types / CreateQueriesControllerOptions", - "to": "framework/lit/reference/type-aliases/CreateQueriesControllerOptions" + "label": "Functions / useMutation", + "to": "framework/vue/reference/functions/useMutation" }, { - "label": "Types / CreateQueriesInput", - "to": "framework/lit/reference/type-aliases/CreateQueriesInput" + "label": "Functions / useMutationState", + "to": "framework/vue/reference/functions/useMutationState" }, { - "label": "Types / CreateQueryOptions", - "to": "framework/lit/reference/type-aliases/CreateQueryOptions" + "label": "Functions / usePrefetchInfiniteQuery", + "to": "framework/vue/reference/functions/usePrefetchInfiniteQuery" }, { - "label": "Types / DefinedInitialDataOptions", - "to": "framework/lit/reference/type-aliases/DefinedInitialDataOptions" + "label": "Functions / usePrefetchQuery", + "to": "framework/vue/reference/functions/usePrefetchQuery" }, { - "label": "Types / InfiniteQueryControllerOptions", - "to": "framework/lit/reference/type-aliases/InfiniteQueryControllerOptions" + "label": "Functions / useQueries", + "to": "framework/vue/reference/functions/useQueries" }, { - "label": "Types / InfiniteQueryResultAccessor", - "to": "framework/lit/reference/type-aliases/InfiniteQueryResultAccessor" + "label": "Functions / useQuery", + "to": "framework/vue/reference/functions/useQuery" }, { - "label": "Types / IsFetchingAccessor", - "to": "framework/lit/reference/type-aliases/IsFetchingAccessor" + "label": "Functions / useQueryClient", + "to": "framework/vue/reference/functions/useQueryClient" }, { - "label": "Types / IsMutatingAccessor", - "to": "framework/lit/reference/type-aliases/IsMutatingAccessor" + "label": "Classes / CancelledError", + "to": "framework/vue/reference/classes/CancelledError" }, { - "label": "Types / MutationControllerOptions", - "to": "framework/lit/reference/type-aliases/MutationControllerOptions" + "label": "Classes / InfiniteQueryObserver", + "to": "framework/vue/reference/classes/InfiniteQueryObserver" }, { - "label": "Types / MutationControllerResult", - "to": "framework/lit/reference/type-aliases/MutationControllerResult" + "label": "Classes / Mutation", + "to": "framework/vue/reference/classes/Mutation" }, { - "label": "Types / MutationResultAccessor", - "to": "framework/lit/reference/type-aliases/MutationResultAccessor" + "label": "Classes / MutationCache", + "to": "framework/vue/reference/classes/MutationCache" }, { - "label": "Types / MutationStateAccessor", - "to": "framework/lit/reference/type-aliases/MutationStateAccessor" + "label": "Classes / MutationObserver", + "to": "framework/vue/reference/classes/MutationObserver" }, { - "label": "Types / MutationStateOptions", - "to": "framework/lit/reference/type-aliases/MutationStateOptions" + "label": "Classes / QueriesObserver", + "to": "framework/vue/reference/classes/QueriesObserver" }, { - "label": "Types / QueriesControllerOptions", - "to": "framework/lit/reference/type-aliases/QueriesControllerOptions" + "label": "Classes / Query", + "to": "framework/vue/reference/classes/Query" }, { - "label": "Types / QueriesResultAccessor", - "to": "framework/lit/reference/type-aliases/QueriesResultAccessor" + "label": "Classes / QueryCache", + "to": "framework/vue/reference/classes/QueryCache" }, { - "label": "Types / QueryControllerOptions", - "to": "framework/lit/reference/type-aliases/QueryControllerOptions" + "label": "Classes / QueryClient", + "to": "framework/vue/reference/classes/QueryClient" }, { - "label": "Types / QueryControllerResult", - "to": "framework/lit/reference/type-aliases/QueryControllerResult" + "label": "Classes / QueryObserver", + "to": "framework/vue/reference/classes/QueryObserver" }, { - "label": "Types / QueryResultAccessor", - "to": "framework/lit/reference/type-aliases/QueryResultAccessor" + "label": "Interfaces / CancelOptions", + "to": "framework/vue/reference/interfaces/CancelOptions" }, { - "label": "Types / UndefinedInitialDataOptions", - "to": "framework/lit/reference/type-aliases/UndefinedInitialDataOptions" + "label": "Interfaces / DefaultOptions", + "to": "framework/vue/reference/interfaces/DefaultOptions" }, { - "label": "Types / UnusedSkipTokenOptions", - "to": "framework/lit/reference/type-aliases/UnusedSkipTokenOptions" + "label": "Interfaces / DehydrateOptions", + "to": "framework/vue/reference/interfaces/DehydrateOptions" }, { - "label": "Types / ValueAccessor", - "to": "framework/lit/reference/type-aliases/ValueAccessor" - } - ] - }, - { - "label": "angular", - "children": [ + "label": "Interfaces / DehydratedState", + "to": "framework/vue/reference/interfaces/DehydratedState" + }, { - "label": "Angular Reference", - "to": "framework/angular/reference/index" + "label": "Interfaces / EnsureQueryDataOptions", + "to": "framework/vue/reference/interfaces/EnsureQueryDataOptions" }, { - "label": "Functions / infiniteQueryOptions", - "to": "framework/angular/reference/functions/infiniteQueryOptions" + "label": "Interfaces / FetchNextPageOptions", + "to": "framework/vue/reference/interfaces/FetchNextPageOptions" }, { - "label": "Functions / injectInfiniteQuery", - "to": "framework/angular/reference/functions/injectInfiniteQuery" + "label": "Interfaces / FetchPreviousPageOptions", + "to": "framework/vue/reference/interfaces/FetchPreviousPageOptions" }, { - "label": "Functions / injectIsFetching", - "to": "framework/angular/reference/functions/injectIsFetching" + "label": "Interfaces / FetchQueryOptions", + "to": "framework/vue/reference/interfaces/FetchQueryOptions" }, { - "label": "Functions / injectIsMutating", - "to": "framework/angular/reference/functions/injectIsMutating" + "label": "Interfaces / HydrateOptions", + "to": "framework/vue/reference/interfaces/HydrateOptions" }, { - "label": "Functions / injectIsRestoring", - "to": "framework/angular/reference/functions/injectIsRestoring" + "label": "Interfaces / InfiniteData", + "to": "framework/vue/reference/interfaces/InfiniteData" }, { - "label": "Functions / injectMutation", - "to": "framework/angular/reference/functions/injectMutation" + "label": "Interfaces / InfiniteQueryObserverBaseResult", + "to": "framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult" }, { - "label": "Functions / injectMutationState", - "to": "framework/angular/reference/functions/injectMutationState" + "label": "Interfaces / InfiniteQueryObserverLoadingErrorResult", + "to": "framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult" }, { - "label": "Functions / injectQuery", - "to": "framework/angular/reference/functions/injectQuery" + "label": "Interfaces / InfiniteQueryObserverLoadingResult", + "to": "framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult" }, { - "label": "Functions / mutationOptions", - "to": "framework/angular/reference/functions/mutationOptions" + "label": "Interfaces / InfiniteQueryObserverOptions", + "to": "framework/vue/reference/interfaces/InfiniteQueryObserverOptions" }, { - "label": "Functions / provideIsRestoring", - "to": "framework/angular/reference/functions/provideIsRestoring" + "label": "Interfaces / InfiniteQueryObserverPendingResult", + "to": "framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult" }, { - "label": "Functions / provideQueryClient", - "to": "framework/angular/reference/functions/provideQueryClient" + "label": "Interfaces / InfiniteQueryObserverPlaceholderResult", + "to": "framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult" }, { - "label": "Functions / provideTanStackQuery", - "to": "framework/angular/reference/functions/provideTanStackQuery" + "label": "Interfaces / InfiniteQueryObserverRefetchErrorResult", + "to": "framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult" }, { - "label": "Functions / queryFeature", - "to": "framework/angular/reference/functions/queryFeature" + "label": "Interfaces / InfiniteQueryObserverSuccessResult", + "to": "framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult" }, { - "label": "Functions / queryOptions", - "to": "framework/angular/reference/functions/queryOptions" + "label": "Interfaces / InfiniteQueryPageParamsOptions", + "to": "framework/vue/reference/interfaces/InfiniteQueryPageParamsOptions" }, { - "label": "Functions / injectQueryClient", - "to": "framework/angular/reference/functions/injectQueryClient" + "label": "Interfaces / InitialPageParam", + "to": "framework/vue/reference/interfaces/InitialPageParam" }, { - "label": "Functions / provideAngularQuery", - "to": "framework/angular/reference/functions/provideAngularQuery" + "label": "Interfaces / InvalidateOptions", + "to": "framework/vue/reference/interfaces/InvalidateOptions" }, { - "label": "Interfaces / BaseMutationNarrowing", - "to": "framework/angular/reference/interfaces/BaseMutationNarrowing" + "label": "Interfaces / InvalidateQueryFilters", + "to": "framework/vue/reference/interfaces/InvalidateQueryFilters" }, { - "label": "Interfaces / BaseQueryNarrowing", - "to": "framework/angular/reference/interfaces/BaseQueryNarrowing" + "label": "Interfaces / MutateOptions", + "to": "framework/vue/reference/interfaces/MutateOptions" }, { - "label": "Interfaces / CreateBaseQueryOptions", - "to": "framework/angular/reference/interfaces/CreateBaseQueryOptions" + "label": "Interfaces / MutationCacheConfig", + "to": "framework/vue/reference/interfaces/MutationCacheConfig" }, { - "label": "Interfaces / CreateInfiniteQueryOptions", - "to": "framework/angular/reference/interfaces/CreateInfiniteQueryOptions" + "label": "Interfaces / MutationObserverBaseResult", + "to": "framework/vue/reference/interfaces/MutationObserverBaseResult" }, { - "label": "Interfaces / CreateMutationOptions", - "to": "framework/angular/reference/interfaces/CreateMutationOptions" + "label": "Interfaces / MutationObserverErrorResult", + "to": "framework/vue/reference/interfaces/MutationObserverErrorResult" }, { - "label": "Interfaces / CreateQueryOptions", - "to": "framework/angular/reference/interfaces/CreateQueryOptions" + "label": "Interfaces / MutationObserverIdleResult", + "to": "framework/vue/reference/interfaces/MutationObserverIdleResult" }, { - "label": "Interfaces / InjectInfiniteQueryOptions", - "to": "framework/angular/reference/interfaces/InjectInfiniteQueryOptions" + "label": "Interfaces / MutationObserverLoadingResult", + "to": "framework/vue/reference/interfaces/MutationObserverLoadingResult" + }, + { + "label": "Interfaces / MutationObserverOptions", + "to": "framework/vue/reference/interfaces/MutationObserverOptions" + }, + { + "label": "Interfaces / MutationObserverSuccessResult", + "to": "framework/vue/reference/interfaces/MutationObserverSuccessResult" + }, + { + "label": "Interfaces / MutationState", + "to": "framework/vue/reference/interfaces/MutationState" + }, + { + "label": "Interfaces / NotifyEvent", + "to": "framework/vue/reference/interfaces/NotifyEvent" + }, + { + "label": "Interfaces / QueriesObserverOptions", + "to": "framework/vue/reference/interfaces/QueriesObserverOptions" + }, + { + "label": "Interfaces / QueryCacheConfig", + "to": "framework/vue/reference/interfaces/QueryCacheConfig" + }, + { + "label": "Interfaces / QueryClientConfig", + "to": "framework/vue/reference/interfaces/QueryClientConfig" + }, + { + "label": "Interfaces / QueryExecuteOptions", + "to": "framework/vue/reference/interfaces/QueryExecuteOptions" + }, + { + "label": "Interfaces / QueryObserverBaseResult", + "to": "framework/vue/reference/interfaces/QueryObserverBaseResult" + }, + { + "label": "Interfaces / QueryObserverLoadingErrorResult", + "to": "framework/vue/reference/interfaces/QueryObserverLoadingErrorResult" + }, + { + "label": "Interfaces / QueryObserverLoadingResult", + "to": "framework/vue/reference/interfaces/QueryObserverLoadingResult" + }, + { + "label": "Interfaces / QueryObserverOptions", + "to": "framework/vue/reference/interfaces/QueryObserverOptions" + }, + { + "label": "Interfaces / QueryObserverPendingResult", + "to": "framework/vue/reference/interfaces/QueryObserverPendingResult" + }, + { + "label": "Interfaces / QueryObserverPlaceholderResult", + "to": "framework/vue/reference/interfaces/QueryObserverPlaceholderResult" + }, + { + "label": "Interfaces / QueryObserverRefetchErrorResult", + "to": "framework/vue/reference/interfaces/QueryObserverRefetchErrorResult" + }, + { + "label": "Interfaces / QueryObserverSuccessResult", + "to": "framework/vue/reference/interfaces/QueryObserverSuccessResult" + }, + { + "label": "Interfaces / QueryState", + "to": "framework/vue/reference/interfaces/QueryState" + }, + { + "label": "Interfaces / RefetchOptions", + "to": "framework/vue/reference/interfaces/RefetchOptions" + }, + { + "label": "Interfaces / RefetchQueryFilters", + "to": "framework/vue/reference/interfaces/RefetchQueryFilters" + }, + { + "label": "Interfaces / Register", + "to": "framework/vue/reference/interfaces/Register" + }, + { + "label": "Interfaces / ResetOptions", + "to": "framework/vue/reference/interfaces/ResetOptions" + }, + { + "label": "Interfaces / ResultOptions", + "to": "framework/vue/reference/interfaces/ResultOptions" + }, + { + "label": "Interfaces / SetDataOptions", + "to": "framework/vue/reference/interfaces/SetDataOptions" + }, + { + "label": "Types / AnyDataTag", + "to": "framework/vue/reference/type-aliases/AnyDataTag" + }, + { + "label": "Types / DataTag", + "to": "framework/vue/reference/type-aliases/DataTag" + }, + { + "label": "Types / DefaultError", + "to": "framework/vue/reference/type-aliases/DefaultError" + }, + { + "label": "Types / DefaultedInfiniteQueryObserverOptions", + "to": "framework/vue/reference/type-aliases/DefaultedInfiniteQueryObserverOptions" + }, + { + "label": "Types / DefaultedQueryObserverOptions", + "to": "framework/vue/reference/type-aliases/DefaultedQueryObserverOptions" + }, + { + "label": "Types / DefinedInfiniteQueryObserverResult", + "to": "framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult" + }, + { + "label": "Types / DefinedInitialDataInfiniteOptions", + "to": "framework/vue/reference/type-aliases/DefinedInitialDataInfiniteOptions" + }, + { + "label": "Types / DefinedInitialQueryOptions", + "to": "framework/vue/reference/type-aliases/DefinedInitialQueryOptions" + }, + { + "label": "Types / DefinedInitialQueryOptionsWithDataTag", + "to": "framework/vue/reference/type-aliases/DefinedInitialQueryOptionsWithDataTag" + }, + { + "label": "Types / DefinedQueryObserverResult", + "to": "framework/vue/reference/type-aliases/DefinedQueryObserverResult" + }, + { + "label": "Types / DistributiveOmit", + "to": "framework/vue/reference/type-aliases/DistributiveOmit" + }, + { + "label": "Types / EnsureInfiniteQueryDataOptions", + "to": "framework/vue/reference/type-aliases/EnsureInfiniteQueryDataOptions" + }, + { + "label": "Types / FetchInfiniteQueryOptions", + "to": "framework/vue/reference/type-aliases/FetchInfiniteQueryOptions" + }, + { + "label": "Types / FetchStatus", + "to": "framework/vue/reference/type-aliases/FetchStatus" + }, + { + "label": "Types / GetNextPageParamFunction", + "to": "framework/vue/reference/type-aliases/GetNextPageParamFunction" + }, + { + "label": "Types / GetPreviousPageParamFunction", + "to": "framework/vue/reference/type-aliases/GetPreviousPageParamFunction" + }, + { + "label": "Types / InferDataFromTag", + "to": "framework/vue/reference/type-aliases/InferDataFromTag" + }, + { + "label": "Types / InferErrorFromTag", + "to": "framework/vue/reference/type-aliases/InferErrorFromTag" + }, + { + "label": "Types / InfiniteQueryExecuteOptions", + "to": "framework/vue/reference/type-aliases/InfiniteQueryExecuteOptions" + }, + { + "label": "Types / InfiniteQueryObserverResult", + "to": "framework/vue/reference/type-aliases/InfiniteQueryObserverResult" + }, + { + "label": "Types / InitialDataFunction", + "to": "framework/vue/reference/type-aliases/InitialDataFunction" + }, + { + "label": "Types / ManagedTimerId", + "to": "framework/vue/reference/type-aliases/ManagedTimerId" + }, + { + "label": "Types / MutateFunction", + "to": "framework/vue/reference/type-aliases/MutateFunction" + }, + { + "label": "Types / MutateFunctionRest", + "to": "framework/vue/reference/type-aliases/MutateFunctionRest" + }, + { + "label": "Types / MutationCacheNotifyEvent", + "to": "framework/vue/reference/type-aliases/MutationCacheNotifyEvent" + }, + { + "label": "Types / MutationFilters", + "to": "framework/vue/reference/type-aliases/MutationFilters" + }, + { + "label": "Types / MutationFunction", + "to": "framework/vue/reference/type-aliases/MutationFunction" + }, + { + "label": "Types / MutationFunctionContext", + "to": "framework/vue/reference/type-aliases/MutationFunctionContext" + }, + { + "label": "Types / MutationKey", + "to": "framework/vue/reference/type-aliases/MutationKey" + }, + { + "label": "Types / MutationMeta", + "to": "framework/vue/reference/type-aliases/MutationMeta" + }, + { + "label": "Types / MutationObserverResult", + "to": "framework/vue/reference/type-aliases/MutationObserverResult" + }, + { + "label": "Types / MutationOptions", + "to": "framework/vue/reference/type-aliases/MutationOptions" + }, + { + "label": "Types / MutationScope", + "to": "framework/vue/reference/type-aliases/MutationScope" + }, + { + "label": "Types / MutationStateOptions", + "to": "framework/vue/reference/type-aliases/MutationStateOptions" + }, + { + "label": "Types / MutationStatus", + "to": "framework/vue/reference/type-aliases/MutationStatus" + }, + { + "label": "Types / NetworkMode", + "to": "framework/vue/reference/type-aliases/NetworkMode" + }, + { + "label": "Types / NonUndefinedGuard", + "to": "framework/vue/reference/type-aliases/NonUndefinedGuard" + }, + { + "label": "Types / NotifyEventType", + "to": "framework/vue/reference/type-aliases/NotifyEventType" + }, + { + "label": "Types / NotifyOnChangeProps", + "to": "framework/vue/reference/type-aliases/NotifyOnChangeProps" + }, + { + "label": "Types / OmitKeyof", + "to": "framework/vue/reference/type-aliases/OmitKeyof" + }, + { + "label": "Types / Override", + "to": "framework/vue/reference/type-aliases/Override" + }, + { + "label": "Types / PlaceholderDataFunction", + "to": "framework/vue/reference/type-aliases/PlaceholderDataFunction" + }, + { + "label": "Types / QueriesPlaceholderDataFunction", + "to": "framework/vue/reference/type-aliases/QueriesPlaceholderDataFunction" + }, + { + "label": "Types / QueryBooleanOption", + "to": "framework/vue/reference/type-aliases/QueryBooleanOption" + }, + { + "label": "Types / QueryCacheNotifyEvent", + "to": "framework/vue/reference/type-aliases/QueryCacheNotifyEvent" + }, + { + "label": "Types / QueryFilters", + "to": "framework/vue/reference/type-aliases/QueryFilters" + }, + { + "label": "Types / QueryFunction", + "to": "framework/vue/reference/type-aliases/QueryFunction" + }, + { + "label": "Types / QueryFunctionContext", + "to": "framework/vue/reference/type-aliases/QueryFunctionContext" + }, + { + "label": "Types / QueryKey", + "to": "framework/vue/reference/type-aliases/QueryKey" + }, + { + "label": "Types / QueryKeyHashFunction", + "to": "framework/vue/reference/type-aliases/QueryKeyHashFunction" + }, + { + "label": "Types / QueryKeyWithDataTag", + "to": "framework/vue/reference/type-aliases/QueryKeyWithDataTag" + }, + { + "label": "Types / QueryMeta", + "to": "framework/vue/reference/type-aliases/QueryMeta" + }, + { + "label": "Types / QueryObserverResult", + "to": "framework/vue/reference/type-aliases/QueryObserverResult" + }, + { + "label": "Types / QueryOptions", + "to": "framework/vue/reference/type-aliases/QueryOptions" + }, + { + "label": "Types / QueryPersister", + "to": "framework/vue/reference/type-aliases/QueryPersister" + }, + { + "label": "Types / QueryStatus", + "to": "framework/vue/reference/type-aliases/QueryStatus" + }, + { + "label": "Types / SkipToken", + "to": "framework/vue/reference/type-aliases/SkipToken" + }, + { + "label": "Types / StaleTime", + "to": "framework/vue/reference/type-aliases/StaleTime" + }, + { + "label": "Types / StaleTimeFunction", + "to": "framework/vue/reference/type-aliases/StaleTimeFunction" + }, + { + "label": "Types / ThrowOnError", + "to": "framework/vue/reference/type-aliases/ThrowOnError" + }, + { + "label": "Types / TimeoutCallback", + "to": "framework/vue/reference/type-aliases/TimeoutCallback" + }, + { + "label": "Types / TimeoutProvider", + "to": "framework/vue/reference/type-aliases/TimeoutProvider" + }, + { + "label": "Types / UndefinedInitialDataInfiniteOptions", + "to": "framework/vue/reference/type-aliases/UndefinedInitialDataInfiniteOptions" + }, + { + "label": "Types / UndefinedInitialQueryOptions", + "to": "framework/vue/reference/type-aliases/UndefinedInitialQueryOptions" + }, + { + "label": "Types / UndefinedInitialQueryOptionsWithDataTag", + "to": "framework/vue/reference/type-aliases/UndefinedInitialQueryOptionsWithDataTag" + }, + { + "label": "Types / UnsetMarker", + "to": "framework/vue/reference/type-aliases/UnsetMarker" + }, + { + "label": "Types / Updater", + "to": "framework/vue/reference/type-aliases/Updater" + }, + { + "label": "Types / UseInfiniteQueryOptions", + "to": "framework/vue/reference/type-aliases/UseInfiniteQueryOptions" + }, + { + "label": "Types / UseInfiniteQueryReturnType", + "to": "framework/vue/reference/type-aliases/UseInfiniteQueryReturnType" + }, + { + "label": "Types / UseMutationOptions", + "to": "framework/vue/reference/type-aliases/UseMutationOptions" + }, + { + "label": "Types / UseMutationReturnType", + "to": "framework/vue/reference/type-aliases/UseMutationReturnType" + }, + { + "label": "Types / UsePrefetchInfiniteQueryOptions", + "to": "framework/vue/reference/type-aliases/UsePrefetchInfiniteQueryOptions" + }, + { + "label": "Types / UsePrefetchQueryOptions", + "to": "framework/vue/reference/type-aliases/UsePrefetchQueryOptions" + }, + { + "label": "Types / UseQueriesOptions", + "to": "framework/vue/reference/type-aliases/UseQueriesOptions" + }, + { + "label": "Types / UseQueriesResults", + "to": "framework/vue/reference/type-aliases/UseQueriesResults" + }, + { + "label": "Types / UseQueryDefinedReturnType", + "to": "framework/vue/reference/type-aliases/UseQueryDefinedReturnType" + }, + { + "label": "Types / UseQueryOptions", + "to": "framework/vue/reference/type-aliases/UseQueryOptions" + }, + { + "label": "Types / UseQueryReturnType", + "to": "framework/vue/reference/type-aliases/UseQueryReturnType" + }, + { + "label": "Types / VueQueryPluginOptions", + "to": "framework/vue/reference/type-aliases/VueQueryPluginOptions" + }, + { + "label": "Types / WithRequired", + "to": "framework/vue/reference/type-aliases/WithRequired" + }, + { + "label": "Types / dataTagErrorSymbol", + "to": "framework/vue/reference/type-aliases/dataTagErrorSymbol" + }, + { + "label": "Types / dataTagSymbol", + "to": "framework/vue/reference/type-aliases/dataTagSymbol" + }, + { + "label": "Variables / VueQueryPlugin", + "to": "framework/vue/reference/variables/VueQueryPlugin" + }, + { + "label": "Variables / dataTagErrorSymbol", + "to": "framework/vue/reference/variables/dataTagErrorSymbol" + }, + { + "label": "Variables / dataTagSymbol", + "to": "framework/vue/reference/variables/dataTagSymbol" + }, + { + "label": "Variables / defaultScheduler", + "to": "framework/vue/reference/variables/defaultScheduler" + }, + { + "label": "Variables / environmentManager", + "to": "framework/vue/reference/variables/environmentManager" + }, + { + "label": "Variables / focusManager", + "to": "framework/vue/reference/variables/focusManager" + }, + { + "label": "Variables / isServer", + "to": "framework/vue/reference/variables/isServer" + }, + { + "label": "Variables / notifyManager", + "to": "framework/vue/reference/variables/notifyManager" + }, + { + "label": "Variables / onlineManager", + "to": "framework/vue/reference/variables/onlineManager" + }, + { + "label": "Variables / skipToken", + "to": "framework/vue/reference/variables/skipToken" + }, + { + "label": "Variables / timeoutManager", + "to": "framework/vue/reference/variables/timeoutManager" + }, + { + "label": "Variables / unsetMarker", + "to": "framework/vue/reference/variables/unsetMarker" + } + ] + }, + { + "label": "solid", + "children": [ + { + "label": "Solid Reference", + "to": "framework/solid/reference/index" + }, + { + "label": "Functions / QueryClientProvider", + "to": "framework/solid/reference/functions/QueryClientProvider" + }, + { + "label": "Functions / defaultShouldDehydrateMutation", + "to": "framework/solid/reference/functions/defaultShouldDehydrateMutation" + }, + { + "label": "Functions / defaultShouldDehydrateQuery", + "to": "framework/solid/reference/functions/defaultShouldDehydrateQuery" + }, + { + "label": "Functions / dehydrate", + "to": "framework/solid/reference/functions/dehydrate" + }, + { + "label": "Functions / dehydrateQuery", + "to": "framework/solid/reference/functions/dehydrateQuery" + }, + { + "label": "Functions / experimental_streamedQuery", + "to": "framework/solid/reference/functions/experimental_streamedQuery" + }, + { + "label": "Functions / hashKey", + "to": "framework/solid/reference/functions/hashKey" + }, + { + "label": "Functions / hydrate", + "to": "framework/solid/reference/functions/hydrate" + }, + { + "label": "Functions / infiniteQueryOptions", + "to": "framework/solid/reference/functions/infiniteQueryOptions" + }, + { + "label": "Functions / isCancelledError", + "to": "framework/solid/reference/functions/isCancelledError" + }, + { + "label": "Functions / keepPreviousData", + "to": "framework/solid/reference/functions/keepPreviousData" + }, + { + "label": "Functions / matchMutation", + "to": "framework/solid/reference/functions/matchMutation" + }, + { + "label": "Functions / matchQuery", + "to": "framework/solid/reference/functions/matchQuery" + }, + { + "label": "Functions / mutationOptions", + "to": "framework/solid/reference/functions/mutationOptions" + }, + { + "label": "Functions / noop", + "to": "framework/solid/reference/functions/noop" + }, + { + "label": "Functions / partialMatchKey", + "to": "framework/solid/reference/functions/partialMatchKey" + }, + { + "label": "Functions / queryOptions", + "to": "framework/solid/reference/functions/queryOptions" + }, + { + "label": "Functions / replaceEqualDeep", + "to": "framework/solid/reference/functions/replaceEqualDeep" + }, + { + "label": "Functions / shouldThrowError", + "to": "framework/solid/reference/functions/shouldThrowError" + }, + { + "label": "Functions / useInfiniteQuery", + "to": "framework/solid/reference/functions/useInfiniteQuery" + }, + { + "label": "Functions / useIsFetching", + "to": "framework/solid/reference/functions/useIsFetching" + }, + { + "label": "Functions / useIsMutating", + "to": "framework/solid/reference/functions/useIsMutating" + }, + { + "label": "Functions / useIsRestoring", + "to": "framework/solid/reference/functions/useIsRestoring" + }, + { + "label": "Functions / useMutation", + "to": "framework/solid/reference/functions/useMutation" + }, + { + "label": "Functions / useMutationState", + "to": "framework/solid/reference/functions/useMutationState" + }, + { + "label": "Functions / useQueries", + "to": "framework/solid/reference/functions/useQueries" + }, + { + "label": "Functions / useQuery", + "to": "framework/solid/reference/functions/useQuery" + }, + { + "label": "Functions / useQueryClient", + "to": "framework/solid/reference/functions/useQueryClient" + }, + { + "label": "Classes / CancelledError", + "to": "framework/solid/reference/classes/CancelledError" + }, + { + "label": "Classes / InfiniteQueryObserver", + "to": "framework/solid/reference/classes/InfiniteQueryObserver" + }, + { + "label": "Classes / Mutation", + "to": "framework/solid/reference/classes/Mutation" + }, + { + "label": "Classes / MutationCache", + "to": "framework/solid/reference/classes/MutationCache" + }, + { + "label": "Classes / MutationObserver", + "to": "framework/solid/reference/classes/MutationObserver" + }, + { + "label": "Classes / QueriesObserver", + "to": "framework/solid/reference/classes/QueriesObserver" + }, + { + "label": "Classes / Query", + "to": "framework/solid/reference/classes/Query" + }, + { + "label": "Classes / QueryCache", + "to": "framework/solid/reference/classes/QueryCache" + }, + { + "label": "Classes / QueryClient", + "to": "framework/solid/reference/classes/QueryClient" + }, + { + "label": "Classes / QueryObserver", + "to": "framework/solid/reference/classes/QueryObserver" + }, + { + "label": "Interfaces / CancelOptions", + "to": "framework/solid/reference/interfaces/CancelOptions" + }, + { + "label": "Interfaces / DefaultOptions", + "to": "framework/solid/reference/interfaces/DefaultOptions" + }, + { + "label": "Interfaces / DehydrateOptions", + "to": "framework/solid/reference/interfaces/DehydrateOptions" + }, + { + "label": "Interfaces / DehydratedState", + "to": "framework/solid/reference/interfaces/DehydratedState" + }, + { + "label": "Interfaces / EnsureQueryDataOptions", + "to": "framework/solid/reference/interfaces/EnsureQueryDataOptions" + }, + { + "label": "Interfaces / FetchNextPageOptions", + "to": "framework/solid/reference/interfaces/FetchNextPageOptions" + }, + { + "label": "Interfaces / FetchPreviousPageOptions", + "to": "framework/solid/reference/interfaces/FetchPreviousPageOptions" + }, + { + "label": "Interfaces / FetchQueryOptions", + "to": "framework/solid/reference/interfaces/FetchQueryOptions" + }, + { + "label": "Interfaces / HydrateOptions", + "to": "framework/solid/reference/interfaces/HydrateOptions" + }, + { + "label": "Interfaces / InfiniteData", + "to": "framework/solid/reference/interfaces/InfiniteData" + }, + { + "label": "Interfaces / InfiniteQueryObserverBaseResult", + "to": "framework/solid/reference/interfaces/InfiniteQueryObserverBaseResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverLoadingErrorResult", + "to": "framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverLoadingResult", + "to": "framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverOptions", + "to": "framework/solid/reference/interfaces/InfiniteQueryObserverOptions" + }, + { + "label": "Interfaces / InfiniteQueryObserverPendingResult", + "to": "framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverPlaceholderResult", + "to": "framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverRefetchErrorResult", + "to": "framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverSuccessResult", + "to": "framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult" + }, + { + "label": "Interfaces / InfiniteQueryOptions", + "to": "framework/solid/reference/interfaces/InfiniteQueryOptions" + }, + { + "label": "Interfaces / InfiniteQueryPageParamsOptions", + "to": "framework/solid/reference/interfaces/InfiniteQueryPageParamsOptions" + }, + { + "label": "Interfaces / InitialPageParam", + "to": "framework/solid/reference/interfaces/InitialPageParam" + }, + { + "label": "Interfaces / InvalidateOptions", + "to": "framework/solid/reference/interfaces/InvalidateOptions" + }, + { + "label": "Interfaces / InvalidateQueryFilters", + "to": "framework/solid/reference/interfaces/InvalidateQueryFilters" + }, + { + "label": "Interfaces / MutateOptions", + "to": "framework/solid/reference/interfaces/MutateOptions" + }, + { + "label": "Interfaces / MutationCacheConfig", + "to": "framework/solid/reference/interfaces/MutationCacheConfig" + }, + { + "label": "Interfaces / MutationFilters", + "to": "framework/solid/reference/interfaces/MutationFilters" + }, + { + "label": "Interfaces / MutationObserverBaseResult", + "to": "framework/solid/reference/interfaces/MutationObserverBaseResult" + }, + { + "label": "Interfaces / MutationObserverErrorResult", + "to": "framework/solid/reference/interfaces/MutationObserverErrorResult" + }, + { + "label": "Interfaces / MutationObserverIdleResult", + "to": "framework/solid/reference/interfaces/MutationObserverIdleResult" + }, + { + "label": "Interfaces / MutationObserverLoadingResult", + "to": "framework/solid/reference/interfaces/MutationObserverLoadingResult" + }, + { + "label": "Interfaces / MutationObserverOptions", + "to": "framework/solid/reference/interfaces/MutationObserverOptions" + }, + { + "label": "Interfaces / MutationObserverSuccessResult", + "to": "framework/solid/reference/interfaces/MutationObserverSuccessResult" + }, + { + "label": "Interfaces / MutationOptions", + "to": "framework/solid/reference/interfaces/MutationOptions" + }, + { + "label": "Interfaces / MutationState", + "to": "framework/solid/reference/interfaces/MutationState" + }, + { + "label": "Interfaces / NotifyEvent", + "to": "framework/solid/reference/interfaces/NotifyEvent" + }, + { + "label": "Interfaces / QueriesObserverOptions", + "to": "framework/solid/reference/interfaces/QueriesObserverOptions" + }, + { + "label": "Interfaces / QueryCacheConfig", + "to": "framework/solid/reference/interfaces/QueryCacheConfig" + }, + { + "label": "Interfaces / QueryClientConfig", + "to": "framework/solid/reference/interfaces/QueryClientConfig" + }, + { + "label": "Interfaces / QueryExecuteOptions", + "to": "framework/solid/reference/interfaces/QueryExecuteOptions" + }, + { + "label": "Interfaces / QueryFilters", + "to": "framework/solid/reference/interfaces/QueryFilters" + }, + { + "label": "Interfaces / QueryObserverBaseResult", + "to": "framework/solid/reference/interfaces/QueryObserverBaseResult" + }, + { + "label": "Interfaces / QueryObserverLoadingErrorResult", + "to": "framework/solid/reference/interfaces/QueryObserverLoadingErrorResult" + }, + { + "label": "Interfaces / QueryObserverLoadingResult", + "to": "framework/solid/reference/interfaces/QueryObserverLoadingResult" + }, + { + "label": "Interfaces / QueryObserverOptions", + "to": "framework/solid/reference/interfaces/QueryObserverOptions" + }, + { + "label": "Interfaces / QueryObserverPendingResult", + "to": "framework/solid/reference/interfaces/QueryObserverPendingResult" + }, + { + "label": "Interfaces / QueryObserverPlaceholderResult", + "to": "framework/solid/reference/interfaces/QueryObserverPlaceholderResult" + }, + { + "label": "Interfaces / QueryObserverRefetchErrorResult", + "to": "framework/solid/reference/interfaces/QueryObserverRefetchErrorResult" + }, + { + "label": "Interfaces / QueryObserverSuccessResult", + "to": "framework/solid/reference/interfaces/QueryObserverSuccessResult" + }, + { + "label": "Interfaces / QueryOptions", + "to": "framework/solid/reference/interfaces/QueryOptions" + }, + { + "label": "Interfaces / QueryState", + "to": "framework/solid/reference/interfaces/QueryState" + }, + { + "label": "Interfaces / RefetchOptions", + "to": "framework/solid/reference/interfaces/RefetchOptions" + }, + { + "label": "Interfaces / RefetchQueryFilters", + "to": "framework/solid/reference/interfaces/RefetchQueryFilters" + }, + { + "label": "Interfaces / Register", + "to": "framework/solid/reference/interfaces/Register" + }, + { + "label": "Interfaces / ResetOptions", + "to": "framework/solid/reference/interfaces/ResetOptions" + }, + { + "label": "Interfaces / ResultOptions", + "to": "framework/solid/reference/interfaces/ResultOptions" + }, + { + "label": "Interfaces / SetDataOptions", + "to": "framework/solid/reference/interfaces/SetDataOptions" + }, + { + "label": "Interfaces / UseBaseQueryOptions", + "to": "framework/solid/reference/interfaces/UseBaseQueryOptions" + }, + { + "label": "Types / AnyDataTag", + "to": "framework/solid/reference/type-aliases/AnyDataTag" + }, + { + "label": "Types / DataTag", + "to": "framework/solid/reference/type-aliases/DataTag" + }, + { + "label": "Types / DefaultError", + "to": "framework/solid/reference/type-aliases/DefaultError" + }, + { + "label": "Types / DefaultedInfiniteQueryObserverOptions", + "to": "framework/solid/reference/type-aliases/DefaultedInfiniteQueryObserverOptions" + }, + { + "label": "Types / DefaultedQueryObserverOptions", + "to": "framework/solid/reference/type-aliases/DefaultedQueryObserverOptions" + }, + { + "label": "Types / DefinedInfiniteQueryObserverResult", + "to": "framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult" + }, + { + "label": "Types / DefinedInitialDataInfiniteOptions", + "to": "framework/solid/reference/type-aliases/DefinedInitialDataInfiniteOptions" + }, + { + "label": "Types / DefinedInitialDataOptions", + "to": "framework/solid/reference/type-aliases/DefinedInitialDataOptions" + }, + { + "label": "Types / DefinedQueryObserverResult", + "to": "framework/solid/reference/type-aliases/DefinedQueryObserverResult" + }, + { + "label": "Types / DefinedUseBaseQueryResult", + "to": "framework/solid/reference/type-aliases/DefinedUseBaseQueryResult" + }, + { + "label": "Types / DefinedUseInfiniteQueryResult", + "to": "framework/solid/reference/type-aliases/DefinedUseInfiniteQueryResult" + }, + { + "label": "Types / DefinedUseQueryResult", + "to": "framework/solid/reference/type-aliases/DefinedUseQueryResult" + }, + { + "label": "Types / DistributiveOmit", + "to": "framework/solid/reference/type-aliases/DistributiveOmit" + }, + { + "label": "Types / EnsureInfiniteQueryDataOptions", + "to": "framework/solid/reference/type-aliases/EnsureInfiniteQueryDataOptions" + }, + { + "label": "Types / FetchInfiniteQueryOptions", + "to": "framework/solid/reference/type-aliases/FetchInfiniteQueryOptions" + }, + { + "label": "Types / FetchStatus", + "to": "framework/solid/reference/type-aliases/FetchStatus" + }, + { + "label": "Types / GetNextPageParamFunction", + "to": "framework/solid/reference/type-aliases/GetNextPageParamFunction" + }, + { + "label": "Types / GetPreviousPageParamFunction", + "to": "framework/solid/reference/type-aliases/GetPreviousPageParamFunction" + }, + { + "label": "Types / InferDataFromTag", + "to": "framework/solid/reference/type-aliases/InferDataFromTag" + }, + { + "label": "Types / InferErrorFromTag", + "to": "framework/solid/reference/type-aliases/InferErrorFromTag" + }, + { + "label": "Types / InfiniteQueryExecuteOptions", + "to": "framework/solid/reference/type-aliases/InfiniteQueryExecuteOptions" + }, + { + "label": "Types / InfiniteQueryObserverResult", + "to": "framework/solid/reference/type-aliases/InfiniteQueryObserverResult" + }, + { + "label": "Types / InitialDataFunction", + "to": "framework/solid/reference/type-aliases/InitialDataFunction" + }, + { + "label": "Types / ManagedTimerId", + "to": "framework/solid/reference/type-aliases/ManagedTimerId" + }, + { + "label": "Types / MutateFunction", + "to": "framework/solid/reference/type-aliases/MutateFunction" + }, + { + "label": "Types / MutateFunctionRest", + "to": "framework/solid/reference/type-aliases/MutateFunctionRest" + }, + { + "label": "Types / MutationCacheNotifyEvent", + "to": "framework/solid/reference/type-aliases/MutationCacheNotifyEvent" + }, + { + "label": "Types / MutationFunction", + "to": "framework/solid/reference/type-aliases/MutationFunction" + }, + { + "label": "Types / MutationFunctionContext", + "to": "framework/solid/reference/type-aliases/MutationFunctionContext" + }, + { + "label": "Types / MutationKey", + "to": "framework/solid/reference/type-aliases/MutationKey" + }, + { + "label": "Types / MutationMeta", + "to": "framework/solid/reference/type-aliases/MutationMeta" + }, + { + "label": "Types / MutationObserverResult", + "to": "framework/solid/reference/type-aliases/MutationObserverResult" + }, + { + "label": "Types / MutationScope", + "to": "framework/solid/reference/type-aliases/MutationScope" + }, + { + "label": "Types / MutationStatus", + "to": "framework/solid/reference/type-aliases/MutationStatus" + }, + { + "label": "Types / NetworkMode", + "to": "framework/solid/reference/type-aliases/NetworkMode" + }, + { + "label": "Types / NonUndefinedGuard", + "to": "framework/solid/reference/type-aliases/NonUndefinedGuard" + }, + { + "label": "Types / NotifyEventType", + "to": "framework/solid/reference/type-aliases/NotifyEventType" + }, + { + "label": "Types / NotifyOnChangeProps", + "to": "framework/solid/reference/type-aliases/NotifyOnChangeProps" + }, + { + "label": "Types / OmitKeyof", + "to": "framework/solid/reference/type-aliases/OmitKeyof" + }, + { + "label": "Types / Override", + "to": "framework/solid/reference/type-aliases/Override" + }, + { + "label": "Types / PlaceholderDataFunction", + "to": "framework/solid/reference/type-aliases/PlaceholderDataFunction" + }, + { + "label": "Types / QueriesPlaceholderDataFunction", + "to": "framework/solid/reference/type-aliases/QueriesPlaceholderDataFunction" + }, + { + "label": "Types / QueryBooleanOption", + "to": "framework/solid/reference/type-aliases/QueryBooleanOption" + }, + { + "label": "Types / QueryCacheNotifyEvent", + "to": "framework/solid/reference/type-aliases/QueryCacheNotifyEvent" + }, + { + "label": "Types / QueryClientProviderProps", + "to": "framework/solid/reference/type-aliases/QueryClientProviderProps" + }, + { + "label": "Types / QueryFunction", + "to": "framework/solid/reference/type-aliases/QueryFunction" + }, + { + "label": "Types / QueryFunctionContext", + "to": "framework/solid/reference/type-aliases/QueryFunctionContext" + }, + { + "label": "Types / QueryKey", + "to": "framework/solid/reference/type-aliases/QueryKey" + }, + { + "label": "Types / QueryKeyHashFunction", + "to": "framework/solid/reference/type-aliases/QueryKeyHashFunction" + }, + { + "label": "Types / QueryKeyWithDataTag", + "to": "framework/solid/reference/type-aliases/QueryKeyWithDataTag" + }, + { + "label": "Types / QueryMeta", + "to": "framework/solid/reference/type-aliases/QueryMeta" + }, + { + "label": "Types / QueryObserverResult", + "to": "framework/solid/reference/type-aliases/QueryObserverResult" + }, + { + "label": "Types / QueryPersister", + "to": "framework/solid/reference/type-aliases/QueryPersister" + }, + { + "label": "Types / QueryStatus", + "to": "framework/solid/reference/type-aliases/QueryStatus" + }, + { + "label": "Types / SkipToken", + "to": "framework/solid/reference/type-aliases/SkipToken" + }, + { + "label": "Types / StaleTime", + "to": "framework/solid/reference/type-aliases/StaleTime" + }, + { + "label": "Types / StaleTimeFunction", + "to": "framework/solid/reference/type-aliases/StaleTimeFunction" + }, + { + "label": "Types / ThrowOnError", + "to": "framework/solid/reference/type-aliases/ThrowOnError" + }, + { + "label": "Types / TimeoutCallback", + "to": "framework/solid/reference/type-aliases/TimeoutCallback" + }, + { + "label": "Types / TimeoutProvider", + "to": "framework/solid/reference/type-aliases/TimeoutProvider" + }, + { + "label": "Types / UndefinedInitialDataInfiniteOptions", + "to": "framework/solid/reference/type-aliases/UndefinedInitialDataInfiniteOptions" + }, + { + "label": "Types / UndefinedInitialDataOptions", + "to": "framework/solid/reference/type-aliases/UndefinedInitialDataOptions" + }, + { + "label": "Types / UnsetMarker", + "to": "framework/solid/reference/type-aliases/UnsetMarker" + }, + { + "label": "Types / Updater", + "to": "framework/solid/reference/type-aliases/Updater" + }, + { + "label": "Types / UseBaseMutationResult", + "to": "framework/solid/reference/type-aliases/UseBaseMutationResult" + }, + { + "label": "Types / UseBaseQueryResult", + "to": "framework/solid/reference/type-aliases/UseBaseQueryResult" + }, + { + "label": "Types / UseInfiniteQueryOptions", + "to": "framework/solid/reference/type-aliases/UseInfiniteQueryOptions" + }, + { + "label": "Types / UseInfiniteQueryResult", + "to": "framework/solid/reference/type-aliases/UseInfiniteQueryResult" + }, + { + "label": "Types / UseMutateAsyncFunction", + "to": "framework/solid/reference/type-aliases/UseMutateAsyncFunction" + }, + { + "label": "Types / UseMutateFunction", + "to": "framework/solid/reference/type-aliases/UseMutateFunction" + }, + { + "label": "Types / UseMutationOptions", + "to": "framework/solid/reference/type-aliases/UseMutationOptions" + }, + { + "label": "Types / UseMutationResult", + "to": "framework/solid/reference/type-aliases/UseMutationResult" + }, + { + "label": "Types / UseQueryOptions", + "to": "framework/solid/reference/type-aliases/UseQueryOptions" + }, + { + "label": "Types / UseQueryResult", + "to": "framework/solid/reference/type-aliases/UseQueryResult" + }, + { + "label": "Types / WithRequired", + "to": "framework/solid/reference/type-aliases/WithRequired" + }, + { + "label": "Types / dataTagErrorSymbol", + "to": "framework/solid/reference/type-aliases/dataTagErrorSymbol" + }, + { + "label": "Types / dataTagSymbol", + "to": "framework/solid/reference/type-aliases/dataTagSymbol" + }, + { + "label": "Variables / IsRestoringProvider", + "to": "framework/solid/reference/variables/IsRestoringProvider" + }, + { + "label": "Variables / QueryClientContext", + "to": "framework/solid/reference/variables/QueryClientContext" + }, + { + "label": "Variables / createInfiniteQuery", + "to": "framework/solid/reference/variables/createInfiniteQuery" + }, + { + "label": "Variables / createMutation", + "to": "framework/solid/reference/variables/createMutation" + }, + { + "label": "Variables / createQueries", + "to": "framework/solid/reference/variables/createQueries" + }, + { + "label": "Variables / createQuery", + "to": "framework/solid/reference/variables/createQuery" + }, + { + "label": "Variables / dataTagErrorSymbol", + "to": "framework/solid/reference/variables/dataTagErrorSymbol" + }, + { + "label": "Variables / dataTagSymbol", + "to": "framework/solid/reference/variables/dataTagSymbol" + }, + { + "label": "Variables / defaultScheduler", + "to": "framework/solid/reference/variables/defaultScheduler" + }, + { + "label": "Variables / environmentManager", + "to": "framework/solid/reference/variables/environmentManager" + }, + { + "label": "Variables / focusManager", + "to": "framework/solid/reference/variables/focusManager" + }, + { + "label": "Variables / isServer", + "to": "framework/solid/reference/variables/isServer" + }, + { + "label": "Variables / notifyManager", + "to": "framework/solid/reference/variables/notifyManager" + }, + { + "label": "Variables / onlineManager", + "to": "framework/solid/reference/variables/onlineManager" + }, + { + "label": "Variables / skipToken", + "to": "framework/solid/reference/variables/skipToken" + }, + { + "label": "Variables / timeoutManager", + "to": "framework/solid/reference/variables/timeoutManager" + }, + { + "label": "Variables / unsetMarker", + "to": "framework/solid/reference/variables/unsetMarker" + } + ] + }, + { + "label": "svelte", + "children": [ + { + "label": "Svelte Reference", + "to": "framework/svelte/reference/index" + }, + { + "label": "Functions / createInfiniteQuery", + "to": "framework/svelte/reference/functions/createInfiniteQuery" + }, + { + "label": "Functions / createMutation", + "to": "framework/svelte/reference/functions/createMutation" + }, + { + "label": "Functions / createQueries", + "to": "framework/svelte/reference/functions/createQueries" + }, + { + "label": "Functions / createQuery", + "to": "framework/svelte/reference/functions/createQuery" + }, + { + "label": "Functions / defaultShouldDehydrateMutation", + "to": "framework/svelte/reference/functions/defaultShouldDehydrateMutation" + }, + { + "label": "Functions / defaultShouldDehydrateQuery", + "to": "framework/svelte/reference/functions/defaultShouldDehydrateQuery" + }, + { + "label": "Functions / dehydrate", + "to": "framework/svelte/reference/functions/dehydrate" + }, + { + "label": "Functions / dehydrateQuery", + "to": "framework/svelte/reference/functions/dehydrateQuery" + }, + { + "label": "Functions / experimental_streamedQuery", + "to": "framework/svelte/reference/functions/experimental_streamedQuery" + }, + { + "label": "Functions / getIsRestoringContext", + "to": "framework/svelte/reference/functions/getIsRestoringContext" + }, + { + "label": "Functions / getQueryClientContext", + "to": "framework/svelte/reference/functions/getQueryClientContext" + }, + { + "label": "Functions / hashKey", + "to": "framework/svelte/reference/functions/hashKey" + }, + { + "label": "Functions / hydrate", + "to": "framework/svelte/reference/functions/hydrate" + }, + { + "label": "Functions / infiniteQueryOptions", + "to": "framework/svelte/reference/functions/infiniteQueryOptions" + }, + { + "label": "Functions / isCancelledError", + "to": "framework/svelte/reference/functions/isCancelledError" + }, + { + "label": "Functions / keepPreviousData", + "to": "framework/svelte/reference/functions/keepPreviousData" + }, + { + "label": "Functions / matchMutation", + "to": "framework/svelte/reference/functions/matchMutation" + }, + { + "label": "Functions / matchQuery", + "to": "framework/svelte/reference/functions/matchQuery" + }, + { + "label": "Functions / mutationOptions", + "to": "framework/svelte/reference/functions/mutationOptions" + }, + { + "label": "Functions / noop", + "to": "framework/svelte/reference/functions/noop" + }, + { + "label": "Functions / partialMatchKey", + "to": "framework/svelte/reference/functions/partialMatchKey" + }, + { + "label": "Functions / queryOptions", + "to": "framework/svelte/reference/functions/queryOptions" + }, + { + "label": "Functions / replaceEqualDeep", + "to": "framework/svelte/reference/functions/replaceEqualDeep" + }, + { + "label": "Functions / setIsRestoringContext", + "to": "framework/svelte/reference/functions/setIsRestoringContext" + }, + { + "label": "Functions / setQueryClientContext", + "to": "framework/svelte/reference/functions/setQueryClientContext" + }, + { + "label": "Functions / shouldThrowError", + "to": "framework/svelte/reference/functions/shouldThrowError" + }, + { + "label": "Functions / useHydrate", + "to": "framework/svelte/reference/functions/useHydrate" + }, + { + "label": "Functions / useIsFetching", + "to": "framework/svelte/reference/functions/useIsFetching" + }, + { + "label": "Functions / useIsMutating", + "to": "framework/svelte/reference/functions/useIsMutating" + }, + { + "label": "Functions / useIsRestoring", + "to": "framework/svelte/reference/functions/useIsRestoring" + }, + { + "label": "Functions / useMutationState", + "to": "framework/svelte/reference/functions/useMutationState" + }, + { + "label": "Functions / useQueryClient", + "to": "framework/svelte/reference/functions/useQueryClient" + }, + { + "label": "Classes / CancelledError", + "to": "framework/svelte/reference/classes/CancelledError" + }, + { + "label": "Classes / InfiniteQueryObserver", + "to": "framework/svelte/reference/classes/InfiniteQueryObserver" + }, + { + "label": "Classes / Mutation", + "to": "framework/svelte/reference/classes/Mutation" + }, + { + "label": "Classes / MutationCache", + "to": "framework/svelte/reference/classes/MutationCache" + }, + { + "label": "Classes / MutationObserver", + "to": "framework/svelte/reference/classes/MutationObserver" + }, + { + "label": "Classes / QueriesObserver", + "to": "framework/svelte/reference/classes/QueriesObserver" + }, + { + "label": "Classes / Query", + "to": "framework/svelte/reference/classes/Query" + }, + { + "label": "Classes / QueryCache", + "to": "framework/svelte/reference/classes/QueryCache" + }, + { + "label": "Classes / QueryClient", + "to": "framework/svelte/reference/classes/QueryClient" + }, + { + "label": "Classes / QueryObserver", + "to": "framework/svelte/reference/classes/QueryObserver" + }, + { + "label": "Interfaces / CancelOptions", + "to": "framework/svelte/reference/interfaces/CancelOptions" + }, + { + "label": "Interfaces / DefaultOptions", + "to": "framework/svelte/reference/interfaces/DefaultOptions" + }, + { + "label": "Interfaces / DehydrateOptions", + "to": "framework/svelte/reference/interfaces/DehydrateOptions" + }, + { + "label": "Interfaces / DehydratedState", + "to": "framework/svelte/reference/interfaces/DehydratedState" + }, + { + "label": "Interfaces / EnsureQueryDataOptions", + "to": "framework/svelte/reference/interfaces/EnsureQueryDataOptions" + }, + { + "label": "Interfaces / FetchNextPageOptions", + "to": "framework/svelte/reference/interfaces/FetchNextPageOptions" + }, + { + "label": "Interfaces / FetchPreviousPageOptions", + "to": "framework/svelte/reference/interfaces/FetchPreviousPageOptions" + }, + { + "label": "Interfaces / FetchQueryOptions", + "to": "framework/svelte/reference/interfaces/FetchQueryOptions" + }, + { + "label": "Interfaces / HydrateOptions", + "to": "framework/svelte/reference/interfaces/HydrateOptions" + }, + { + "label": "Interfaces / InfiniteData", + "to": "framework/svelte/reference/interfaces/InfiniteData" + }, + { + "label": "Interfaces / InfiniteQueryObserverBaseResult", + "to": "framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverLoadingErrorResult", + "to": "framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverLoadingResult", + "to": "framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverOptions", + "to": "framework/svelte/reference/interfaces/InfiniteQueryObserverOptions" + }, + { + "label": "Interfaces / InfiniteQueryObserverPendingResult", + "to": "framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverPlaceholderResult", + "to": "framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverRefetchErrorResult", + "to": "framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverSuccessResult", + "to": "framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult" + }, + { + "label": "Interfaces / InfiniteQueryPageParamsOptions", + "to": "framework/svelte/reference/interfaces/InfiniteQueryPageParamsOptions" + }, + { + "label": "Interfaces / InitialPageParam", + "to": "framework/svelte/reference/interfaces/InitialPageParam" + }, + { + "label": "Interfaces / InvalidateOptions", + "to": "framework/svelte/reference/interfaces/InvalidateOptions" + }, + { + "label": "Interfaces / InvalidateQueryFilters", + "to": "framework/svelte/reference/interfaces/InvalidateQueryFilters" + }, + { + "label": "Interfaces / MutateOptions", + "to": "framework/svelte/reference/interfaces/MutateOptions" + }, + { + "label": "Interfaces / MutationCacheConfig", + "to": "framework/svelte/reference/interfaces/MutationCacheConfig" + }, + { + "label": "Interfaces / MutationFilters", + "to": "framework/svelte/reference/interfaces/MutationFilters" + }, + { + "label": "Interfaces / MutationObserverBaseResult", + "to": "framework/svelte/reference/interfaces/MutationObserverBaseResult" + }, + { + "label": "Interfaces / MutationObserverErrorResult", + "to": "framework/svelte/reference/interfaces/MutationObserverErrorResult" + }, + { + "label": "Interfaces / MutationObserverIdleResult", + "to": "framework/svelte/reference/interfaces/MutationObserverIdleResult" + }, + { + "label": "Interfaces / MutationObserverLoadingResult", + "to": "framework/svelte/reference/interfaces/MutationObserverLoadingResult" + }, + { + "label": "Interfaces / MutationObserverOptions", + "to": "framework/svelte/reference/interfaces/MutationObserverOptions" + }, + { + "label": "Interfaces / MutationObserverSuccessResult", + "to": "framework/svelte/reference/interfaces/MutationObserverSuccessResult" + }, + { + "label": "Interfaces / MutationOptions", + "to": "framework/svelte/reference/interfaces/MutationOptions" + }, + { + "label": "Interfaces / MutationState", + "to": "framework/svelte/reference/interfaces/MutationState" + }, + { + "label": "Interfaces / NotifyEvent", + "to": "framework/svelte/reference/interfaces/NotifyEvent" + }, + { + "label": "Interfaces / QueriesObserverOptions", + "to": "framework/svelte/reference/interfaces/QueriesObserverOptions" + }, + { + "label": "Interfaces / QueryCacheConfig", + "to": "framework/svelte/reference/interfaces/QueryCacheConfig" + }, + { + "label": "Interfaces / QueryClientConfig", + "to": "framework/svelte/reference/interfaces/QueryClientConfig" + }, + { + "label": "Interfaces / QueryExecuteOptions", + "to": "framework/svelte/reference/interfaces/QueryExecuteOptions" + }, + { + "label": "Interfaces / QueryFilters", + "to": "framework/svelte/reference/interfaces/QueryFilters" + }, + { + "label": "Interfaces / QueryObserverBaseResult", + "to": "framework/svelte/reference/interfaces/QueryObserverBaseResult" + }, + { + "label": "Interfaces / QueryObserverLoadingErrorResult", + "to": "framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult" + }, + { + "label": "Interfaces / QueryObserverLoadingResult", + "to": "framework/svelte/reference/interfaces/QueryObserverLoadingResult" + }, + { + "label": "Interfaces / QueryObserverOptions", + "to": "framework/svelte/reference/interfaces/QueryObserverOptions" + }, + { + "label": "Interfaces / QueryObserverPendingResult", + "to": "framework/svelte/reference/interfaces/QueryObserverPendingResult" + }, + { + "label": "Interfaces / QueryObserverPlaceholderResult", + "to": "framework/svelte/reference/interfaces/QueryObserverPlaceholderResult" + }, + { + "label": "Interfaces / QueryObserverRefetchErrorResult", + "to": "framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult" + }, + { + "label": "Interfaces / QueryObserverSuccessResult", + "to": "framework/svelte/reference/interfaces/QueryObserverSuccessResult" + }, + { + "label": "Interfaces / QueryOptions", + "to": "framework/svelte/reference/interfaces/QueryOptions" + }, + { + "label": "Interfaces / QueryState", + "to": "framework/svelte/reference/interfaces/QueryState" + }, + { + "label": "Interfaces / RefetchOptions", + "to": "framework/svelte/reference/interfaces/RefetchOptions" + }, + { + "label": "Interfaces / RefetchQueryFilters", + "to": "framework/svelte/reference/interfaces/RefetchQueryFilters" + }, + { + "label": "Interfaces / Register", + "to": "framework/svelte/reference/interfaces/Register" + }, + { + "label": "Interfaces / ResetOptions", + "to": "framework/svelte/reference/interfaces/ResetOptions" + }, + { + "label": "Interfaces / ResultOptions", + "to": "framework/svelte/reference/interfaces/ResultOptions" + }, + { + "label": "Interfaces / SetDataOptions", + "to": "framework/svelte/reference/interfaces/SetDataOptions" + }, + { + "label": "Types / Accessor", + "to": "framework/svelte/reference/type-aliases/Accessor" + }, + { + "label": "Types / AnyDataTag", + "to": "framework/svelte/reference/type-aliases/AnyDataTag" + }, + { + "label": "Types / CreateBaseMutationResult", + "to": "framework/svelte/reference/type-aliases/CreateBaseMutationResult" + }, + { + "label": "Types / CreateBaseQueryOptions", + "to": "framework/svelte/reference/type-aliases/CreateBaseQueryOptions" + }, + { + "label": "Types / CreateBaseQueryResult", + "to": "framework/svelte/reference/type-aliases/CreateBaseQueryResult" + }, + { + "label": "Types / CreateInfiniteQueryOptions", + "to": "framework/svelte/reference/type-aliases/CreateInfiniteQueryOptions" + }, + { + "label": "Types / CreateInfiniteQueryResult", + "to": "framework/svelte/reference/type-aliases/CreateInfiniteQueryResult" + }, + { + "label": "Types / CreateMutateAsyncFunction", + "to": "framework/svelte/reference/type-aliases/CreateMutateAsyncFunction" + }, + { + "label": "Types / CreateMutateFunction", + "to": "framework/svelte/reference/type-aliases/CreateMutateFunction" + }, + { + "label": "Types / CreateMutationOptions", + "to": "framework/svelte/reference/type-aliases/CreateMutationOptions" + }, + { + "label": "Types / CreateMutationResult", + "to": "framework/svelte/reference/type-aliases/CreateMutationResult" + }, + { + "label": "Types / CreateQueryOptions", + "to": "framework/svelte/reference/type-aliases/CreateQueryOptions" + }, + { + "label": "Types / CreateQueryResult", + "to": "framework/svelte/reference/type-aliases/CreateQueryResult" + }, + { + "label": "Types / DataTag", + "to": "framework/svelte/reference/type-aliases/DataTag" + }, + { + "label": "Types / DefaultError", + "to": "framework/svelte/reference/type-aliases/DefaultError" + }, + { + "label": "Types / DefaultedInfiniteQueryObserverOptions", + "to": "framework/svelte/reference/type-aliases/DefaultedInfiniteQueryObserverOptions" + }, + { + "label": "Types / DefaultedQueryObserverOptions", + "to": "framework/svelte/reference/type-aliases/DefaultedQueryObserverOptions" + }, + { + "label": "Types / DefinedCreateBaseQueryResult", + "to": "framework/svelte/reference/type-aliases/DefinedCreateBaseQueryResult" + }, + { + "label": "Types / DefinedCreateQueryResult", + "to": "framework/svelte/reference/type-aliases/DefinedCreateQueryResult" + }, + { + "label": "Types / DefinedInfiniteQueryObserverResult", + "to": "framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult" + }, + { + "label": "Types / DefinedInitialDataOptions", + "to": "framework/svelte/reference/type-aliases/DefinedInitialDataOptions" + }, + { + "label": "Types / DefinedQueryObserverResult", + "to": "framework/svelte/reference/type-aliases/DefinedQueryObserverResult" + }, + { + "label": "Types / DistributiveOmit", + "to": "framework/svelte/reference/type-aliases/DistributiveOmit" + }, + { + "label": "Types / EnsureInfiniteQueryDataOptions", + "to": "framework/svelte/reference/type-aliases/EnsureInfiniteQueryDataOptions" + }, + { + "label": "Types / FetchInfiniteQueryOptions", + "to": "framework/svelte/reference/type-aliases/FetchInfiniteQueryOptions" + }, + { + "label": "Types / FetchStatus", + "to": "framework/svelte/reference/type-aliases/FetchStatus" + }, + { + "label": "Types / GetNextPageParamFunction", + "to": "framework/svelte/reference/type-aliases/GetNextPageParamFunction" + }, + { + "label": "Types / GetPreviousPageParamFunction", + "to": "framework/svelte/reference/type-aliases/GetPreviousPageParamFunction" + }, + { + "label": "Types / HydrationBoundary", + "to": "framework/svelte/reference/type-aliases/HydrationBoundary" + }, + { + "label": "Types / InferDataFromTag", + "to": "framework/svelte/reference/type-aliases/InferDataFromTag" + }, + { + "label": "Types / InferErrorFromTag", + "to": "framework/svelte/reference/type-aliases/InferErrorFromTag" + }, + { + "label": "Types / InfiniteQueryExecuteOptions", + "to": "framework/svelte/reference/type-aliases/InfiniteQueryExecuteOptions" + }, + { + "label": "Types / InfiniteQueryObserverResult", + "to": "framework/svelte/reference/type-aliases/InfiniteQueryObserverResult" + }, + { + "label": "Types / InitialDataFunction", + "to": "framework/svelte/reference/type-aliases/InitialDataFunction" + }, + { + "label": "Types / ManagedTimerId", + "to": "framework/svelte/reference/type-aliases/ManagedTimerId" + }, + { + "label": "Types / MutateFunction", + "to": "framework/svelte/reference/type-aliases/MutateFunction" + }, + { + "label": "Types / MutateFunctionRest", + "to": "framework/svelte/reference/type-aliases/MutateFunctionRest" + }, + { + "label": "Types / MutationCacheNotifyEvent", + "to": "framework/svelte/reference/type-aliases/MutationCacheNotifyEvent" + }, + { + "label": "Types / MutationFunction", + "to": "framework/svelte/reference/type-aliases/MutationFunction" + }, + { + "label": "Types / MutationFunctionContext", + "to": "framework/svelte/reference/type-aliases/MutationFunctionContext" + }, + { + "label": "Types / MutationKey", + "to": "framework/svelte/reference/type-aliases/MutationKey" + }, + { + "label": "Types / MutationMeta", + "to": "framework/svelte/reference/type-aliases/MutationMeta" + }, + { + "label": "Types / MutationObserverResult", + "to": "framework/svelte/reference/type-aliases/MutationObserverResult" + }, + { + "label": "Types / MutationScope", + "to": "framework/svelte/reference/type-aliases/MutationScope" + }, + { + "label": "Types / MutationStateOptions", + "to": "framework/svelte/reference/type-aliases/MutationStateOptions" + }, + { + "label": "Types / MutationStatus", + "to": "framework/svelte/reference/type-aliases/MutationStatus" + }, + { + "label": "Types / MutationTypeFromResult", + "to": "framework/svelte/reference/type-aliases/MutationTypeFromResult" + }, + { + "label": "Types / NetworkMode", + "to": "framework/svelte/reference/type-aliases/NetworkMode" + }, + { + "label": "Types / NonUndefinedGuard", + "to": "framework/svelte/reference/type-aliases/NonUndefinedGuard" + }, + { + "label": "Types / NotifyEventType", + "to": "framework/svelte/reference/type-aliases/NotifyEventType" + }, + { + "label": "Types / NotifyOnChangeProps", + "to": "framework/svelte/reference/type-aliases/NotifyOnChangeProps" + }, + { + "label": "Types / OmitKeyof", + "to": "framework/svelte/reference/type-aliases/OmitKeyof" + }, + { + "label": "Types / Override", + "to": "framework/svelte/reference/type-aliases/Override" + }, + { + "label": "Types / PlaceholderDataFunction", + "to": "framework/svelte/reference/type-aliases/PlaceholderDataFunction" + }, + { + "label": "Types / QueriesOptions", + "to": "framework/svelte/reference/type-aliases/QueriesOptions" + }, + { + "label": "Types / QueriesPlaceholderDataFunction", + "to": "framework/svelte/reference/type-aliases/QueriesPlaceholderDataFunction" + }, + { + "label": "Types / QueriesResults", + "to": "framework/svelte/reference/type-aliases/QueriesResults" + }, + { + "label": "Types / QueryBooleanOption", + "to": "framework/svelte/reference/type-aliases/QueryBooleanOption" + }, + { + "label": "Types / QueryCacheNotifyEvent", + "to": "framework/svelte/reference/type-aliases/QueryCacheNotifyEvent" + }, + { + "label": "Types / QueryClientProviderProps", + "to": "framework/svelte/reference/type-aliases/QueryClientProviderProps" + }, + { + "label": "Types / QueryFunction", + "to": "framework/svelte/reference/type-aliases/QueryFunction" + }, + { + "label": "Types / QueryFunctionContext", + "to": "framework/svelte/reference/type-aliases/QueryFunctionContext" + }, + { + "label": "Types / QueryKey", + "to": "framework/svelte/reference/type-aliases/QueryKey" + }, + { + "label": "Types / QueryKeyHashFunction", + "to": "framework/svelte/reference/type-aliases/QueryKeyHashFunction" + }, + { + "label": "Types / QueryKeyWithDataTag", + "to": "framework/svelte/reference/type-aliases/QueryKeyWithDataTag" + }, + { + "label": "Types / QueryMeta", + "to": "framework/svelte/reference/type-aliases/QueryMeta" + }, + { + "label": "Types / QueryObserverResult", + "to": "framework/svelte/reference/type-aliases/QueryObserverResult" + }, + { + "label": "Types / QueryPersister", + "to": "framework/svelte/reference/type-aliases/QueryPersister" + }, + { + "label": "Types / QueryStatus", + "to": "framework/svelte/reference/type-aliases/QueryStatus" + }, + { + "label": "Types / SkipToken", + "to": "framework/svelte/reference/type-aliases/SkipToken" + }, + { + "label": "Types / StaleTime", + "to": "framework/svelte/reference/type-aliases/StaleTime" + }, + { + "label": "Types / StaleTimeFunction", + "to": "framework/svelte/reference/type-aliases/StaleTimeFunction" + }, + { + "label": "Types / ThrowOnError", + "to": "framework/svelte/reference/type-aliases/ThrowOnError" + }, + { + "label": "Types / TimeoutCallback", + "to": "framework/svelte/reference/type-aliases/TimeoutCallback" + }, + { + "label": "Types / TimeoutProvider", + "to": "framework/svelte/reference/type-aliases/TimeoutProvider" + }, + { + "label": "Types / UndefinedInitialDataOptions", + "to": "framework/svelte/reference/type-aliases/UndefinedInitialDataOptions" + }, + { + "label": "Types / UnsetMarker", + "to": "framework/svelte/reference/type-aliases/UnsetMarker" + }, + { + "label": "Types / Updater", + "to": "framework/svelte/reference/type-aliases/Updater" + }, + { + "label": "Types / WithRequired", + "to": "framework/svelte/reference/type-aliases/WithRequired" + }, + { + "label": "Types / dataTagErrorSymbol", + "to": "framework/svelte/reference/type-aliases/dataTagErrorSymbol" + }, + { + "label": "Types / dataTagSymbol", + "to": "framework/svelte/reference/type-aliases/dataTagSymbol" + }, + { + "label": "Variables / HydrationBoundary", + "to": "framework/svelte/reference/variables/HydrationBoundary" + }, + { + "label": "Variables / dataTagErrorSymbol", + "to": "framework/svelte/reference/variables/dataTagErrorSymbol" + }, + { + "label": "Variables / dataTagSymbol", + "to": "framework/svelte/reference/variables/dataTagSymbol" + }, + { + "label": "Variables / defaultScheduler", + "to": "framework/svelte/reference/variables/defaultScheduler" + }, + { + "label": "Variables / environmentManager", + "to": "framework/svelte/reference/variables/environmentManager" + }, + { + "label": "Variables / focusManager", + "to": "framework/svelte/reference/variables/focusManager" + }, + { + "label": "Variables / isServer", + "to": "framework/svelte/reference/variables/isServer" + }, + { + "label": "Variables / notifyManager", + "to": "framework/svelte/reference/variables/notifyManager" + }, + { + "label": "Variables / onlineManager", + "to": "framework/svelte/reference/variables/onlineManager" + }, + { + "label": "Variables / skipToken", + "to": "framework/svelte/reference/variables/skipToken" + }, + { + "label": "Variables / timeoutManager", + "to": "framework/svelte/reference/variables/timeoutManager" + }, + { + "label": "Variables / unsetMarker", + "to": "framework/svelte/reference/variables/unsetMarker" + } + ] + }, + { + "label": "lit", + "children": [ + { + "label": "Lit Reference", + "to": "framework/lit/reference/index" + }, + { + "label": "Classes / CancelledError", + "to": "framework/lit/reference/classes/CancelledError" + }, + { + "label": "Classes / InfiniteQueryObserver", + "to": "framework/lit/reference/classes/InfiniteQueryObserver" + }, + { + "label": "Classes / Mutation", + "to": "framework/lit/reference/classes/Mutation" + }, + { + "label": "Classes / MutationCache", + "to": "framework/lit/reference/classes/MutationCache" + }, + { + "label": "Classes / MutationObserver", + "to": "framework/lit/reference/classes/MutationObserver" + }, + { + "label": "Classes / QueriesObserver", + "to": "framework/lit/reference/classes/QueriesObserver" + }, + { + "label": "Classes / Query", + "to": "framework/lit/reference/classes/Query" + }, + { + "label": "Classes / QueryCache", + "to": "framework/lit/reference/classes/QueryCache" + }, + { + "label": "Classes / QueryClient", + "to": "framework/lit/reference/classes/QueryClient" + }, + { + "label": "Classes / QueryClientProvider", + "to": "framework/lit/reference/classes/QueryClientProvider" + }, + { + "label": "Classes / QueryObserver", + "to": "framework/lit/reference/classes/QueryObserver" + }, + { + "label": "Functions / createInfiniteQueryController", + "to": "framework/lit/reference/functions/createInfiniteQueryController" + }, + { + "label": "Functions / createMutationController", + "to": "framework/lit/reference/functions/createMutationController" + }, + { + "label": "Functions / createQueriesController", + "to": "framework/lit/reference/functions/createQueriesController" + }, + { + "label": "Functions / createQueryController", + "to": "framework/lit/reference/functions/createQueryController" + }, + { + "label": "Functions / defaultShouldDehydrateMutation", + "to": "framework/lit/reference/functions/defaultShouldDehydrateMutation" + }, + { + "label": "Functions / defaultShouldDehydrateQuery", + "to": "framework/lit/reference/functions/defaultShouldDehydrateQuery" + }, + { + "label": "Functions / dehydrate", + "to": "framework/lit/reference/functions/dehydrate" + }, + { + "label": "Functions / dehydrateQuery", + "to": "framework/lit/reference/functions/dehydrateQuery" + }, + { + "label": "Functions / experimental_streamedQuery", + "to": "framework/lit/reference/functions/experimental_streamedQuery" + }, + { + "label": "Functions / hashKey", + "to": "framework/lit/reference/functions/hashKey" + }, + { + "label": "Functions / hydrate", + "to": "framework/lit/reference/functions/hydrate" + }, + { + "label": "Functions / infiniteQueryOptions", + "to": "framework/lit/reference/functions/infiniteQueryOptions" + }, + { + "label": "Functions / isCancelledError", + "to": "framework/lit/reference/functions/isCancelledError" + }, + { + "label": "Functions / keepPreviousData", + "to": "framework/lit/reference/functions/keepPreviousData" + }, + { + "label": "Functions / matchMutation", + "to": "framework/lit/reference/functions/matchMutation" + }, + { + "label": "Functions / matchQuery", + "to": "framework/lit/reference/functions/matchQuery" + }, + { + "label": "Functions / mutationOptions", + "to": "framework/lit/reference/functions/mutationOptions" + }, + { + "label": "Functions / noop", + "to": "framework/lit/reference/functions/noop" + }, + { + "label": "Functions / partialMatchKey", + "to": "framework/lit/reference/functions/partialMatchKey" + }, + { + "label": "Functions / queryOptions", + "to": "framework/lit/reference/functions/queryOptions" + }, + { + "label": "Functions / replaceEqualDeep", + "to": "framework/lit/reference/functions/replaceEqualDeep" + }, + { + "label": "Functions / shouldThrowError", + "to": "framework/lit/reference/functions/shouldThrowError" + }, + { + "label": "Functions / useIsFetching", + "to": "framework/lit/reference/functions/useIsFetching" + }, + { + "label": "Functions / useIsMutating", + "to": "framework/lit/reference/functions/useIsMutating" + }, + { + "label": "Functions / useMutationState", + "to": "framework/lit/reference/functions/useMutationState" + }, + { + "label": "Functions / useQueryClient", + "to": "framework/lit/reference/functions/useQueryClient" + }, + { + "label": "Context / queryClientContext", + "to": "framework/lit/reference/variables/queryClientContext" + }, + { + "label": "Context / getDefaultQueryClient", + "to": "framework/lit/reference/functions/getDefaultQueryClient" + }, + { + "label": "Context / registerDefaultQueryClient", + "to": "framework/lit/reference/functions/registerDefaultQueryClient" + }, + { + "label": "Context / unregisterDefaultQueryClient", + "to": "framework/lit/reference/functions/unregisterDefaultQueryClient" + }, + { + "label": "Context / resolveQueryClient", + "to": "framework/lit/reference/functions/resolveQueryClient" + }, + { + "label": "Interfaces / CancelOptions", + "to": "framework/lit/reference/interfaces/CancelOptions" + }, + { + "label": "Interfaces / DefaultOptions", + "to": "framework/lit/reference/interfaces/DefaultOptions" + }, + { + "label": "Interfaces / DehydrateOptions", + "to": "framework/lit/reference/interfaces/DehydrateOptions" + }, + { + "label": "Interfaces / DehydratedState", + "to": "framework/lit/reference/interfaces/DehydratedState" + }, + { + "label": "Interfaces / EnsureQueryDataOptions", + "to": "framework/lit/reference/interfaces/EnsureQueryDataOptions" + }, + { + "label": "Interfaces / FetchNextPageOptions", + "to": "framework/lit/reference/interfaces/FetchNextPageOptions" + }, + { + "label": "Interfaces / FetchPreviousPageOptions", + "to": "framework/lit/reference/interfaces/FetchPreviousPageOptions" + }, + { + "label": "Interfaces / FetchQueryOptions", + "to": "framework/lit/reference/interfaces/FetchQueryOptions" + }, + { + "label": "Interfaces / HydrateOptions", + "to": "framework/lit/reference/interfaces/HydrateOptions" + }, + { + "label": "Interfaces / InfiniteData", + "to": "framework/lit/reference/interfaces/InfiniteData" + }, + { + "label": "Interfaces / InfiniteQueryObserverBaseResult", + "to": "framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverLoadingErrorResult", + "to": "framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverLoadingResult", + "to": "framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverOptions", + "to": "framework/lit/reference/interfaces/InfiniteQueryObserverOptions" + }, + { + "label": "Interfaces / InfiniteQueryObserverPendingResult", + "to": "framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverPlaceholderResult", + "to": "framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverRefetchErrorResult", + "to": "framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverSuccessResult", + "to": "framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult" + }, + { + "label": "Interfaces / InfiniteQueryPageParamsOptions", + "to": "framework/lit/reference/interfaces/InfiniteQueryPageParamsOptions" + }, + { + "label": "Interfaces / InitialPageParam", + "to": "framework/lit/reference/interfaces/InitialPageParam" + }, + { + "label": "Interfaces / InvalidateOptions", + "to": "framework/lit/reference/interfaces/InvalidateOptions" + }, + { + "label": "Interfaces / InvalidateQueryFilters", + "to": "framework/lit/reference/interfaces/InvalidateQueryFilters" + }, + { + "label": "Interfaces / MutateOptions", + "to": "framework/lit/reference/interfaces/MutateOptions" + }, + { + "label": "Interfaces / MutationCacheConfig", + "to": "framework/lit/reference/interfaces/MutationCacheConfig" + }, + { + "label": "Interfaces / MutationFilters", + "to": "framework/lit/reference/interfaces/MutationFilters" + }, + { + "label": "Interfaces / MutationObserverBaseResult", + "to": "framework/lit/reference/interfaces/MutationObserverBaseResult" + }, + { + "label": "Interfaces / MutationObserverErrorResult", + "to": "framework/lit/reference/interfaces/MutationObserverErrorResult" + }, + { + "label": "Interfaces / MutationObserverIdleResult", + "to": "framework/lit/reference/interfaces/MutationObserverIdleResult" + }, + { + "label": "Interfaces / MutationObserverLoadingResult", + "to": "framework/lit/reference/interfaces/MutationObserverLoadingResult" + }, + { + "label": "Interfaces / MutationObserverOptions", + "to": "framework/lit/reference/interfaces/MutationObserverOptions" + }, + { + "label": "Interfaces / MutationObserverSuccessResult", + "to": "framework/lit/reference/interfaces/MutationObserverSuccessResult" + }, + { + "label": "Interfaces / MutationOptions", + "to": "framework/lit/reference/interfaces/MutationOptions" + }, + { + "label": "Interfaces / MutationState", + "to": "framework/lit/reference/interfaces/MutationState" + }, + { + "label": "Interfaces / NotifyEvent", + "to": "framework/lit/reference/interfaces/NotifyEvent" + }, + { + "label": "Interfaces / QueriesObserverOptions", + "to": "framework/lit/reference/interfaces/QueriesObserverOptions" + }, + { + "label": "Interfaces / QueryCacheConfig", + "to": "framework/lit/reference/interfaces/QueryCacheConfig" + }, + { + "label": "Interfaces / QueryClientConfig", + "to": "framework/lit/reference/interfaces/QueryClientConfig" + }, + { + "label": "Interfaces / QueryExecuteOptions", + "to": "framework/lit/reference/interfaces/QueryExecuteOptions" + }, + { + "label": "Interfaces / QueryFilters", + "to": "framework/lit/reference/interfaces/QueryFilters" + }, + { + "label": "Interfaces / QueryObserverBaseResult", + "to": "framework/lit/reference/interfaces/QueryObserverBaseResult" + }, + { + "label": "Interfaces / QueryObserverLoadingErrorResult", + "to": "framework/lit/reference/interfaces/QueryObserverLoadingErrorResult" + }, + { + "label": "Interfaces / QueryObserverLoadingResult", + "to": "framework/lit/reference/interfaces/QueryObserverLoadingResult" + }, + { + "label": "Interfaces / QueryObserverOptions", + "to": "framework/lit/reference/interfaces/QueryObserverOptions" + }, + { + "label": "Interfaces / QueryObserverPendingResult", + "to": "framework/lit/reference/interfaces/QueryObserverPendingResult" + }, + { + "label": "Interfaces / QueryObserverPlaceholderResult", + "to": "framework/lit/reference/interfaces/QueryObserverPlaceholderResult" + }, + { + "label": "Interfaces / QueryObserverRefetchErrorResult", + "to": "framework/lit/reference/interfaces/QueryObserverRefetchErrorResult" + }, + { + "label": "Interfaces / QueryObserverSuccessResult", + "to": "framework/lit/reference/interfaces/QueryObserverSuccessResult" + }, + { + "label": "Interfaces / QueryOptions", + "to": "framework/lit/reference/interfaces/QueryOptions" + }, + { + "label": "Interfaces / QueryState", + "to": "framework/lit/reference/interfaces/QueryState" + }, + { + "label": "Interfaces / RefetchOptions", + "to": "framework/lit/reference/interfaces/RefetchOptions" + }, + { + "label": "Interfaces / RefetchQueryFilters", + "to": "framework/lit/reference/interfaces/RefetchQueryFilters" + }, + { + "label": "Interfaces / Register", + "to": "framework/lit/reference/interfaces/Register" + }, + { + "label": "Interfaces / ResetOptions", + "to": "framework/lit/reference/interfaces/ResetOptions" + }, + { + "label": "Interfaces / ResultOptions", + "to": "framework/lit/reference/interfaces/ResultOptions" + }, + { + "label": "Interfaces / SetDataOptions", + "to": "framework/lit/reference/interfaces/SetDataOptions" + }, + { + "label": "Types / Accessor", + "to": "framework/lit/reference/type-aliases/Accessor" + }, + { + "label": "Types / AnyDataTag", + "to": "framework/lit/reference/type-aliases/AnyDataTag" + }, + { + "label": "Types / CreateInfiniteQueryOptions", + "to": "framework/lit/reference/type-aliases/CreateInfiniteQueryOptions" + }, + { + "label": "Types / CreateMutationOptions", + "to": "framework/lit/reference/type-aliases/CreateMutationOptions" + }, + { + "label": "Types / CreateQueriesControllerOptions", + "to": "framework/lit/reference/type-aliases/CreateQueriesControllerOptions" + }, + { + "label": "Types / CreateQueriesInput", + "to": "framework/lit/reference/type-aliases/CreateQueriesInput" + }, + { + "label": "Types / CreateQueryOptions", + "to": "framework/lit/reference/type-aliases/CreateQueryOptions" + }, + { + "label": "Types / DataTag", + "to": "framework/lit/reference/type-aliases/DataTag" + }, + { + "label": "Types / DefaultError", + "to": "framework/lit/reference/type-aliases/DefaultError" + }, + { + "label": "Types / DefaultedInfiniteQueryObserverOptions", + "to": "framework/lit/reference/type-aliases/DefaultedInfiniteQueryObserverOptions" + }, + { + "label": "Types / DefaultedQueryObserverOptions", + "to": "framework/lit/reference/type-aliases/DefaultedQueryObserverOptions" + }, + { + "label": "Types / DefinedInfiniteQueryObserverResult", + "to": "framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult" + }, + { + "label": "Types / DefinedInitialDataOptions", + "to": "framework/lit/reference/type-aliases/DefinedInitialDataOptions" + }, + { + "label": "Types / DefinedQueryObserverResult", + "to": "framework/lit/reference/type-aliases/DefinedQueryObserverResult" + }, + { + "label": "Types / DistributiveOmit", + "to": "framework/lit/reference/type-aliases/DistributiveOmit" + }, + { + "label": "Types / EnsureInfiniteQueryDataOptions", + "to": "framework/lit/reference/type-aliases/EnsureInfiniteQueryDataOptions" + }, + { + "label": "Types / FetchInfiniteQueryOptions", + "to": "framework/lit/reference/type-aliases/FetchInfiniteQueryOptions" + }, + { + "label": "Types / FetchStatus", + "to": "framework/lit/reference/type-aliases/FetchStatus" + }, + { + "label": "Types / GetNextPageParamFunction", + "to": "framework/lit/reference/type-aliases/GetNextPageParamFunction" + }, + { + "label": "Types / GetPreviousPageParamFunction", + "to": "framework/lit/reference/type-aliases/GetPreviousPageParamFunction" + }, + { + "label": "Types / InferDataFromTag", + "to": "framework/lit/reference/type-aliases/InferDataFromTag" + }, + { + "label": "Types / InferErrorFromTag", + "to": "framework/lit/reference/type-aliases/InferErrorFromTag" + }, + { + "label": "Types / InfiniteQueryControllerOptions", + "to": "framework/lit/reference/type-aliases/InfiniteQueryControllerOptions" + }, + { + "label": "Types / InfiniteQueryExecuteOptions", + "to": "framework/lit/reference/type-aliases/InfiniteQueryExecuteOptions" + }, + { + "label": "Types / InfiniteQueryObserverResult", + "to": "framework/lit/reference/type-aliases/InfiniteQueryObserverResult" + }, + { + "label": "Types / InfiniteQueryResultAccessor", + "to": "framework/lit/reference/type-aliases/InfiniteQueryResultAccessor" + }, + { + "label": "Types / InitialDataFunction", + "to": "framework/lit/reference/type-aliases/InitialDataFunction" + }, + { + "label": "Types / IsFetchingAccessor", + "to": "framework/lit/reference/type-aliases/IsFetchingAccessor" + }, + { + "label": "Types / IsMutatingAccessor", + "to": "framework/lit/reference/type-aliases/IsMutatingAccessor" + }, + { + "label": "Types / ManagedTimerId", + "to": "framework/lit/reference/type-aliases/ManagedTimerId" + }, + { + "label": "Types / MutateFunction", + "to": "framework/lit/reference/type-aliases/MutateFunction" + }, + { + "label": "Types / MutateFunctionRest", + "to": "framework/lit/reference/type-aliases/MutateFunctionRest" + }, + { + "label": "Types / MutationCacheNotifyEvent", + "to": "framework/lit/reference/type-aliases/MutationCacheNotifyEvent" + }, + { + "label": "Types / MutationControllerOptions", + "to": "framework/lit/reference/type-aliases/MutationControllerOptions" + }, + { + "label": "Types / MutationControllerResult", + "to": "framework/lit/reference/type-aliases/MutationControllerResult" + }, + { + "label": "Types / MutationFunction", + "to": "framework/lit/reference/type-aliases/MutationFunction" + }, + { + "label": "Types / MutationFunctionContext", + "to": "framework/lit/reference/type-aliases/MutationFunctionContext" + }, + { + "label": "Types / MutationKey", + "to": "framework/lit/reference/type-aliases/MutationKey" + }, + { + "label": "Types / MutationMeta", + "to": "framework/lit/reference/type-aliases/MutationMeta" + }, + { + "label": "Types / MutationObserverResult", + "to": "framework/lit/reference/type-aliases/MutationObserverResult" + }, + { + "label": "Types / MutationResultAccessor", + "to": "framework/lit/reference/type-aliases/MutationResultAccessor" + }, + { + "label": "Types / MutationScope", + "to": "framework/lit/reference/type-aliases/MutationScope" + }, + { + "label": "Types / MutationStateAccessor", + "to": "framework/lit/reference/type-aliases/MutationStateAccessor" + }, + { + "label": "Types / MutationStateOptions", + "to": "framework/lit/reference/type-aliases/MutationStateOptions" + }, + { + "label": "Types / MutationStatus", + "to": "framework/lit/reference/type-aliases/MutationStatus" + }, + { + "label": "Types / NetworkMode", + "to": "framework/lit/reference/type-aliases/NetworkMode" + }, + { + "label": "Types / NonUndefinedGuard", + "to": "framework/lit/reference/type-aliases/NonUndefinedGuard" + }, + { + "label": "Types / NotifyEventType", + "to": "framework/lit/reference/type-aliases/NotifyEventType" + }, + { + "label": "Types / NotifyOnChangeProps", + "to": "framework/lit/reference/type-aliases/NotifyOnChangeProps" + }, + { + "label": "Types / OmitKeyof", + "to": "framework/lit/reference/type-aliases/OmitKeyof" + }, + { + "label": "Types / Override", + "to": "framework/lit/reference/type-aliases/Override" + }, + { + "label": "Types / PlaceholderDataFunction", + "to": "framework/lit/reference/type-aliases/PlaceholderDataFunction" + }, + { + "label": "Types / QueriesControllerOptions", + "to": "framework/lit/reference/type-aliases/QueriesControllerOptions" + }, + { + "label": "Types / QueriesPlaceholderDataFunction", + "to": "framework/lit/reference/type-aliases/QueriesPlaceholderDataFunction" + }, + { + "label": "Types / QueriesResultAccessor", + "to": "framework/lit/reference/type-aliases/QueriesResultAccessor" + }, + { + "label": "Types / QueryBooleanOption", + "to": "framework/lit/reference/type-aliases/QueryBooleanOption" + }, + { + "label": "Types / QueryCacheNotifyEvent", + "to": "framework/lit/reference/type-aliases/QueryCacheNotifyEvent" + }, + { + "label": "Types / QueryControllerOptions", + "to": "framework/lit/reference/type-aliases/QueryControllerOptions" + }, + { + "label": "Types / QueryControllerResult", + "to": "framework/lit/reference/type-aliases/QueryControllerResult" + }, + { + "label": "Types / QueryFunction", + "to": "framework/lit/reference/type-aliases/QueryFunction" + }, + { + "label": "Types / QueryFunctionContext", + "to": "framework/lit/reference/type-aliases/QueryFunctionContext" + }, + { + "label": "Types / QueryKey", + "to": "framework/lit/reference/type-aliases/QueryKey" + }, + { + "label": "Types / QueryKeyHashFunction", + "to": "framework/lit/reference/type-aliases/QueryKeyHashFunction" + }, + { + "label": "Types / QueryKeyWithDataTag", + "to": "framework/lit/reference/type-aliases/QueryKeyWithDataTag" + }, + { + "label": "Types / QueryMeta", + "to": "framework/lit/reference/type-aliases/QueryMeta" + }, + { + "label": "Types / QueryObserverResult", + "to": "framework/lit/reference/type-aliases/QueryObserverResult" + }, + { + "label": "Types / QueryPersister", + "to": "framework/lit/reference/type-aliases/QueryPersister" + }, + { + "label": "Types / QueryResultAccessor", + "to": "framework/lit/reference/type-aliases/QueryResultAccessor" + }, + { + "label": "Types / QueryStatus", + "to": "framework/lit/reference/type-aliases/QueryStatus" + }, + { + "label": "Types / SkipToken", + "to": "framework/lit/reference/type-aliases/SkipToken" + }, + { + "label": "Types / StaleTime", + "to": "framework/lit/reference/type-aliases/StaleTime" + }, + { + "label": "Types / StaleTimeFunction", + "to": "framework/lit/reference/type-aliases/StaleTimeFunction" + }, + { + "label": "Types / ThrowOnError", + "to": "framework/lit/reference/type-aliases/ThrowOnError" + }, + { + "label": "Types / TimeoutCallback", + "to": "framework/lit/reference/type-aliases/TimeoutCallback" + }, + { + "label": "Types / TimeoutProvider", + "to": "framework/lit/reference/type-aliases/TimeoutProvider" + }, + { + "label": "Types / UndefinedInitialDataOptions", + "to": "framework/lit/reference/type-aliases/UndefinedInitialDataOptions" + }, + { + "label": "Types / UnsetMarker", + "to": "framework/lit/reference/type-aliases/UnsetMarker" + }, + { + "label": "Types / UnusedSkipTokenOptions", + "to": "framework/lit/reference/type-aliases/UnusedSkipTokenOptions" + }, + { + "label": "Types / Updater", + "to": "framework/lit/reference/type-aliases/Updater" + }, + { + "label": "Types / ValueAccessor", + "to": "framework/lit/reference/type-aliases/ValueAccessor" + }, + { + "label": "Types / WithRequired", + "to": "framework/lit/reference/type-aliases/WithRequired" + }, + { + "label": "Types / dataTagErrorSymbol", + "to": "framework/lit/reference/type-aliases/dataTagErrorSymbol" + }, + { + "label": "Types / dataTagSymbol", + "to": "framework/lit/reference/type-aliases/dataTagSymbol" + }, + { + "label": "Variables / dataTagErrorSymbol", + "to": "framework/lit/reference/variables/dataTagErrorSymbol" + }, + { + "label": "Variables / dataTagSymbol", + "to": "framework/lit/reference/variables/dataTagSymbol" + }, + { + "label": "Variables / defaultScheduler", + "to": "framework/lit/reference/variables/defaultScheduler" + }, + { + "label": "Variables / environmentManager", + "to": "framework/lit/reference/variables/environmentManager" + }, + { + "label": "Variables / focusManager", + "to": "framework/lit/reference/variables/focusManager" + }, + { + "label": "Variables / isServer", + "to": "framework/lit/reference/variables/isServer" + }, + { + "label": "Variables / notifyManager", + "to": "framework/lit/reference/variables/notifyManager" + }, + { + "label": "Variables / onlineManager", + "to": "framework/lit/reference/variables/onlineManager" + }, + { + "label": "Variables / skipToken", + "to": "framework/lit/reference/variables/skipToken" + }, + { + "label": "Variables / timeoutManager", + "to": "framework/lit/reference/variables/timeoutManager" + }, + { + "label": "Variables / unsetMarker", + "to": "framework/lit/reference/variables/unsetMarker" + } + ] + }, + { + "label": "angular", + "children": [ + { + "label": "Angular Reference", + "to": "framework/angular/reference/index" + }, + { + "label": "Functions / defaultShouldDehydrateMutation", + "to": "framework/angular/reference/functions/defaultShouldDehydrateMutation" + }, + { + "label": "Functions / defaultShouldDehydrateQuery", + "to": "framework/angular/reference/functions/defaultShouldDehydrateQuery" + }, + { + "label": "Functions / dehydrate", + "to": "framework/angular/reference/functions/dehydrate" + }, + { + "label": "Functions / dehydrateQuery", + "to": "framework/angular/reference/functions/dehydrateQuery" + }, + { + "label": "Functions / experimental_streamedQuery", + "to": "framework/angular/reference/functions/experimental_streamedQuery" + }, + { + "label": "Functions / hashKey", + "to": "framework/angular/reference/functions/hashKey" + }, + { + "label": "Functions / hydrate", + "to": "framework/angular/reference/functions/hydrate" + }, + { + "label": "Functions / infiniteQueryOptions", + "to": "framework/angular/reference/functions/infiniteQueryOptions" + }, + { + "label": "Functions / injectInfiniteQuery", + "to": "framework/angular/reference/functions/injectInfiniteQuery" + }, + { + "label": "Functions / injectIsFetching", + "to": "framework/angular/reference/functions/injectIsFetching" + }, + { + "label": "Functions / injectIsMutating", + "to": "framework/angular/reference/functions/injectIsMutating" + }, + { + "label": "Functions / injectIsRestoring", + "to": "framework/angular/reference/functions/injectIsRestoring" + }, + { + "label": "Functions / injectMutation", + "to": "framework/angular/reference/functions/injectMutation" + }, + { + "label": "Functions / injectMutationState", + "to": "framework/angular/reference/functions/injectMutationState" + }, + { + "label": "Functions / injectQuery", + "to": "framework/angular/reference/functions/injectQuery" + }, + { + "label": "Functions / injectQueryClient", + "to": "framework/angular/reference/functions/injectQueryClient" + }, + { + "label": "Functions / isCancelledError", + "to": "framework/angular/reference/functions/isCancelledError" + }, + { + "label": "Functions / keepPreviousData", + "to": "framework/angular/reference/functions/keepPreviousData" + }, + { + "label": "Functions / matchMutation", + "to": "framework/angular/reference/functions/matchMutation" + }, + { + "label": "Functions / matchQuery", + "to": "framework/angular/reference/functions/matchQuery" + }, + { + "label": "Functions / mutationOptions", + "to": "framework/angular/reference/functions/mutationOptions" + }, + { + "label": "Functions / noop", + "to": "framework/angular/reference/functions/noop" + }, + { + "label": "Functions / partialMatchKey", + "to": "framework/angular/reference/functions/partialMatchKey" + }, + { + "label": "Functions / provideAngularQuery", + "to": "framework/angular/reference/functions/provideAngularQuery" + }, + { + "label": "Functions / provideIsRestoring", + "to": "framework/angular/reference/functions/provideIsRestoring" + }, + { + "label": "Functions / provideQueryClient", + "to": "framework/angular/reference/functions/provideQueryClient" + }, + { + "label": "Functions / provideTanStackQuery", + "to": "framework/angular/reference/functions/provideTanStackQuery" + }, + { + "label": "Functions / queryFeature", + "to": "framework/angular/reference/functions/queryFeature" + }, + { + "label": "Functions / queryOptions", + "to": "framework/angular/reference/functions/queryOptions" + }, + { + "label": "Functions / replaceEqualDeep", + "to": "framework/angular/reference/functions/replaceEqualDeep" + }, + { + "label": "Functions / shouldThrowError", + "to": "framework/angular/reference/functions/shouldThrowError" + }, + { + "label": "Classes / CancelledError", + "to": "framework/angular/reference/classes/CancelledError" + }, + { + "label": "Classes / InfiniteQueryObserver", + "to": "framework/angular/reference/classes/InfiniteQueryObserver" + }, + { + "label": "Classes / Mutation", + "to": "framework/angular/reference/classes/Mutation" + }, + { + "label": "Classes / MutationCache", + "to": "framework/angular/reference/classes/MutationCache" + }, + { + "label": "Classes / MutationObserver", + "to": "framework/angular/reference/classes/MutationObserver" + }, + { + "label": "Classes / QueriesObserver", + "to": "framework/angular/reference/classes/QueriesObserver" + }, + { + "label": "Classes / Query", + "to": "framework/angular/reference/classes/Query" + }, + { + "label": "Classes / QueryCache", + "to": "framework/angular/reference/classes/QueryCache" + }, + { + "label": "Classes / QueryClient", + "to": "framework/angular/reference/classes/QueryClient" + }, + { + "label": "Classes / QueryObserver", + "to": "framework/angular/reference/classes/QueryObserver" + }, + { + "label": "Interfaces / BaseMutationNarrowing", + "to": "framework/angular/reference/interfaces/BaseMutationNarrowing" + }, + { + "label": "Interfaces / BaseQueryNarrowing", + "to": "framework/angular/reference/interfaces/BaseQueryNarrowing" + }, + { + "label": "Interfaces / CancelOptions", + "to": "framework/angular/reference/interfaces/CancelOptions" + }, + { + "label": "Interfaces / CreateBaseQueryOptions", + "to": "framework/angular/reference/interfaces/CreateBaseQueryOptions" + }, + { + "label": "Interfaces / CreateInfiniteQueryOptions", + "to": "framework/angular/reference/interfaces/CreateInfiniteQueryOptions" + }, + { + "label": "Interfaces / CreateMutationOptions", + "to": "framework/angular/reference/interfaces/CreateMutationOptions" + }, + { + "label": "Interfaces / CreateQueryOptions", + "to": "framework/angular/reference/interfaces/CreateQueryOptions" + }, + { + "label": "Interfaces / DefaultOptions", + "to": "framework/angular/reference/interfaces/DefaultOptions" + }, + { + "label": "Interfaces / DehydrateOptions", + "to": "framework/angular/reference/interfaces/DehydrateOptions" + }, + { + "label": "Interfaces / DehydratedState", + "to": "framework/angular/reference/interfaces/DehydratedState" + }, + { + "label": "Interfaces / EnsureQueryDataOptions", + "to": "framework/angular/reference/interfaces/EnsureQueryDataOptions" + }, + { + "label": "Interfaces / FetchNextPageOptions", + "to": "framework/angular/reference/interfaces/FetchNextPageOptions" + }, + { + "label": "Interfaces / FetchPreviousPageOptions", + "to": "framework/angular/reference/interfaces/FetchPreviousPageOptions" + }, + { + "label": "Interfaces / FetchQueryOptions", + "to": "framework/angular/reference/interfaces/FetchQueryOptions" + }, + { + "label": "Interfaces / HydrateOptions", + "to": "framework/angular/reference/interfaces/HydrateOptions" + }, + { + "label": "Interfaces / InfiniteData", + "to": "framework/angular/reference/interfaces/InfiniteData" + }, + { + "label": "Interfaces / InfiniteQueryObserverBaseResult", + "to": "framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverLoadingErrorResult", + "to": "framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverLoadingResult", + "to": "framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverOptions", + "to": "framework/angular/reference/interfaces/InfiniteQueryObserverOptions" + }, + { + "label": "Interfaces / InfiniteQueryObserverPendingResult", + "to": "framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverPlaceholderResult", + "to": "framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverRefetchErrorResult", + "to": "framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult" + }, + { + "label": "Interfaces / InfiniteQueryObserverSuccessResult", + "to": "framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult" + }, + { + "label": "Interfaces / InfiniteQueryPageParamsOptions", + "to": "framework/angular/reference/interfaces/InfiniteQueryPageParamsOptions" + }, + { + "label": "Interfaces / InitialPageParam", + "to": "framework/angular/reference/interfaces/InitialPageParam" + }, + { + "label": "Interfaces / InjectInfiniteQueryOptions", + "to": "framework/angular/reference/interfaces/InjectInfiniteQueryOptions" + }, + { + "label": "Interfaces / InjectIsFetchingOptions", + "to": "framework/angular/reference/interfaces/InjectIsFetchingOptions" + }, + { + "label": "Interfaces / InjectIsMutatingOptions", + "to": "framework/angular/reference/interfaces/InjectIsMutatingOptions" + }, + { + "label": "Interfaces / InjectMutationOptions", + "to": "framework/angular/reference/interfaces/InjectMutationOptions" + }, + { + "label": "Interfaces / InjectMutationStateOptions", + "to": "framework/angular/reference/interfaces/InjectMutationStateOptions" + }, + { + "label": "Interfaces / InjectQueryOptions", + "to": "framework/angular/reference/interfaces/InjectQueryOptions" + }, + { + "label": "Interfaces / InvalidateOptions", + "to": "framework/angular/reference/interfaces/InvalidateOptions" + }, + { + "label": "Interfaces / InvalidateQueryFilters", + "to": "framework/angular/reference/interfaces/InvalidateQueryFilters" + }, + { + "label": "Interfaces / MutateOptions", + "to": "framework/angular/reference/interfaces/MutateOptions" + }, + { + "label": "Interfaces / MutationCacheConfig", + "to": "framework/angular/reference/interfaces/MutationCacheConfig" + }, + { + "label": "Interfaces / MutationFilters", + "to": "framework/angular/reference/interfaces/MutationFilters" + }, + { + "label": "Interfaces / MutationObserverBaseResult", + "to": "framework/angular/reference/interfaces/MutationObserverBaseResult" + }, + { + "label": "Interfaces / MutationObserverErrorResult", + "to": "framework/angular/reference/interfaces/MutationObserverErrorResult" + }, + { + "label": "Interfaces / MutationObserverIdleResult", + "to": "framework/angular/reference/interfaces/MutationObserverIdleResult" + }, + { + "label": "Interfaces / MutationObserverLoadingResult", + "to": "framework/angular/reference/interfaces/MutationObserverLoadingResult" + }, + { + "label": "Interfaces / MutationObserverOptions", + "to": "framework/angular/reference/interfaces/MutationObserverOptions" + }, + { + "label": "Interfaces / MutationObserverSuccessResult", + "to": "framework/angular/reference/interfaces/MutationObserverSuccessResult" + }, + { + "label": "Interfaces / MutationOptions", + "to": "framework/angular/reference/interfaces/MutationOptions" + }, + { + "label": "Interfaces / MutationState", + "to": "framework/angular/reference/interfaces/MutationState" + }, + { + "label": "Interfaces / NotifyEvent", + "to": "framework/angular/reference/interfaces/NotifyEvent" + }, + { + "label": "Interfaces / QueriesObserverOptions", + "to": "framework/angular/reference/interfaces/QueriesObserverOptions" + }, + { + "label": "Interfaces / QueryCacheConfig", + "to": "framework/angular/reference/interfaces/QueryCacheConfig" + }, + { + "label": "Interfaces / QueryClientConfig", + "to": "framework/angular/reference/interfaces/QueryClientConfig" + }, + { + "label": "Interfaces / QueryExecuteOptions", + "to": "framework/angular/reference/interfaces/QueryExecuteOptions" + }, + { + "label": "Interfaces / QueryFeature", + "to": "framework/angular/reference/interfaces/QueryFeature" + }, + { + "label": "Interfaces / QueryFilters", + "to": "framework/angular/reference/interfaces/QueryFilters" + }, + { + "label": "Interfaces / QueryObserverBaseResult", + "to": "framework/angular/reference/interfaces/QueryObserverBaseResult" + }, + { + "label": "Interfaces / QueryObserverLoadingErrorResult", + "to": "framework/angular/reference/interfaces/QueryObserverLoadingErrorResult" + }, + { + "label": "Interfaces / QueryObserverLoadingResult", + "to": "framework/angular/reference/interfaces/QueryObserverLoadingResult" + }, + { + "label": "Interfaces / QueryObserverOptions", + "to": "framework/angular/reference/interfaces/QueryObserverOptions" + }, + { + "label": "Interfaces / QueryObserverPendingResult", + "to": "framework/angular/reference/interfaces/QueryObserverPendingResult" + }, + { + "label": "Interfaces / QueryObserverPlaceholderResult", + "to": "framework/angular/reference/interfaces/QueryObserverPlaceholderResult" + }, + { + "label": "Interfaces / QueryObserverRefetchErrorResult", + "to": "framework/angular/reference/interfaces/QueryObserverRefetchErrorResult" + }, + { + "label": "Interfaces / QueryObserverSuccessResult", + "to": "framework/angular/reference/interfaces/QueryObserverSuccessResult" + }, + { + "label": "Interfaces / QueryOptions", + "to": "framework/angular/reference/interfaces/QueryOptions" + }, + { + "label": "Interfaces / QueryState", + "to": "framework/angular/reference/interfaces/QueryState" + }, + { + "label": "Interfaces / RefetchOptions", + "to": "framework/angular/reference/interfaces/RefetchOptions" + }, + { + "label": "Interfaces / RefetchQueryFilters", + "to": "framework/angular/reference/interfaces/RefetchQueryFilters" + }, + { + "label": "Interfaces / Register", + "to": "framework/angular/reference/interfaces/Register" + }, + { + "label": "Interfaces / ResetOptions", + "to": "framework/angular/reference/interfaces/ResetOptions" + }, + { + "label": "Interfaces / ResultOptions", + "to": "framework/angular/reference/interfaces/ResultOptions" + }, + { + "label": "Interfaces / SetDataOptions", + "to": "framework/angular/reference/interfaces/SetDataOptions" + }, + { + "label": "Types / AnyDataTag", + "to": "framework/angular/reference/type-aliases/AnyDataTag" + }, + { + "label": "Types / CreateBaseMutationResult", + "to": "framework/angular/reference/type-aliases/CreateBaseMutationResult" + }, + { + "label": "Types / CreateBaseQueryResult", + "to": "framework/angular/reference/type-aliases/CreateBaseQueryResult" + }, + { + "label": "Types / CreateInfiniteQueryResult", + "to": "framework/angular/reference/type-aliases/CreateInfiniteQueryResult" + }, + { + "label": "Types / CreateMutateAsyncFunction", + "to": "framework/angular/reference/type-aliases/CreateMutateAsyncFunction" + }, + { + "label": "Types / CreateMutateFunction", + "to": "framework/angular/reference/type-aliases/CreateMutateFunction" + }, + { + "label": "Types / CreateMutationResult", + "to": "framework/angular/reference/type-aliases/CreateMutationResult" + }, + { + "label": "Types / CreateQueryResult", + "to": "framework/angular/reference/type-aliases/CreateQueryResult" + }, + { + "label": "Types / DataTag", + "to": "framework/angular/reference/type-aliases/DataTag" + }, + { + "label": "Types / DefaultError", + "to": "framework/angular/reference/type-aliases/DefaultError" + }, + { + "label": "Types / DefaultedInfiniteQueryObserverOptions", + "to": "framework/angular/reference/type-aliases/DefaultedInfiniteQueryObserverOptions" + }, + { + "label": "Types / DefaultedQueryObserverOptions", + "to": "framework/angular/reference/type-aliases/DefaultedQueryObserverOptions" + }, + { + "label": "Types / DefinedCreateInfiniteQueryResult", + "to": "framework/angular/reference/type-aliases/DefinedCreateInfiniteQueryResult" + }, + { + "label": "Types / DefinedCreateQueryResult", + "to": "framework/angular/reference/type-aliases/DefinedCreateQueryResult" + }, + { + "label": "Types / DefinedInfiniteQueryObserverResult", + "to": "framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult" + }, + { + "label": "Types / DefinedInitialDataInfiniteOptions", + "to": "framework/angular/reference/type-aliases/DefinedInitialDataInfiniteOptions" + }, + { + "label": "Types / DefinedInitialDataOptions", + "to": "framework/angular/reference/type-aliases/DefinedInitialDataOptions" + }, + { + "label": "Types / DefinedQueryObserverResult", + "to": "framework/angular/reference/type-aliases/DefinedQueryObserverResult" + }, + { + "label": "Types / DevtoolsFeature", + "to": "framework/angular/reference/type-aliases/DevtoolsFeature" + }, + { + "label": "Types / DistributiveOmit", + "to": "framework/angular/reference/type-aliases/DistributiveOmit" + }, + { + "label": "Types / EnsureInfiniteQueryDataOptions", + "to": "framework/angular/reference/type-aliases/EnsureInfiniteQueryDataOptions" + }, + { + "label": "Types / FetchInfiniteQueryOptions", + "to": "framework/angular/reference/type-aliases/FetchInfiniteQueryOptions" + }, + { + "label": "Types / FetchStatus", + "to": "framework/angular/reference/type-aliases/FetchStatus" + }, + { + "label": "Types / GetNextPageParamFunction", + "to": "framework/angular/reference/type-aliases/GetNextPageParamFunction" + }, + { + "label": "Types / GetPreviousPageParamFunction", + "to": "framework/angular/reference/type-aliases/GetPreviousPageParamFunction" + }, + { + "label": "Types / InferDataFromTag", + "to": "framework/angular/reference/type-aliases/InferDataFromTag" + }, + { + "label": "Types / InferErrorFromTag", + "to": "framework/angular/reference/type-aliases/InferErrorFromTag" + }, + { + "label": "Types / InfiniteQueryExecuteOptions", + "to": "framework/angular/reference/type-aliases/InfiniteQueryExecuteOptions" + }, + { + "label": "Types / InfiniteQueryObserverResult", + "to": "framework/angular/reference/type-aliases/InfiniteQueryObserverResult" + }, + { + "label": "Types / InitialDataFunction", + "to": "framework/angular/reference/type-aliases/InitialDataFunction" + }, + { + "label": "Types / ManagedTimerId", + "to": "framework/angular/reference/type-aliases/ManagedTimerId" + }, + { + "label": "Types / MutateFunction", + "to": "framework/angular/reference/type-aliases/MutateFunction" + }, + { + "label": "Types / MutateFunctionRest", + "to": "framework/angular/reference/type-aliases/MutateFunctionRest" + }, + { + "label": "Types / MutationCacheNotifyEvent", + "to": "framework/angular/reference/type-aliases/MutationCacheNotifyEvent" + }, + { + "label": "Types / MutationFunction", + "to": "framework/angular/reference/type-aliases/MutationFunction" + }, + { + "label": "Types / MutationFunctionContext", + "to": "framework/angular/reference/type-aliases/MutationFunctionContext" + }, + { + "label": "Types / MutationKey", + "to": "framework/angular/reference/type-aliases/MutationKey" + }, + { + "label": "Types / MutationMeta", + "to": "framework/angular/reference/type-aliases/MutationMeta" + }, + { + "label": "Types / MutationObserverResult", + "to": "framework/angular/reference/type-aliases/MutationObserverResult" + }, + { + "label": "Types / MutationScope", + "to": "framework/angular/reference/type-aliases/MutationScope" + }, + { + "label": "Types / MutationStatus", + "to": "framework/angular/reference/type-aliases/MutationStatus" + }, + { + "label": "Types / NetworkMode", + "to": "framework/angular/reference/type-aliases/NetworkMode" + }, + { + "label": "Types / NonUndefinedGuard", + "to": "framework/angular/reference/type-aliases/NonUndefinedGuard" + }, + { + "label": "Types / NotifyEventType", + "to": "framework/angular/reference/type-aliases/NotifyEventType" + }, + { + "label": "Types / NotifyOnChangeProps", + "to": "framework/angular/reference/type-aliases/NotifyOnChangeProps" + }, + { + "label": "Types / OmitKeyof", + "to": "framework/angular/reference/type-aliases/OmitKeyof" + }, + { + "label": "Types / Override", + "to": "framework/angular/reference/type-aliases/Override" + }, + { + "label": "Types / PersistQueryClientFeature", + "to": "framework/angular/reference/type-aliases/PersistQueryClientFeature" + }, + { + "label": "Types / PlaceholderDataFunction", + "to": "framework/angular/reference/type-aliases/PlaceholderDataFunction" + }, + { + "label": "Types / QueriesOptions", + "to": "framework/angular/reference/type-aliases/QueriesOptions" + }, + { + "label": "Types / QueriesPlaceholderDataFunction", + "to": "framework/angular/reference/type-aliases/QueriesPlaceholderDataFunction" + }, + { + "label": "Types / QueriesResults", + "to": "framework/angular/reference/type-aliases/QueriesResults" + }, + { + "label": "Types / QueryBooleanOption", + "to": "framework/angular/reference/type-aliases/QueryBooleanOption" + }, + { + "label": "Types / QueryCacheNotifyEvent", + "to": "framework/angular/reference/type-aliases/QueryCacheNotifyEvent" + }, + { + "label": "Types / QueryFeatures", + "to": "framework/angular/reference/type-aliases/QueryFeatures" + }, + { + "label": "Types / QueryFunction", + "to": "framework/angular/reference/type-aliases/QueryFunction" + }, + { + "label": "Types / QueryFunctionContext", + "to": "framework/angular/reference/type-aliases/QueryFunctionContext" + }, + { + "label": "Types / QueryKey", + "to": "framework/angular/reference/type-aliases/QueryKey" + }, + { + "label": "Types / QueryKeyHashFunction", + "to": "framework/angular/reference/type-aliases/QueryKeyHashFunction" + }, + { + "label": "Types / QueryKeyWithDataTag", + "to": "framework/angular/reference/type-aliases/QueryKeyWithDataTag" + }, + { + "label": "Types / QueryMeta", + "to": "framework/angular/reference/type-aliases/QueryMeta" + }, + { + "label": "Types / QueryObserverResult", + "to": "framework/angular/reference/type-aliases/QueryObserverResult" + }, + { + "label": "Types / QueryPersister", + "to": "framework/angular/reference/type-aliases/QueryPersister" + }, + { + "label": "Types / QueryStatus", + "to": "framework/angular/reference/type-aliases/QueryStatus" + }, + { + "label": "Types / SkipToken", + "to": "framework/angular/reference/type-aliases/SkipToken" + }, + { + "label": "Types / StaleTime", + "to": "framework/angular/reference/type-aliases/StaleTime" + }, + { + "label": "Types / StaleTimeFunction", + "to": "framework/angular/reference/type-aliases/StaleTimeFunction" + }, + { + "label": "Types / ThrowOnError", + "to": "framework/angular/reference/type-aliases/ThrowOnError" + }, + { + "label": "Types / TimeoutCallback", + "to": "framework/angular/reference/type-aliases/TimeoutCallback" + }, + { + "label": "Types / TimeoutProvider", + "to": "framework/angular/reference/type-aliases/TimeoutProvider" + }, + { + "label": "Types / UndefinedInitialDataInfiniteOptions", + "to": "framework/angular/reference/type-aliases/UndefinedInitialDataInfiniteOptions" + }, + { + "label": "Types / UndefinedInitialDataOptions", + "to": "framework/angular/reference/type-aliases/UndefinedInitialDataOptions" + }, + { + "label": "Types / UnsetMarker", + "to": "framework/angular/reference/type-aliases/UnsetMarker" + }, + { + "label": "Types / UnusedSkipTokenInfiniteOptions", + "to": "framework/angular/reference/type-aliases/UnusedSkipTokenInfiniteOptions" + }, + { + "label": "Types / UnusedSkipTokenOptions", + "to": "framework/angular/reference/type-aliases/UnusedSkipTokenOptions" + }, + { + "label": "Types / Updater", + "to": "framework/angular/reference/type-aliases/Updater" + }, + { + "label": "Types / WithRequired", + "to": "framework/angular/reference/type-aliases/WithRequired" + }, + { + "label": "Types / dataTagErrorSymbol", + "to": "framework/angular/reference/type-aliases/dataTagErrorSymbol" + }, + { + "label": "Types / dataTagSymbol", + "to": "framework/angular/reference/type-aliases/dataTagSymbol" + }, + { + "label": "Variables / dataTagErrorSymbol", + "to": "framework/angular/reference/variables/dataTagErrorSymbol" + }, + { + "label": "Variables / dataTagSymbol", + "to": "framework/angular/reference/variables/dataTagSymbol" + }, + { + "label": "Variables / defaultScheduler", + "to": "framework/angular/reference/variables/defaultScheduler" + }, + { + "label": "Variables / environmentManager", + "to": "framework/angular/reference/variables/environmentManager" + }, + { + "label": "Variables / focusManager", + "to": "framework/angular/reference/variables/focusManager" + }, + { + "label": "Variables / isServer", + "to": "framework/angular/reference/variables/isServer" + }, + { + "label": "Variables / notifyManager", + "to": "framework/angular/reference/variables/notifyManager" + }, + { + "label": "Variables / onlineManager", + "to": "framework/angular/reference/variables/onlineManager" + }, + { + "label": "Variables / skipToken", + "to": "framework/angular/reference/variables/skipToken" + }, + { + "label": "Variables / timeoutManager", + "to": "framework/angular/reference/variables/timeoutManager" + }, + { + "label": "Variables / unsetMarker", + "to": "framework/angular/reference/variables/unsetMarker" + } + ] + }, + { + "label": "preact", + "children": [ + { + "label": "Preact Reference", + "to": "framework/preact/reference/index" + }, + { + "label": "Functions / HydrationBoundary", + "to": "framework/preact/reference/functions/HydrationBoundary" + }, + { + "label": "Functions / QueryClientProvider", + "to": "framework/preact/reference/functions/QueryClientProvider" + }, + { + "label": "Functions / QueryErrorResetBoundary", + "to": "framework/preact/reference/functions/QueryErrorResetBoundary" + }, + { + "label": "Functions / defaultShouldDehydrateMutation", + "to": "framework/preact/reference/functions/defaultShouldDehydrateMutation" + }, + { + "label": "Functions / defaultShouldDehydrateQuery", + "to": "framework/preact/reference/functions/defaultShouldDehydrateQuery" + }, + { + "label": "Functions / dehydrate", + "to": "framework/preact/reference/functions/dehydrate" + }, + { + "label": "Functions / dehydrateQuery", + "to": "framework/preact/reference/functions/dehydrateQuery" + }, + { + "label": "Functions / experimental_streamedQuery", + "to": "framework/preact/reference/functions/experimental_streamedQuery" + }, + { + "label": "Functions / hashKey", + "to": "framework/preact/reference/functions/hashKey" + }, + { + "label": "Functions / hydrate", + "to": "framework/preact/reference/functions/hydrate" + }, + { + "label": "Functions / infiniteQueryOptions", + "to": "framework/preact/reference/functions/infiniteQueryOptions" + }, + { + "label": "Functions / isCancelledError", + "to": "framework/preact/reference/functions/isCancelledError" + }, + { + "label": "Functions / keepPreviousData", + "to": "framework/preact/reference/functions/keepPreviousData" + }, + { + "label": "Functions / matchMutation", + "to": "framework/preact/reference/functions/matchMutation" + }, + { + "label": "Functions / matchQuery", + "to": "framework/preact/reference/functions/matchQuery" + }, + { + "label": "Functions / mutationOptions", + "to": "framework/preact/reference/functions/mutationOptions" + }, + { + "label": "Functions / noop", + "to": "framework/preact/reference/functions/noop" + }, + { + "label": "Functions / partialMatchKey", + "to": "framework/preact/reference/functions/partialMatchKey" + }, + { + "label": "Functions / queryOptions", + "to": "framework/preact/reference/functions/queryOptions" + }, + { + "label": "Functions / replaceEqualDeep", + "to": "framework/preact/reference/functions/replaceEqualDeep" + }, + { + "label": "Functions / shouldThrowError", + "to": "framework/preact/reference/functions/shouldThrowError" + }, + { + "label": "Functions / useInfiniteQuery", + "to": "framework/preact/reference/functions/useInfiniteQuery" + }, + { + "label": "Functions / useIsFetching", + "to": "framework/preact/reference/functions/useIsFetching" + }, + { + "label": "Functions / useIsMutating", + "to": "framework/preact/reference/functions/useIsMutating" + }, + { + "label": "Functions / useIsRestoring", + "to": "framework/preact/reference/functions/useIsRestoring" + }, + { + "label": "Functions / useMutation", + "to": "framework/preact/reference/functions/useMutation" + }, + { + "label": "Functions / useMutationState", + "to": "framework/preact/reference/functions/useMutationState" + }, + { + "label": "Functions / usePrefetchInfiniteQuery", + "to": "framework/preact/reference/functions/usePrefetchInfiniteQuery" + }, + { + "label": "Functions / usePrefetchQuery", + "to": "framework/preact/reference/functions/usePrefetchQuery" + }, + { + "label": "Functions / useQueries", + "to": "framework/preact/reference/functions/useQueries" + }, + { + "label": "Functions / useQuery", + "to": "framework/preact/reference/functions/useQuery" + }, + { + "label": "Functions / useQueryClient", + "to": "framework/preact/reference/functions/useQueryClient" + }, + { + "label": "Functions / useQueryErrorResetBoundary", + "to": "framework/preact/reference/functions/useQueryErrorResetBoundary" + }, + { + "label": "Functions / useSuspenseInfiniteQuery", + "to": "framework/preact/reference/functions/useSuspenseInfiniteQuery" + }, + { + "label": "Functions / useSuspenseQueries", + "to": "framework/preact/reference/functions/useSuspenseQueries" + }, + { + "label": "Functions / useSuspenseQuery", + "to": "framework/preact/reference/functions/useSuspenseQuery" + }, + { + "label": "Classes / CancelledError", + "to": "framework/preact/reference/classes/CancelledError" + }, + { + "label": "Classes / InfiniteQueryObserver", + "to": "framework/preact/reference/classes/InfiniteQueryObserver" + }, + { + "label": "Classes / Mutation", + "to": "framework/preact/reference/classes/Mutation" + }, + { + "label": "Classes / MutationCache", + "to": "framework/preact/reference/classes/MutationCache" + }, + { + "label": "Classes / MutationObserver", + "to": "framework/preact/reference/classes/MutationObserver" + }, + { + "label": "Classes / QueriesObserver", + "to": "framework/preact/reference/classes/QueriesObserver" + }, + { + "label": "Classes / Query", + "to": "framework/preact/reference/classes/Query" + }, + { + "label": "Classes / QueryCache", + "to": "framework/preact/reference/classes/QueryCache" + }, + { + "label": "Classes / QueryClient", + "to": "framework/preact/reference/classes/QueryClient" + }, + { + "label": "Classes / QueryObserver", + "to": "framework/preact/reference/classes/QueryObserver" + }, + { + "label": "Interfaces / CancelOptions", + "to": "framework/preact/reference/interfaces/CancelOptions" + }, + { + "label": "Interfaces / DefaultOptions", + "to": "framework/preact/reference/interfaces/DefaultOptions" + }, + { + "label": "Interfaces / DehydrateOptions", + "to": "framework/preact/reference/interfaces/DehydrateOptions" + }, + { + "label": "Interfaces / DehydratedState", + "to": "framework/preact/reference/interfaces/DehydratedState" + }, + { + "label": "Interfaces / EnsureQueryDataOptions", + "to": "framework/preact/reference/interfaces/EnsureQueryDataOptions" + }, + { + "label": "Interfaces / FetchNextPageOptions", + "to": "framework/preact/reference/interfaces/FetchNextPageOptions" + }, + { + "label": "Interfaces / FetchPreviousPageOptions", + "to": "framework/preact/reference/interfaces/FetchPreviousPageOptions" }, { - "label": "Interfaces / InjectIsFetchingOptions", - "to": "framework/angular/reference/interfaces/InjectIsFetchingOptions" + "label": "Interfaces / FetchQueryOptions", + "to": "framework/preact/reference/interfaces/FetchQueryOptions" }, { - "label": "Interfaces / InjectIsMutatingOptions", - "to": "framework/angular/reference/interfaces/InjectIsMutatingOptions" + "label": "Interfaces / HydrateOptions", + "to": "framework/preact/reference/interfaces/HydrateOptions" }, { - "label": "Interfaces / InjectMutationOptions", - "to": "framework/angular/reference/interfaces/InjectMutationOptions" + "label": "Interfaces / HydrationBoundaryProps", + "to": "framework/preact/reference/interfaces/HydrationBoundaryProps" }, { - "label": "Interfaces / InjectMutationStateOptions", - "to": "framework/angular/reference/interfaces/InjectMutationStateOptions" + "label": "Interfaces / InfiniteData", + "to": "framework/preact/reference/interfaces/InfiniteData" }, { - "label": "Interfaces / InjectQueryOptions", - "to": "framework/angular/reference/interfaces/InjectQueryOptions" + "label": "Interfaces / InfiniteQueryObserverBaseResult", + "to": "framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult" }, { - "label": "Interfaces / QueryFeature", - "to": "framework/angular/reference/interfaces/QueryFeature" + "label": "Interfaces / InfiniteQueryObserverLoadingErrorResult", + "to": "framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult" }, { - "label": "Types / CreateBaseMutationResult", - "to": "framework/angular/reference/type-aliases/CreateBaseMutationResult" + "label": "Interfaces / InfiniteQueryObserverLoadingResult", + "to": "framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult" }, { - "label": "Types / CreateBaseQueryResult", - "to": "framework/angular/reference/type-aliases/CreateBaseQueryResult" + "label": "Interfaces / InfiniteQueryObserverOptions", + "to": "framework/preact/reference/interfaces/InfiniteQueryObserverOptions" }, { - "label": "Types / CreateInfiniteQueryResult", - "to": "framework/angular/reference/type-aliases/CreateInfiniteQueryResult" + "label": "Interfaces / InfiniteQueryObserverPendingResult", + "to": "framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult" }, { - "label": "Types / CreateMutateAsyncFunction", - "to": "framework/angular/reference/type-aliases/CreateMutateAsyncFunction" + "label": "Interfaces / InfiniteQueryObserverPlaceholderResult", + "to": "framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult" }, { - "label": "Types / CreateMutateFunction", - "to": "framework/angular/reference/type-aliases/CreateMutateFunction" + "label": "Interfaces / InfiniteQueryObserverRefetchErrorResult", + "to": "framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult" }, { - "label": "Types / CreateMutationResult", - "to": "framework/angular/reference/type-aliases/CreateMutationResult" + "label": "Interfaces / InfiniteQueryObserverSuccessResult", + "to": "framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult" }, { - "label": "Types / CreateQueryResult", - "to": "framework/angular/reference/type-aliases/CreateQueryResult" + "label": "Interfaces / InfiniteQueryPageParamsOptions", + "to": "framework/preact/reference/interfaces/InfiniteQueryPageParamsOptions" }, { - "label": "Types / DefinedCreateInfiniteQueryResult", - "to": "framework/angular/reference/type-aliases/DefinedCreateInfiniteQueryResult" + "label": "Interfaces / InitialPageParam", + "to": "framework/preact/reference/interfaces/InitialPageParam" }, { - "label": "Types / DefinedCreateQueryResult", - "to": "framework/angular/reference/type-aliases/DefinedCreateQueryResult" + "label": "Interfaces / InvalidateOptions", + "to": "framework/preact/reference/interfaces/InvalidateOptions" }, { - "label": "Types / DefinedInitialDataInfiniteOptions", - "to": "framework/angular/reference/type-aliases/DefinedInitialDataInfiniteOptions" + "label": "Interfaces / InvalidateQueryFilters", + "to": "framework/preact/reference/interfaces/InvalidateQueryFilters" }, { - "label": "Types / DefinedInitialDataOptions", - "to": "framework/angular/reference/type-aliases/DefinedInitialDataOptions" + "label": "Interfaces / MutateOptions", + "to": "framework/preact/reference/interfaces/MutateOptions" }, { - "label": "Types / DevtoolsFeature", - "to": "framework/angular/reference/type-aliases/DevtoolsFeature" + "label": "Interfaces / MutationCacheConfig", + "to": "framework/preact/reference/interfaces/MutationCacheConfig" }, { - "label": "Types / PersistQueryClientFeature", - "to": "framework/angular/reference/type-aliases/PersistQueryClientFeature" + "label": "Interfaces / MutationFilters", + "to": "framework/preact/reference/interfaces/MutationFilters" }, { - "label": "Types / QueriesOptions", - "to": "framework/angular/reference/type-aliases/QueriesOptions" + "label": "Interfaces / MutationObserverBaseResult", + "to": "framework/preact/reference/interfaces/MutationObserverBaseResult" }, { - "label": "Types / QueriesResults", - "to": "framework/angular/reference/type-aliases/QueriesResults" + "label": "Interfaces / MutationObserverErrorResult", + "to": "framework/preact/reference/interfaces/MutationObserverErrorResult" }, { - "label": "Types / QueryFeatures", - "to": "framework/angular/reference/type-aliases/QueryFeatures" + "label": "Interfaces / MutationObserverIdleResult", + "to": "framework/preact/reference/interfaces/MutationObserverIdleResult" }, { - "label": "Types / UndefinedInitialDataInfiniteOptions", - "to": "framework/angular/reference/type-aliases/UndefinedInitialDataInfiniteOptions" + "label": "Interfaces / MutationObserverLoadingResult", + "to": "framework/preact/reference/interfaces/MutationObserverLoadingResult" }, { - "label": "Types / UndefinedInitialDataOptions", - "to": "framework/angular/reference/type-aliases/UndefinedInitialDataOptions" + "label": "Interfaces / MutationObserverOptions", + "to": "framework/preact/reference/interfaces/MutationObserverOptions" }, { - "label": "Types / UnusedSkipTokenInfiniteOptions", - "to": "framework/angular/reference/type-aliases/UnusedSkipTokenInfiniteOptions" + "label": "Interfaces / MutationObserverSuccessResult", + "to": "framework/preact/reference/interfaces/MutationObserverSuccessResult" }, { - "label": "Types / UnusedSkipTokenOptions", - "to": "framework/angular/reference/type-aliases/UnusedSkipTokenOptions" - } - ] - }, - { - "label": "preact", - "children": [ + "label": "Interfaces / MutationOptions", + "to": "framework/preact/reference/interfaces/MutationOptions" + }, { - "label": "Preact Reference", - "to": "framework/preact/reference/index" + "label": "Interfaces / MutationState", + "to": "framework/preact/reference/interfaces/MutationState" }, { - "label": "Functions / useQuery", - "to": "framework/preact/reference/functions/useQuery" + "label": "Interfaces / NotifyEvent", + "to": "framework/preact/reference/interfaces/NotifyEvent" }, { - "label": "Functions / useQueries", - "to": "framework/preact/reference/functions/useQueries" + "label": "Interfaces / QueriesObserverOptions", + "to": "framework/preact/reference/interfaces/QueriesObserverOptions" }, { - "label": "Functions / useInfiniteQuery", - "to": "framework/preact/reference/functions/useInfiniteQuery" + "label": "Interfaces / QueryCacheConfig", + "to": "framework/preact/reference/interfaces/QueryCacheConfig" }, { - "label": "Functions / useMutation", - "to": "framework/preact/reference/functions/useMutation" + "label": "Interfaces / QueryClientConfig", + "to": "framework/preact/reference/interfaces/QueryClientConfig" }, { - "label": "Functions / useIsFetching", - "to": "framework/preact/reference/functions/useIsFetching" + "label": "Interfaces / QueryErrorResetBoundaryProps", + "to": "framework/preact/reference/interfaces/QueryErrorResetBoundaryProps" }, { - "label": "Functions / useIsMutating", - "to": "framework/preact/reference/functions/useIsMutating" + "label": "Interfaces / QueryExecuteOptions", + "to": "framework/preact/reference/interfaces/QueryExecuteOptions" }, { - "label": "Functions / useMutationState", - "to": "framework/preact/reference/functions/useMutationState" + "label": "Interfaces / QueryFilters", + "to": "framework/preact/reference/interfaces/QueryFilters" }, { - "label": "Functions / useSuspenseQuery", - "to": "framework/preact/reference/functions/useSuspenseQuery" + "label": "Interfaces / QueryObserverBaseResult", + "to": "framework/preact/reference/interfaces/QueryObserverBaseResult" }, { - "label": "Functions / useSuspenseInfiniteQuery", - "to": "framework/preact/reference/functions/useSuspenseInfiniteQuery" + "label": "Interfaces / QueryObserverLoadingErrorResult", + "to": "framework/preact/reference/interfaces/QueryObserverLoadingErrorResult" }, { - "label": "Functions / useSuspenseQueries", - "to": "framework/preact/reference/functions/useSuspenseQueries" + "label": "Interfaces / QueryObserverLoadingResult", + "to": "framework/preact/reference/interfaces/QueryObserverLoadingResult" }, { - "label": "Functions / QueryClientProvider", - "to": "framework/preact/reference/functions/QueryClientProvider" + "label": "Interfaces / QueryObserverOptions", + "to": "framework/preact/reference/interfaces/QueryObserverOptions" }, { - "label": "Functions / useQueryClient", - "to": "framework/preact/reference/functions/useQueryClient" + "label": "Interfaces / QueryObserverPendingResult", + "to": "framework/preact/reference/interfaces/QueryObserverPendingResult" }, { - "label": "Functions / queryOptions", - "to": "framework/preact/reference/functions/queryOptions" + "label": "Interfaces / QueryObserverPlaceholderResult", + "to": "framework/preact/reference/interfaces/QueryObserverPlaceholderResult" }, { - "label": "Functions / infiniteQueryOptions", - "to": "framework/preact/reference/functions/infiniteQueryOptions" + "label": "Interfaces / QueryObserverRefetchErrorResult", + "to": "framework/preact/reference/interfaces/QueryObserverRefetchErrorResult" }, { - "label": "Functions / mutationOptions", - "to": "framework/preact/reference/functions/mutationOptions" + "label": "Interfaces / QueryObserverSuccessResult", + "to": "framework/preact/reference/interfaces/QueryObserverSuccessResult" }, { - "label": "Functions / usePrefetchQuery", - "to": "framework/preact/reference/functions/usePrefetchQuery" + "label": "Interfaces / QueryOptions", + "to": "framework/preact/reference/interfaces/QueryOptions" }, { - "label": "Functions / usePrefetchInfiniteQuery", - "to": "framework/preact/reference/functions/usePrefetchInfiniteQuery" + "label": "Interfaces / QueryState", + "to": "framework/preact/reference/interfaces/QueryState" }, { - "label": "Functions / QueryErrorResetBoundary", - "to": "framework/preact/reference/functions/QueryErrorResetBoundary" + "label": "Interfaces / RefetchOptions", + "to": "framework/preact/reference/interfaces/RefetchOptions" }, { - "label": "Functions / useQueryErrorResetBoundary", - "to": "framework/preact/reference/functions/useQueryErrorResetBoundary" + "label": "Interfaces / RefetchQueryFilters", + "to": "framework/preact/reference/interfaces/RefetchQueryFilters" }, { - "label": "Functions / HydrationBoundary", - "to": "framework/preact/reference/functions/HydrationBoundary" + "label": "Interfaces / Register", + "to": "framework/preact/reference/interfaces/Register" }, { - "label": "Functions / useIsRestoring", - "to": "framework/preact/reference/functions/useIsRestoring" + "label": "Interfaces / ResetOptions", + "to": "framework/preact/reference/interfaces/ResetOptions" }, { - "label": "Interfaces / HydrationBoundaryProps", - "to": "framework/preact/reference/interfaces/HydrationBoundaryProps" + "label": "Interfaces / ResultOptions", + "to": "framework/preact/reference/interfaces/ResultOptions" }, { - "label": "Interfaces / QueryErrorResetBoundaryProps", - "to": "framework/preact/reference/interfaces/QueryErrorResetBoundaryProps" + "label": "Interfaces / SetDataOptions", + "to": "framework/preact/reference/interfaces/SetDataOptions" }, { "label": "Interfaces / UseBaseQueryOptions", @@ -2322,6 +6186,10 @@ "label": "Interfaces / UseSuspenseQueryOptions", "to": "framework/preact/reference/interfaces/UseSuspenseQueryOptions" }, + { + "label": "Types / AnyDataTag", + "to": "framework/preact/reference/type-aliases/AnyDataTag" + }, { "label": "Types / AnyUseBaseQueryOptions", "to": "framework/preact/reference/type-aliases/AnyUseBaseQueryOptions" @@ -2346,6 +6214,26 @@ "label": "Types / AnyUseSuspenseQueryOptions", "to": "framework/preact/reference/type-aliases/AnyUseSuspenseQueryOptions" }, + { + "label": "Types / DataTag", + "to": "framework/preact/reference/type-aliases/DataTag" + }, + { + "label": "Types / DefaultError", + "to": "framework/preact/reference/type-aliases/DefaultError" + }, + { + "label": "Types / DefaultedInfiniteQueryObserverOptions", + "to": "framework/preact/reference/type-aliases/DefaultedInfiniteQueryObserverOptions" + }, + { + "label": "Types / DefaultedQueryObserverOptions", + "to": "framework/preact/reference/type-aliases/DefaultedQueryObserverOptions" + }, + { + "label": "Types / DefinedInfiniteQueryObserverResult", + "to": "framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult" + }, { "label": "Types / DefinedInitialDataInfiniteOptions", "to": "framework/preact/reference/type-aliases/DefinedInitialDataInfiniteOptions" @@ -2354,6 +6242,10 @@ "label": "Types / DefinedInitialDataOptions", "to": "framework/preact/reference/type-aliases/DefinedInitialDataOptions" }, + { + "label": "Types / DefinedQueryObserverResult", + "to": "framework/preact/reference/type-aliases/DefinedQueryObserverResult" + }, { "label": "Types / DefinedUseInfiniteQueryResult", "to": "framework/preact/reference/type-aliases/DefinedUseInfiniteQueryResult" @@ -2362,14 +6254,142 @@ "label": "Types / DefinedUseQueryResult", "to": "framework/preact/reference/type-aliases/DefinedUseQueryResult" }, + { + "label": "Types / DistributiveOmit", + "to": "framework/preact/reference/type-aliases/DistributiveOmit" + }, + { + "label": "Types / EnsureInfiniteQueryDataOptions", + "to": "framework/preact/reference/type-aliases/EnsureInfiniteQueryDataOptions" + }, + { + "label": "Types / FetchInfiniteQueryOptions", + "to": "framework/preact/reference/type-aliases/FetchInfiniteQueryOptions" + }, + { + "label": "Types / FetchStatus", + "to": "framework/preact/reference/type-aliases/FetchStatus" + }, + { + "label": "Types / GetNextPageParamFunction", + "to": "framework/preact/reference/type-aliases/GetNextPageParamFunction" + }, + { + "label": "Types / GetPreviousPageParamFunction", + "to": "framework/preact/reference/type-aliases/GetPreviousPageParamFunction" + }, + { + "label": "Types / InferDataFromTag", + "to": "framework/preact/reference/type-aliases/InferDataFromTag" + }, + { + "label": "Types / InferErrorFromTag", + "to": "framework/preact/reference/type-aliases/InferErrorFromTag" + }, + { + "label": "Types / InfiniteQueryExecuteOptions", + "to": "framework/preact/reference/type-aliases/InfiniteQueryExecuteOptions" + }, + { + "label": "Types / InfiniteQueryObserverResult", + "to": "framework/preact/reference/type-aliases/InfiniteQueryObserverResult" + }, + { + "label": "Types / InitialDataFunction", + "to": "framework/preact/reference/type-aliases/InitialDataFunction" + }, + { + "label": "Types / ManagedTimerId", + "to": "framework/preact/reference/type-aliases/ManagedTimerId" + }, + { + "label": "Types / MutateFunction", + "to": "framework/preact/reference/type-aliases/MutateFunction" + }, + { + "label": "Types / MutateFunctionRest", + "to": "framework/preact/reference/type-aliases/MutateFunctionRest" + }, + { + "label": "Types / MutationCacheNotifyEvent", + "to": "framework/preact/reference/type-aliases/MutationCacheNotifyEvent" + }, + { + "label": "Types / MutationFunction", + "to": "framework/preact/reference/type-aliases/MutationFunction" + }, + { + "label": "Types / MutationFunctionContext", + "to": "framework/preact/reference/type-aliases/MutationFunctionContext" + }, + { + "label": "Types / MutationKey", + "to": "framework/preact/reference/type-aliases/MutationKey" + }, + { + "label": "Types / MutationMeta", + "to": "framework/preact/reference/type-aliases/MutationMeta" + }, + { + "label": "Types / MutationObserverResult", + "to": "framework/preact/reference/type-aliases/MutationObserverResult" + }, + { + "label": "Types / MutationScope", + "to": "framework/preact/reference/type-aliases/MutationScope" + }, + { + "label": "Types / MutationStatus", + "to": "framework/preact/reference/type-aliases/MutationStatus" + }, + { + "label": "Types / NetworkMode", + "to": "framework/preact/reference/type-aliases/NetworkMode" + }, + { + "label": "Types / NonUndefinedGuard", + "to": "framework/preact/reference/type-aliases/NonUndefinedGuard" + }, + { + "label": "Types / NotifyEventType", + "to": "framework/preact/reference/type-aliases/NotifyEventType" + }, + { + "label": "Types / NotifyOnChangeProps", + "to": "framework/preact/reference/type-aliases/NotifyOnChangeProps" + }, + { + "label": "Types / OmitKeyof", + "to": "framework/preact/reference/type-aliases/OmitKeyof" + }, + { + "label": "Types / Override", + "to": "framework/preact/reference/type-aliases/Override" + }, + { + "label": "Types / PlaceholderDataFunction", + "to": "framework/preact/reference/type-aliases/PlaceholderDataFunction" + }, { "label": "Types / QueriesOptions", "to": "framework/preact/reference/type-aliases/QueriesOptions" }, + { + "label": "Types / QueriesPlaceholderDataFunction", + "to": "framework/preact/reference/type-aliases/QueriesPlaceholderDataFunction" + }, { "label": "Types / QueriesResults", "to": "framework/preact/reference/type-aliases/QueriesResults" }, + { + "label": "Types / QueryBooleanOption", + "to": "framework/preact/reference/type-aliases/QueryBooleanOption" + }, + { + "label": "Types / QueryCacheNotifyEvent", + "to": "framework/preact/reference/type-aliases/QueryCacheNotifyEvent" + }, { "label": "Types / QueryClientProviderProps", "to": "framework/preact/reference/type-aliases/QueryClientProviderProps" @@ -2390,6 +6410,54 @@ "label": "Types / QueryErrorResetFunction", "to": "framework/preact/reference/type-aliases/QueryErrorResetFunction" }, + { + "label": "Types / QueryFunction", + "to": "framework/preact/reference/type-aliases/QueryFunction" + }, + { + "label": "Types / QueryFunctionContext", + "to": "framework/preact/reference/type-aliases/QueryFunctionContext" + }, + { + "label": "Types / QueryKey", + "to": "framework/preact/reference/type-aliases/QueryKey" + }, + { + "label": "Types / QueryKeyHashFunction", + "to": "framework/preact/reference/type-aliases/QueryKeyHashFunction" + }, + { + "label": "Types / QueryKeyWithDataTag", + "to": "framework/preact/reference/type-aliases/QueryKeyWithDataTag" + }, + { + "label": "Types / QueryMeta", + "to": "framework/preact/reference/type-aliases/QueryMeta" + }, + { + "label": "Types / QueryObserverResult", + "to": "framework/preact/reference/type-aliases/QueryObserverResult" + }, + { + "label": "Types / QueryPersister", + "to": "framework/preact/reference/type-aliases/QueryPersister" + }, + { + "label": "Types / QueryStatus", + "to": "framework/preact/reference/type-aliases/QueryStatus" + }, + { + "label": "Types / SkipToken", + "to": "framework/preact/reference/type-aliases/SkipToken" + }, + { + "label": "Types / StaleTime", + "to": "framework/preact/reference/type-aliases/StaleTime" + }, + { + "label": "Types / StaleTimeFunction", + "to": "framework/preact/reference/type-aliases/StaleTimeFunction" + }, { "label": "Types / SuspenseQueriesOptions", "to": "framework/preact/reference/type-aliases/SuspenseQueriesOptions" @@ -2398,6 +6466,18 @@ "label": "Types / SuspenseQueriesResults", "to": "framework/preact/reference/type-aliases/SuspenseQueriesResults" }, + { + "label": "Types / ThrowOnError", + "to": "framework/preact/reference/type-aliases/ThrowOnError" + }, + { + "label": "Types / TimeoutCallback", + "to": "framework/preact/reference/type-aliases/TimeoutCallback" + }, + { + "label": "Types / TimeoutProvider", + "to": "framework/preact/reference/type-aliases/TimeoutProvider" + }, { "label": "Types / UndefinedInitialDataInfiniteOptions", "to": "framework/preact/reference/type-aliases/UndefinedInitialDataInfiniteOptions" @@ -2406,6 +6486,10 @@ "label": "Types / UndefinedInitialDataOptions", "to": "framework/preact/reference/type-aliases/UndefinedInitialDataOptions" }, + { + "label": "Types / UnsetMarker", + "to": "framework/preact/reference/type-aliases/UnsetMarker" + }, { "label": "Types / UnusedSkipTokenInfiniteOptions", "to": "framework/preact/reference/type-aliases/UnusedSkipTokenInfiniteOptions" @@ -2414,6 +6498,10 @@ "label": "Types / UnusedSkipTokenOptions", "to": "framework/preact/reference/type-aliases/UnusedSkipTokenOptions" }, + { + "label": "Types / Updater", + "to": "framework/preact/reference/type-aliases/Updater" + }, { "label": "Types / UseBaseMutationResult", "to": "framework/preact/reference/type-aliases/UseBaseMutationResult" @@ -2458,6 +6546,18 @@ "label": "Types / UseSuspenseQueryResult", "to": "framework/preact/reference/type-aliases/UseSuspenseQueryResult" }, + { + "label": "Types / WithRequired", + "to": "framework/preact/reference/type-aliases/WithRequired" + }, + { + "label": "Types / dataTagErrorSymbol", + "to": "framework/preact/reference/type-aliases/dataTagErrorSymbol" + }, + { + "label": "Types / dataTagSymbol", + "to": "framework/preact/reference/type-aliases/dataTagSymbol" + }, { "label": "Variables / IsRestoringProvider", "to": "framework/preact/reference/variables/IsRestoringProvider" @@ -2465,6 +6565,50 @@ { "label": "Variables / QueryClientContext", "to": "framework/preact/reference/variables/QueryClientContext" + }, + { + "label": "Variables / dataTagErrorSymbol", + "to": "framework/preact/reference/variables/dataTagErrorSymbol" + }, + { + "label": "Variables / dataTagSymbol", + "to": "framework/preact/reference/variables/dataTagSymbol" + }, + { + "label": "Variables / defaultScheduler", + "to": "framework/preact/reference/variables/defaultScheduler" + }, + { + "label": "Variables / environmentManager", + "to": "framework/preact/reference/variables/environmentManager" + }, + { + "label": "Variables / focusManager", + "to": "framework/preact/reference/variables/focusManager" + }, + { + "label": "Variables / isServer", + "to": "framework/preact/reference/variables/isServer" + }, + { + "label": "Variables / notifyManager", + "to": "framework/preact/reference/variables/notifyManager" + }, + { + "label": "Variables / onlineManager", + "to": "framework/preact/reference/variables/onlineManager" + }, + { + "label": "Variables / skipToken", + "to": "framework/preact/reference/variables/skipToken" + }, + { + "label": "Variables / timeoutManager", + "to": "framework/preact/reference/variables/timeoutManager" + }, + { + "label": "Variables / unsetMarker", + "to": "framework/preact/reference/variables/unsetMarker" } ] } From a9bcab4d2685832ec241073fc95b11fb61d140a7 Mon Sep 17 00:00:00 2001 From: Wonsuk Choi Date: Mon, 7 Sep 2026 03:18:46 +0900 Subject: [PATCH 3/9] docs(query-core): migrate remaining prose from the legacy 'docs/reference' pages into JSDoc --- .../angular/reference/classes/Mutation.md | 5 +- .../reference/classes/MutationCache.md | 22 +++-- .../angular/reference/classes/QueryCache.md | 32 ++++--- .../angular/reference/classes/QueryClient.md | 93 +++++++++++-------- .../functions/experimental_streamedQuery.md | 6 +- .../reference/interfaces/CancelOptions.md | 6 +- .../interfaces/CreateMutationOptions.md | 26 +++--- .../reference/interfaces/DefaultOptions.md | 18 +++- .../interfaces/FetchNextPageOptions.md | 10 +- .../interfaces/FetchPreviousPageOptions.md | 10 +- .../InfiniteQueryObserverBaseResult.md | 68 +++++++------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 +++++++------- .../InfiniteQueryObserverLoadingResult.md | 68 +++++++------- .../InfiniteQueryObserverPendingResult.md | 68 +++++++------- .../InfiniteQueryObserverPlaceholderResult.md | 68 +++++++------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 +++++++------- .../InfiniteQueryObserverSuccessResult.md | 68 +++++++------- .../reference/interfaces/InvalidateOptions.md | 10 +- .../interfaces/InvalidateQueryFilters.md | 11 ++- .../reference/interfaces/MutateOptions.md | 8 +- .../interfaces/MutationObserverBaseResult.md | 22 ++--- .../interfaces/MutationObserverErrorResult.md | 22 ++--- .../interfaces/MutationObserverIdleResult.md | 22 ++--- .../MutationObserverLoadingResult.md | 22 ++--- .../interfaces/MutationObserverOptions.md | 28 +++--- .../MutationObserverSuccessResult.md | 22 ++--- .../reference/interfaces/MutationOptions.md | 26 +++--- .../reference/interfaces/NotifyEvent.md | 4 +- .../reference/interfaces/QueryCacheConfig.md | 11 ++- .../reference/interfaces/QueryClientConfig.md | 15 ++- .../interfaces/QueryObserverBaseResult.md | 52 +++++------ .../QueryObserverLoadingErrorResult.md | 52 +++++------ .../interfaces/QueryObserverLoadingResult.md | 52 +++++------ .../interfaces/QueryObserverPendingResult.md | 52 +++++------ .../QueryObserverPlaceholderResult.md | 52 +++++------ .../QueryObserverRefetchErrorResult.md | 52 +++++------ .../interfaces/QueryObserverSuccessResult.md | 52 +++++------ .../reference/interfaces/RefetchOptions.md | 10 +- .../interfaces/RefetchQueryFilters.md | 2 +- .../reference/interfaces/ResetOptions.md | 10 +- .../reference/interfaces/ResultOptions.md | 6 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +- .../reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryCacheNotifyEvent.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/TimeoutProvider.md | 16 +++- .../reference/variables/environmentManager.md | 19 +++- .../reference/variables/notifyManager.md | 14 ++- .../reference/variables/timeoutManager.md | 2 +- .../lit/reference/classes/Mutation.md | 5 +- .../lit/reference/classes/MutationCache.md | 22 +++-- .../lit/reference/classes/QueryCache.md | 32 ++++--- .../lit/reference/classes/QueryClient.md | 93 +++++++++++-------- .../functions/experimental_streamedQuery.md | 6 +- .../lit/reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 18 +++- .../interfaces/FetchNextPageOptions.md | 10 +- .../interfaces/FetchPreviousPageOptions.md | 10 +- .../InfiniteQueryObserverBaseResult.md | 68 +++++++------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 +++++++------- .../InfiniteQueryObserverLoadingResult.md | 68 +++++++------- .../InfiniteQueryObserverPendingResult.md | 68 +++++++------- .../InfiniteQueryObserverPlaceholderResult.md | 68 +++++++------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 +++++++------- .../InfiniteQueryObserverSuccessResult.md | 68 +++++++------- .../reference/interfaces/InvalidateOptions.md | 10 +- .../interfaces/InvalidateQueryFilters.md | 11 ++- .../lit/reference/interfaces/MutateOptions.md | 8 +- .../interfaces/MutationObserverBaseResult.md | 22 ++--- .../interfaces/MutationObserverErrorResult.md | 22 ++--- .../interfaces/MutationObserverIdleResult.md | 22 ++--- .../MutationObserverLoadingResult.md | 22 ++--- .../interfaces/MutationObserverOptions.md | 28 +++--- .../MutationObserverSuccessResult.md | 22 ++--- .../reference/interfaces/MutationOptions.md | 26 +++--- .../lit/reference/interfaces/NotifyEvent.md | 4 +- .../reference/interfaces/QueryCacheConfig.md | 11 ++- .../reference/interfaces/QueryClientConfig.md | 15 ++- .../interfaces/QueryObserverBaseResult.md | 52 +++++------ .../QueryObserverLoadingErrorResult.md | 52 +++++------ .../interfaces/QueryObserverLoadingResult.md | 52 +++++------ .../interfaces/QueryObserverPendingResult.md | 52 +++++------ .../QueryObserverPlaceholderResult.md | 52 +++++------ .../QueryObserverRefetchErrorResult.md | 52 +++++------ .../interfaces/QueryObserverSuccessResult.md | 52 +++++------ .../reference/interfaces/RefetchOptions.md | 10 +- .../interfaces/RefetchQueryFilters.md | 2 +- .../lit/reference/interfaces/ResetOptions.md | 10 +- .../lit/reference/interfaces/ResultOptions.md | 6 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../lit/reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +- .../lit/reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryCacheNotifyEvent.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../lit/reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/TimeoutProvider.md | 16 +++- .../reference/variables/environmentManager.md | 19 +++- .../lit/reference/variables/notifyManager.md | 14 ++- .../lit/reference/variables/timeoutManager.md | 2 +- .../preact/reference/classes/Mutation.md | 5 +- .../preact/reference/classes/MutationCache.md | 22 +++-- .../preact/reference/classes/QueryCache.md | 32 ++++--- .../preact/reference/classes/QueryClient.md | 93 +++++++++++-------- .../functions/experimental_streamedQuery.md | 6 +- .../reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 18 +++- .../interfaces/FetchNextPageOptions.md | 10 +- .../interfaces/FetchPreviousPageOptions.md | 10 +- .../InfiniteQueryObserverBaseResult.md | 68 +++++++------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 +++++++------- .../InfiniteQueryObserverLoadingResult.md | 68 +++++++------- .../InfiniteQueryObserverPendingResult.md | 68 +++++++------- .../InfiniteQueryObserverPlaceholderResult.md | 68 +++++++------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 +++++++------- .../InfiniteQueryObserverSuccessResult.md | 68 +++++++------- .../reference/interfaces/InvalidateOptions.md | 10 +- .../interfaces/InvalidateQueryFilters.md | 11 ++- .../reference/interfaces/MutateOptions.md | 8 +- .../interfaces/MutationObserverBaseResult.md | 22 ++--- .../interfaces/MutationObserverErrorResult.md | 22 ++--- .../interfaces/MutationObserverIdleResult.md | 22 ++--- .../MutationObserverLoadingResult.md | 22 ++--- .../interfaces/MutationObserverOptions.md | 28 +++--- .../MutationObserverSuccessResult.md | 22 ++--- .../reference/interfaces/MutationOptions.md | 26 +++--- .../reference/interfaces/NotifyEvent.md | 4 +- .../reference/interfaces/QueryCacheConfig.md | 11 ++- .../reference/interfaces/QueryClientConfig.md | 15 ++- .../interfaces/QueryObserverBaseResult.md | 52 +++++------ .../QueryObserverLoadingErrorResult.md | 52 +++++------ .../interfaces/QueryObserverLoadingResult.md | 52 +++++------ .../interfaces/QueryObserverPendingResult.md | 52 +++++------ .../QueryObserverPlaceholderResult.md | 52 +++++------ .../QueryObserverRefetchErrorResult.md | 52 +++++------ .../interfaces/QueryObserverSuccessResult.md | 52 +++++------ .../reference/interfaces/RefetchOptions.md | 10 +- .../interfaces/RefetchQueryFilters.md | 2 +- .../reference/interfaces/ResetOptions.md | 10 +- .../reference/interfaces/ResultOptions.md | 6 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../interfaces/UseMutationOptions.md | 26 +++--- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +- .../reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryCacheNotifyEvent.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/TimeoutProvider.md | 16 +++- .../reference/variables/environmentManager.md | 19 +++- .../reference/variables/notifyManager.md | 14 ++- .../reference/variables/timeoutManager.md | 2 +- .../react/reference/classes/Mutation.md | 5 +- .../react/reference/classes/MutationCache.md | 22 +++-- .../react/reference/classes/QueryCache.md | 32 ++++--- .../react/reference/classes/QueryClient.md | 93 +++++++++++-------- .../functions/experimental_streamedQuery.md | 6 +- .../reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 18 +++- .../interfaces/FetchNextPageOptions.md | 10 +- .../interfaces/FetchPreviousPageOptions.md | 10 +- .../InfiniteQueryObserverBaseResult.md | 68 +++++++------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 +++++++------- .../InfiniteQueryObserverLoadingResult.md | 68 +++++++------- .../InfiniteQueryObserverPendingResult.md | 68 +++++++------- .../InfiniteQueryObserverPlaceholderResult.md | 68 +++++++------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 +++++++------- .../InfiniteQueryObserverSuccessResult.md | 68 +++++++------- .../reference/interfaces/InvalidateOptions.md | 10 +- .../interfaces/InvalidateQueryFilters.md | 11 ++- .../reference/interfaces/MutateOptions.md | 8 +- .../interfaces/MutationObserverBaseResult.md | 22 ++--- .../interfaces/MutationObserverErrorResult.md | 22 ++--- .../interfaces/MutationObserverIdleResult.md | 22 ++--- .../MutationObserverLoadingResult.md | 22 ++--- .../interfaces/MutationObserverOptions.md | 28 +++--- .../MutationObserverSuccessResult.md | 22 ++--- .../reference/interfaces/MutationOptions.md | 26 +++--- .../react/reference/interfaces/NotifyEvent.md | 4 +- .../reference/interfaces/QueryCacheConfig.md | 11 ++- .../reference/interfaces/QueryClientConfig.md | 15 ++- .../interfaces/QueryObserverBaseResult.md | 52 +++++------ .../QueryObserverLoadingErrorResult.md | 52 +++++------ .../interfaces/QueryObserverLoadingResult.md | 52 +++++------ .../interfaces/QueryObserverPendingResult.md | 52 +++++------ .../QueryObserverPlaceholderResult.md | 52 +++++------ .../QueryObserverRefetchErrorResult.md | 52 +++++------ .../interfaces/QueryObserverSuccessResult.md | 52 +++++------ .../reference/interfaces/RefetchOptions.md | 10 +- .../interfaces/RefetchQueryFilters.md | 2 +- .../reference/interfaces/ResetOptions.md | 10 +- .../reference/interfaces/ResultOptions.md | 6 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../interfaces/UseMutationOptions.md | 26 +++--- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +- .../reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryCacheNotifyEvent.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/TimeoutProvider.md | 16 +++- .../reference/variables/environmentManager.md | 19 +++- .../reference/variables/notifyManager.md | 14 ++- .../reference/variables/timeoutManager.md | 2 +- .../solid/reference/classes/Mutation.md | 5 +- .../solid/reference/classes/MutationCache.md | 22 +++-- .../solid/reference/classes/QueryCache.md | 32 ++++--- .../solid/reference/classes/QueryClient.md | 87 +++++++++-------- .../functions/experimental_streamedQuery.md | 6 +- .../reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 14 ++- .../interfaces/FetchNextPageOptions.md | 10 +- .../interfaces/FetchPreviousPageOptions.md | 10 +- .../InfiniteQueryObserverBaseResult.md | 68 +++++++------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 +++++++------- .../InfiniteQueryObserverLoadingResult.md | 68 +++++++------- .../InfiniteQueryObserverPendingResult.md | 68 +++++++------- .../InfiniteQueryObserverPlaceholderResult.md | 68 +++++++------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 +++++++------- .../InfiniteQueryObserverSuccessResult.md | 68 +++++++------- .../reference/interfaces/InvalidateOptions.md | 10 +- .../interfaces/InvalidateQueryFilters.md | 11 ++- .../reference/interfaces/MutateOptions.md | 8 +- .../interfaces/MutationObserverBaseResult.md | 22 ++--- .../interfaces/MutationObserverErrorResult.md | 22 ++--- .../interfaces/MutationObserverIdleResult.md | 22 ++--- .../MutationObserverLoadingResult.md | 22 ++--- .../interfaces/MutationObserverOptions.md | 28 +++--- .../MutationObserverSuccessResult.md | 22 ++--- .../reference/interfaces/MutationOptions.md | 26 +++--- .../solid/reference/interfaces/NotifyEvent.md | 4 +- .../reference/interfaces/QueryCacheConfig.md | 11 ++- .../reference/interfaces/QueryClientConfig.md | 11 ++- .../interfaces/QueryObserverBaseResult.md | 52 +++++------ .../QueryObserverLoadingErrorResult.md | 52 +++++------ .../interfaces/QueryObserverLoadingResult.md | 52 +++++------ .../interfaces/QueryObserverPendingResult.md | 52 +++++------ .../QueryObserverPlaceholderResult.md | 52 +++++------ .../QueryObserverRefetchErrorResult.md | 52 +++++------ .../interfaces/QueryObserverSuccessResult.md | 52 +++++------ .../reference/interfaces/RefetchOptions.md | 10 +- .../interfaces/RefetchQueryFilters.md | 2 +- .../reference/interfaces/ResetOptions.md | 10 +- .../reference/interfaces/ResultOptions.md | 6 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +- .../reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryCacheNotifyEvent.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/TimeoutProvider.md | 16 +++- .../reference/variables/environmentManager.md | 19 +++- .../reference/variables/notifyManager.md | 14 ++- .../reference/variables/timeoutManager.md | 2 +- .../svelte/reference/classes/Mutation.md | 5 +- .../svelte/reference/classes/MutationCache.md | 22 +++-- .../svelte/reference/classes/QueryCache.md | 32 ++++--- .../svelte/reference/classes/QueryClient.md | 93 +++++++++++-------- .../functions/experimental_streamedQuery.md | 6 +- .../reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 18 +++- .../interfaces/FetchNextPageOptions.md | 10 +- .../interfaces/FetchPreviousPageOptions.md | 10 +- .../InfiniteQueryObserverBaseResult.md | 68 +++++++------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 +++++++------- .../InfiniteQueryObserverLoadingResult.md | 68 +++++++------- .../InfiniteQueryObserverPendingResult.md | 68 +++++++------- .../InfiniteQueryObserverPlaceholderResult.md | 68 +++++++------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 +++++++------- .../InfiniteQueryObserverSuccessResult.md | 68 +++++++------- .../reference/interfaces/InvalidateOptions.md | 10 +- .../interfaces/InvalidateQueryFilters.md | 11 ++- .../reference/interfaces/MutateOptions.md | 8 +- .../interfaces/MutationObserverBaseResult.md | 22 ++--- .../interfaces/MutationObserverErrorResult.md | 22 ++--- .../interfaces/MutationObserverIdleResult.md | 22 ++--- .../MutationObserverLoadingResult.md | 22 ++--- .../interfaces/MutationObserverOptions.md | 28 +++--- .../MutationObserverSuccessResult.md | 22 ++--- .../reference/interfaces/MutationOptions.md | 26 +++--- .../reference/interfaces/NotifyEvent.md | 4 +- .../reference/interfaces/QueryCacheConfig.md | 11 ++- .../reference/interfaces/QueryClientConfig.md | 15 ++- .../interfaces/QueryObserverBaseResult.md | 52 +++++------ .../QueryObserverLoadingErrorResult.md | 52 +++++------ .../interfaces/QueryObserverLoadingResult.md | 52 +++++------ .../interfaces/QueryObserverPendingResult.md | 52 +++++------ .../QueryObserverPlaceholderResult.md | 52 +++++------ .../QueryObserverRefetchErrorResult.md | 52 +++++------ .../interfaces/QueryObserverSuccessResult.md | 52 +++++------ .../reference/interfaces/RefetchOptions.md | 10 +- .../interfaces/RefetchQueryFilters.md | 2 +- .../reference/interfaces/ResetOptions.md | 10 +- .../reference/interfaces/ResultOptions.md | 6 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +- .../reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryCacheNotifyEvent.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/TimeoutProvider.md | 16 +++- .../reference/variables/environmentManager.md | 19 +++- .../reference/variables/notifyManager.md | 14 ++- .../reference/variables/timeoutManager.md | 2 +- .../vue/reference/classes/Mutation.md | 5 +- .../vue/reference/classes/MutationCache.md | 8 +- .../vue/reference/classes/QueryCache.md | 14 +-- .../vue/reference/classes/QueryClient.md | 39 +++++--- .../functions/experimental_streamedQuery.md | 6 +- .../vue/reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 18 +++- .../interfaces/FetchNextPageOptions.md | 10 +- .../interfaces/FetchPreviousPageOptions.md | 10 +- .../InfiniteQueryObserverBaseResult.md | 68 +++++++------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 +++++++------- .../InfiniteQueryObserverLoadingResult.md | 68 +++++++------- .../InfiniteQueryObserverPendingResult.md | 68 +++++++------- .../InfiniteQueryObserverPlaceholderResult.md | 68 +++++++------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 +++++++------- .../InfiniteQueryObserverSuccessResult.md | 68 +++++++------- .../reference/interfaces/InvalidateOptions.md | 10 +- .../interfaces/InvalidateQueryFilters.md | 11 ++- .../vue/reference/interfaces/MutateOptions.md | 8 +- .../interfaces/MutationObserverBaseResult.md | 22 ++--- .../interfaces/MutationObserverErrorResult.md | 22 ++--- .../interfaces/MutationObserverIdleResult.md | 22 ++--- .../MutationObserverLoadingResult.md | 22 ++--- .../interfaces/MutationObserverOptions.md | 28 +++--- .../MutationObserverSuccessResult.md | 22 ++--- .../vue/reference/interfaces/NotifyEvent.md | 4 +- .../reference/interfaces/QueryCacheConfig.md | 11 ++- .../reference/interfaces/QueryClientConfig.md | 15 ++- .../interfaces/QueryObserverBaseResult.md | 52 +++++------ .../QueryObserverLoadingErrorResult.md | 52 +++++------ .../interfaces/QueryObserverLoadingResult.md | 52 +++++------ .../interfaces/QueryObserverPendingResult.md | 52 +++++------ .../QueryObserverPlaceholderResult.md | 52 +++++------ .../QueryObserverRefetchErrorResult.md | 52 +++++------ .../interfaces/QueryObserverSuccessResult.md | 52 +++++------ .../reference/interfaces/RefetchOptions.md | 10 +- .../interfaces/RefetchQueryFilters.md | 2 +- .../vue/reference/interfaces/ResetOptions.md | 10 +- .../vue/reference/interfaces/ResultOptions.md | 6 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../vue/reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +- .../vue/reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryCacheNotifyEvent.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../vue/reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/TimeoutProvider.md | 16 +++- .../reference/variables/environmentManager.md | 19 +++- .../vue/reference/variables/notifyManager.md | 14 ++- .../vue/reference/variables/timeoutManager.md | 2 +- packages/query-core/src/environmentManager.ts | 16 +++- packages/query-core/src/mutationCache.ts | 7 ++ packages/query-core/src/notifyManager.ts | 11 ++- packages/query-core/src/queryCache.ts | 14 ++- packages/query-core/src/queryClient.ts | 20 +++- packages/query-core/src/streamedQuery.ts | 17 +++- packages/query-core/src/timeoutManager.ts | 6 ++ packages/query-core/src/types.ts | 23 +++++ 444 files changed, 5312 insertions(+), 4484 deletions(-) diff --git a/docs/framework/angular/reference/classes/Mutation.md b/docs/framework/angular/reference/classes/Mutation.md index dbbb75da0a8..4d328066b21 100644 --- a/docs/framework/angular/reference/classes/Mutation.md +++ b/docs/framework/angular/reference/classes/Mutation.md @@ -219,7 +219,7 @@ Removable.destroy execute(variables): Promise; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:169 +Defined in: packages/query-core/dist-ts/src/mutation.d.ts:170 Runs the mutation function for the given variables through a retryer, and drives the mutation's state and lifecycle callbacks through to settlement. @@ -254,7 +254,8 @@ the original error is re-thrown. #### Example ```ts -// typically invoked by MutationObserver.mutate, not called directly +// Called internally by `MutationObserver.mutate` and `Mutation.continue` — +// applications normally trigger mutations through those, not this method. const data = await mutation.execute(variables) ``` diff --git a/docs/framework/angular/reference/classes/MutationCache.md b/docs/framework/angular/reference/classes/MutationCache.md index 4b2494f5281..0b0b1b30bba 100644 --- a/docs/framework/angular/reference/classes/MutationCache.md +++ b/docs/framework/angular/reference/classes/MutationCache.md @@ -3,7 +3,7 @@ id: MutationCache title: MutationCache --- -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:68 +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:75 The `MutationCache` is the storage for mutations. @@ -11,6 +11,14 @@ Normally, you will not interact with the `MutationCache` directly and instead us `QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of safe/known updates to the cache, such as mutations being added, removed, or updated. +## Example + +```ts +const unsubscribe = mutationCache.subscribe((event) => { + console.log(event.type, event.mutation) +}) +``` + ## Extends - `Subscribable`\<`MutationCacheListener`\> @@ -23,7 +31,7 @@ safe/known updates to the cache, such as mutations being added, removed, or upda new MutationCache(config?): MutationCache; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:71 +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:78 #### Parameters @@ -49,7 +57,7 @@ Subscribable.constructor config: MutationCacheConfig; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:70 +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:77 *** @@ -75,7 +83,7 @@ Subscribable.listeners clear(): void; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:92 +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:99 Removes all mutations from the cache. @@ -101,7 +109,7 @@ find(filters): | undefined; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:122 +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:129 A slightly more advanced method that can be used to get an existing mutation instance from the cache. If the mutation does not exist, `undefined` is returned. @@ -158,7 +166,7 @@ const mutation = mutationCache.find({ mutationKey: ['addPost'] }) findAll(filters?): Mutation[]; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:138 +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:145 An even more advanced method that can be used to get existing mutation instances from the cache that match the given filters. If no mutations match, an empty array is returned. @@ -196,7 +204,7 @@ const mutations = mutationCache.findAll({ mutationKey: ['addPost'] }) getAll(): Mutation[]; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:106 +Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:113 Returns all mutations within the cache. diff --git a/docs/framework/angular/reference/classes/QueryCache.md b/docs/framework/angular/reference/classes/QueryCache.md index ab0ce089851..c8fd03d76f6 100644 --- a/docs/framework/angular/reference/classes/QueryCache.md +++ b/docs/framework/angular/reference/classes/QueryCache.md @@ -3,14 +3,24 @@ id: QueryCache title: QueryCache --- -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:75 +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:85 The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta information, and state of the queries it contains. Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient` for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of -safe/known updates to the cache, such as queries being added, removed, or updated. +safe/known updates to the cache, such as queries being added, removed, or updated — updates made +outside of the cache's own tracked mechanisms (e.g. mutating a query's state object directly) do +not notify subscribers. + +## Example + +```ts +const unsubscribe = queryCache.subscribe((event) => { + console.log(event.type, event.query) +}) +``` ## Extends @@ -24,7 +34,7 @@ safe/known updates to the cache, such as queries being added, removed, or update new QueryCache(config?): QueryCache; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:78 +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:88 #### Parameters @@ -50,7 +60,7 @@ Subscribable.constructor config: QueryCacheConfig; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:77 +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:87 *** @@ -79,7 +89,7 @@ build( state?): Query; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:95 +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:105 Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or builds and adds a new one to the cache if none exists yet. Used by framework adapters and @@ -141,7 +151,7 @@ const query = queryCache.build(queryClient, { clear(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:125 +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:135 Removes all queries from the cache. @@ -167,7 +177,7 @@ find(filters): | undefined; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:170 +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:180 A slightly more advanced method that can be used to get an existing query instance from the cache. This instance not only contains all the state for the query, but all of the instances, @@ -223,7 +233,7 @@ const query = queryCache.find({ queryKey: ['posts'] }) findAll(filters?): Query[]; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:186 +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:196 An even more advanced method that can be used to get existing query instances from the cache that partially match a query key. If no queries match, an empty array is returned. @@ -263,7 +273,7 @@ get(queryHash): | undefined; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:140 +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:150 Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none exists. Unlike [QueryCache#find](#find), this looks up by the already-computed hash rather @@ -316,7 +326,7 @@ const query = queryCache.get(queryHash) getAll(): Query[]; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:151 +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:161 Returns all queries within the cache. @@ -400,7 +410,7 @@ Subscribable.onUnsubscribe remove(query): void; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:114 +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:124 Destroys the given `Query` and removes it from the cache, notifying subscribers with a `'removed'` event. A no-op if the query is no longer the one currently stored under its hash diff --git a/docs/framework/angular/reference/classes/QueryClient.md b/docs/framework/angular/reference/classes/QueryClient.md index bdf6e3d07f9..3ba8886041b 100644 --- a/docs/framework/angular/reference/classes/QueryClient.md +++ b/docs/framework/angular/reference/classes/QueryClient.md @@ -3,12 +3,14 @@ id: QueryClient title: QueryClient --- -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:23 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:24 `QueryClient` is used to interact with a cache of queries and mutations. It owns a `QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds the default options that are applied to queries and mutations created through it. +## Example + ```ts const queryClient = new QueryClient({ defaultOptions: { @@ -29,7 +31,7 @@ await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts }) new QueryClient(config?): QueryClient; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:25 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:26 #### Parameters @@ -49,7 +51,7 @@ Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:25 cancelQueries(filters?, cancelOptions?): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:173 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:180 Cancels outgoing fetches for queries matching the given filters. Most useful when performing optimistic updates, since any outgoing refetch that resolves afterwards would otherwise @@ -92,7 +94,7 @@ await queryClient.cancelQueries({ queryKey: ['posts'], exact: true }) clear(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:420 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:430 Clears both the query cache and the mutation cache this client is connected to. @@ -117,7 +119,7 @@ queryClient.clear() defaultMutationOptions(options?): T; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:408 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:418 The mutation counterpart of [QueryClient#defaultQueryOptions](#defaultqueryoptions). Called by framework adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the @@ -148,7 +150,7 @@ on top. A no-op if the options are already defaulted (`_defaulted: true`). defaultQueryOptions(options): DefaultedQueryObserverOptions; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:401 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:411 Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the @@ -199,7 +201,7 @@ on top. A no-op if the options are already defaulted (`_defaulted: true`). ensureInfiniteQueryData(options): Promise>; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:274 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:284 #### Type Parameters @@ -245,7 +247,7 @@ Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This ensureQueryData(options): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:77 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:78 #### Type Parameters @@ -287,7 +289,7 @@ Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method fetchInfiniteQuery(options): Promise>; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:266 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:276 #### Type Parameters @@ -333,7 +335,7 @@ Use queryClient.infiniteQuery(options) instead. This method will be removed in t fetchQuery(options): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:236 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:246 #### Type Parameters @@ -379,7 +381,7 @@ Use queryClient.query(options) instead. This method will be removed in the next getDefaultOptions(): DefaultOptions; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:326 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:336 Returns the default options that were set when creating the client, or via [QueryClient#setDefaultOptions](#setdefaultoptions). @@ -405,7 +407,7 @@ const defaultOptions = queryClient.getDefaultOptions() getMutationCache(): MutationCache; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:313 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:323 Returns the mutation cache this client is connected to. @@ -431,7 +433,7 @@ const mutations = mutationCache.findAll({ status: 'pending' }) getMutationDefaults(mutationKey): OmitKeyof, "mutationKey">; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:394 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:404 Returns the default options registered for mutations whose mutation key partially matches the given `mutationKey`, via [QueryClient#setMutationDefaults](#setmutationdefaults). If multiple registered @@ -461,12 +463,18 @@ const defaultOptions = queryClient.getMutationDefaults(['addPost']) getQueriesData(filters): [readonly unknown[], TQueryFnData | undefined][]; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:89 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:96 Imperative (non-reactive) way to retrieve the cached data of multiple queries at once. Only queries matching the given filters are returned; if none match, an empty array is returned. +Because the matched queries can hold data of different shapes (e.g. a broad filter can match +queries with unrelated data types), the `TQueryFnData` generic defaults to `unknown` rather +than being inferred. Passing a more specific type is a convenience for call sites that know +every matched query holds the same shape — it is not checked against the actual cache +contents. + #### Type Parameters ##### TQueryFnData @@ -505,7 +513,7 @@ const data = queryClient.getQueriesData({ queryKey: ['posts'] }) getQueryCache(): QueryCache; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:300 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:310 Returns the query cache this client is connected to. @@ -531,7 +539,7 @@ const queries = queryCache.findAll({ queryKey: ['posts'] }) getQueryData(queryKey): TInferredQueryFnData | undefined; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:73 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:74 Imperative (non-reactive) way to retrieve data for a QueryKey. Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. @@ -575,7 +583,7 @@ Use `useQuery` to create a `QueryObserver` that subscribes to changes. getQueryDefaults(queryKey): OmitKeyof, "queryKey">; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:371 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:381 Returns the default options registered for queries whose query key partially matches the given `queryKey`, via [QueryClient#setQueryDefaults](#setquerydefaults). If multiple registered defaults @@ -607,7 +615,7 @@ getQueryState(options): Promise[] ? InfiniteData : TData>; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:262 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:272 Asynchronous method to fetch and cache an infinite query, resolving with an [InfiniteData](../interfaces/InfiniteData.md) object or throwing with the error. @@ -723,7 +731,7 @@ try { invalidateQueries(filters?, options?): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:187 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:194 Marks queries matching the given filters as invalidated. Unlike [QueryClient#removeQueries](#removequeries), invalidated queries stay in the cache. @@ -766,7 +774,7 @@ await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' isFetching(filters?): number; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:51 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:52 Returns the number of queries in the cache that are currently fetching, optionally matching a set of filters. This includes background-fetching, loading new pages, and @@ -804,7 +812,7 @@ if (queryClient.isFetching()) { isMutating(filters?): number; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:63 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:64 Returns the number of mutations in the cache that are currently pending, optionally matching a set of filters. @@ -841,7 +849,7 @@ if (queryClient.isMutating()) { mount(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:32 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:33 Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start listening for focus/online events and resume paused mutations. Ref-counted via an internal @@ -860,7 +868,7 @@ the shared listeners until the last one unmounts. prefetchInfiniteQuery(options): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:270 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:280 #### Type Parameters @@ -906,7 +914,7 @@ Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.ca prefetchQuery(options): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:240 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:250 #### Type Parameters @@ -948,7 +956,7 @@ Use queryClient.query(options) instead. You can swallow errors with `.catch(noop query(options): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:232 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:242 Asynchronous method to fetch and cache a query, resolving with the data or throwing with the error. @@ -958,12 +966,15 @@ If the query already exists in the cache and its data is not stale (per the give and the promise resolves once the fetch settles. If a `select` function is provided, it is applied to the data in both cases (cached or freshly fetched) before it is returned. -Unlike `useQuery`, retries are disabled by default here (`retry: false`) unless explicitly -configured, since there is no component to catch a thrown error and retry through re-render. +Unlike a reactive observer, retries are disabled by default here (`retry: false`) unless +explicitly configured, since there is no component to catch a thrown error and retry through +re-render. -The accepted options are a subset of `useQuery`'s options: fields that only make sense for a -reactive observer (e.g. `enabled`, `refetchInterval`, `refetchOnWindowFocus`, `notifyOnChangeProps`, -`throwOnError`, `suspense`, `placeholderData`) are not part of this method's options. +The accepted options are `QueryObserverOptions` minus the fields that only make sense for a +reactive observer — `enabled`, `refetchInterval`, `refetchIntervalInBackground`, +`refetchOnWindowFocus`, `refetchOnReconnect`, `refetchOnMount`, `retryOnMount`, +`notifyOnChangeProps`, `throwOnError`, `suspense`, and `placeholderData` are not part of this +method's options. This method replaces the deprecated `fetchQuery`, and — combined with `{ staleTime: 'static' }` — the deprecated `ensureQueryData`. @@ -1022,7 +1033,7 @@ try { refetchQueries(filters?, options?): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:203 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:210 Refetches queries matching the given filters, regardless of whether they are stale. Without filters, every query in the cache is refetched. Queries that are disabled, or static (only @@ -1067,7 +1078,7 @@ await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' }) removeQueries(filters?): void; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:148 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:155 Removes queries from the cache that match the given filters. Unlike [QueryClient#invalidateQueries](#invalidatequeries) or [QueryClient#refetchQueries](#refetchqueries), this removes @@ -1104,7 +1115,7 @@ queryClient.removeQueries({ queryKey: ['posts'], exact: true }) resetQueries(filters?, options?): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:159 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:166 Resets queries matching the given filters back to their initial state (e.g. any `initialData`), notifying subscribers rather than removing them. Active queries among the @@ -1144,7 +1155,7 @@ await queryClient.resetQueries({ queryKey: ['posts'], exact: true }) resumePausedMutations(): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:287 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:297 Resumes mutations that were paused because there was no network connection. Does nothing (resolving immediately) if the client is currently offline. @@ -1170,7 +1181,7 @@ await queryClient.resumePausedMutations() setDefaultOptions(options): void; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:344 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:354 Dynamically sets the default options for this client, overwriting any previously defined default options. @@ -1210,7 +1221,7 @@ queryClient.setDefaultOptions({ setMutationDefaults(mutationKey, options): void; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:383 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:393 Sets default options for mutations whose mutation key partially matches the given `mutationKey`. As with [QueryClient#setQueryDefaults](#setquerydefaults), the order of registration @@ -1269,7 +1280,7 @@ setQueriesData( options?): [readonly unknown[], TQueryFnData | undefined][]; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:125 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:132 Synchronous way to immediately update the cached data of multiple queries at once, using filters or partial query key matching. Only queries that already exist and match the given @@ -1323,7 +1334,7 @@ setQueryData( options?): NoInfer | undefined; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:111 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:118 Synchronous way to immediately update a query's cached data. If the updater (or the value passed) resolves to `undefined`, the cache is left untouched and no query is created; @@ -1387,7 +1398,7 @@ queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost]) setQueryDefaults(queryKey, options): void; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:360 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:370 Sets default options for queries whose query key partially matches the given `queryKey`. @@ -1444,7 +1455,7 @@ await queryClient.query({ queryKey: ['posts'] }) unmount(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:38 +Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:39 The inverse of [QueryClient#mount](#mount) — called by a framework adapter's `QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online diff --git a/docs/framework/angular/reference/functions/experimental_streamedQuery.md b/docs/framework/angular/reference/functions/experimental_streamedQuery.md index 48e65d02788..bd9ffcf366e 100644 --- a/docs/framework/angular/reference/functions/experimental_streamedQuery.md +++ b/docs/framework/angular/reference/functions/experimental_streamedQuery.md @@ -4,10 +4,10 @@ title: experimental_streamedQuery --- ```ts -function experimental_streamedQuery(queryFn): QueryFunction; +function experimental_streamedQuery(streamFn): QueryFunction; ``` -Defined in: packages/query-core/dist-ts/src/streamedQuery.d.ts:38 +Defined in: packages/query-core/dist-ts/src/streamedQuery.d.ts:53 This is a helper function to create a query function that streams data from an AsyncIterable. Data will be an Array of all the chunks received. @@ -30,7 +30,7 @@ The query will stay in fetchStatus 'fetching' until the stream ends. ## Parameters -### queryFn +### streamFn `StreamedQueryParams`\<`TQueryFnData`, `TData`, `TQueryKey`\> diff --git a/docs/framework/angular/reference/interfaces/CancelOptions.md b/docs/framework/angular/reference/interfaces/CancelOptions.md index 4e704d0bed7..6d8f8ff1ab9 100644 --- a/docs/framework/angular/reference/interfaces/CancelOptions.md +++ b/docs/framework/angular/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:855 +Defined in: packages/query-core/dist-ts/src/types.d.ts:878 ## Properties @@ -13,7 +13,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:855 optional revert: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:856 +Defined in: packages/query-core/dist-ts/src/types.d.ts:879 *** @@ -23,4 +23,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:856 optional silent: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:857 +Defined in: packages/query-core/dist-ts/src/types.d.ts:880 diff --git a/docs/framework/angular/reference/interfaces/CreateMutationOptions.md b/docs/framework/angular/reference/interfaces/CreateMutationOptions.md index 89b74ef20af..bfd8792f535 100644 --- a/docs/framework/angular/reference/interfaces/CreateMutationOptions.md +++ b/docs/framework/angular/reference/interfaces/CreateMutationOptions.md @@ -47,7 +47,7 @@ their `onMutateResult` parameter — useful for optimistic-update rollback data. optional gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:722 +Defined in: packages/query-core/dist-ts/src/types.d.ts:735 #### Inherited from @@ -61,7 +61,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:722 optional meta: Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:725 +Defined in: packages/query-core/dist-ts/src/types.d.ts:738 #### Inherited from @@ -75,7 +75,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:725 optional mutationFn: MutationFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:713 +Defined in: packages/query-core/dist-ts/src/types.d.ts:726 #### Inherited from @@ -91,7 +91,7 @@ OmitKeyof.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:714 +Defined in: packages/query-core/dist-ts/src/types.d.ts:727 #### Inherited from @@ -105,7 +105,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:714 optional networkMode: NetworkMode; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:721 +Defined in: packages/query-core/dist-ts/src/types.d.ts:734 #### Inherited from @@ -119,7 +119,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:721 optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:717 +Defined in: packages/query-core/dist-ts/src/types.d.ts:730 #### Parameters @@ -157,7 +157,7 @@ OmitKeyof.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:715 +Defined in: packages/query-core/dist-ts/src/types.d.ts:728 #### Parameters @@ -187,7 +187,7 @@ OmitKeyof.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:718 +Defined in: packages/query-core/dist-ts/src/types.d.ts:731 #### Parameters @@ -229,7 +229,7 @@ OmitKeyof.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:716 +Defined in: packages/query-core/dist-ts/src/types.d.ts:729 #### Parameters @@ -267,7 +267,7 @@ OmitKeyof.onSuccess optional retry: RetryValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:719 +Defined in: packages/query-core/dist-ts/src/types.d.ts:732 #### Inherited from @@ -283,7 +283,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:720 +Defined in: packages/query-core/dist-ts/src/types.d.ts:733 #### Inherited from @@ -299,7 +299,7 @@ OmitKeyof.retryDelay optional scope: MutationScope; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:726 +Defined in: packages/query-core/dist-ts/src/types.d.ts:739 #### Inherited from @@ -313,7 +313,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:726 optional throwOnError: boolean | (error) => boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:729 +Defined in: packages/query-core/dist-ts/src/types.d.ts:742 #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/DefaultOptions.md b/docs/framework/angular/reference/interfaces/DefaultOptions.md index 838ffd51fab..6a73a9c907a 100644 --- a/docs/framework/angular/reference/interfaces/DefaultOptions.md +++ b/docs/framework/angular/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:849 +Defined in: packages/query-core/dist-ts/src/types.d.ts:868 ## Type Parameters @@ -19,7 +19,9 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:849 optional dehydrate: DehydrateOptions; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:853 +Defined in: packages/query-core/dist-ts/src/types.d.ts:876 + +Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). *** @@ -29,7 +31,9 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:853 optional hydrate: object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:852 +Defined in: packages/query-core/dist-ts/src/types.d.ts:874 + +Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). #### deserializeData? @@ -63,7 +67,9 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:851 +Defined in: packages/query-core/dist-ts/src/types.d.ts:872 + +Default options applied to every mutation, unless overridden per-mutation. *** @@ -73,4 +79,6 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:851 optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:850 +Defined in: packages/query-core/dist-ts/src/types.d.ts:870 + +Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/angular/reference/interfaces/FetchNextPageOptions.md b/docs/framework/angular/reference/interfaces/FetchNextPageOptions.md index bd3ec3d10f9..16c2a10f990 100644 --- a/docs/framework/angular/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/angular/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:360 +Defined in: packages/query-core/dist-ts/src/types.d.ts:373 ## Extends @@ -17,7 +17,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:360 optional cancelRefetch: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:369 +Defined in: packages/query-core/dist-ts/src/types.d.ts:382 If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:339 +Defined in: packages/query-core/dist-ts/src/types.d.ts:344 + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/angular/reference/interfaces/FetchPreviousPageOptions.md index 6be5afcbd0d..1db86bcf72b 100644 --- a/docs/framework/angular/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/angular/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:371 +Defined in: packages/query-core/dist-ts/src/types.d.ts:384 ## Extends @@ -17,7 +17,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:371 optional cancelRefetch: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:380 +Defined in: packages/query-core/dist-ts/src/types.d.ts:393 If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:339 +Defined in: packages/query-core/dist-ts/src/types.d.ts:344 + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult.md index 2b4204d11b2..981cb650e9c 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:579 +Defined in: packages/query-core/dist-ts/src/types.d.ts:592 ## Extends @@ -36,7 +36,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:579 data: TData | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:388 +Defined in: packages/query-core/dist-ts/src/types.d.ts:401 The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:392 +Defined in: packages/query-core/dist-ts/src/types.d.ts:405 The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:397 +Defined in: packages/query-core/dist-ts/src/types.d.ts:410 The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:416 +Defined in: packages/query-core/dist-ts/src/types.d.ts:429 The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:401 +Defined in: packages/query-core/dist-ts/src/types.d.ts:414 The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:407 +Defined in: packages/query-core/dist-ts/src/types.d.ts:420 The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:412 +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:583 +Defined in: packages/query-core/dist-ts/src/types.d.ts:596 This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:587 +Defined in: packages/query-core/dist-ts/src/types.d.ts:600 This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:504 +Defined in: packages/query-core/dist-ts/src/types.d.ts:517 The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:591 +Defined in: packages/query-core/dist-ts/src/types.d.ts:604 Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:595 +Defined in: packages/query-core/dist-ts/src/types.d.ts:608 Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: packages/query-core/dist-ts/src/types.d.ts:497 `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:484 isError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:421 +Defined in: packages/query-core/dist-ts/src/types.d.ts:434 A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: packages/query-core/dist-ts/src/types.d.ts:438 Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:430 +Defined in: packages/query-core/dist-ts/src/types.d.ts:443 Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:435 +Defined in: packages/query-core/dist-ts/src/types.d.ts:448 A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:603 +Defined in: packages/query-core/dist-ts/src/types.d.ts:616 Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:611 +Defined in: packages/query-core/dist-ts/src/types.d.ts:624 Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:599 +Defined in: packages/query-core/dist-ts/src/types.d.ts:612 Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:607 +Defined in: packages/query-core/dist-ts/src/types.d.ts:620 Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: packages/query-core/dist-ts/src/types.d.ts:466 #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:440 +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:448 +Defined in: packages/query-core/dist-ts/src/types.d.ts:461 Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:458 +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:444 +Defined in: packages/query-core/dist-ts/src/types.d.ts:457 Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:462 +Defined in: packages/query-core/dist-ts/src/types.d.ts:475 Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:466 +Defined in: packages/query-core/dist-ts/src/types.d.ts:479 Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:475 +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:480 +Defined in: packages/query-core/dist-ts/src/types.d.ts:493 A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: packages/query-core/dist-ts/src/types.d.ts:501 A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:496 +Defined in: packages/query-core/dist-ts/src/types.d.ts:509 The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 956726e7728..7418f482838 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:640 +Defined in: packages/query-core/dist-ts/src/types.d.ts:653 ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:640 data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:641 +Defined in: packages/query-core/dist-ts/src/types.d.ts:654 The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:392 +Defined in: packages/query-core/dist-ts/src/types.d.ts:405 The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:642 +Defined in: packages/query-core/dist-ts/src/types.d.ts:655 The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:416 +Defined in: packages/query-core/dist-ts/src/types.d.ts:429 The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:401 +Defined in: packages/query-core/dist-ts/src/types.d.ts:414 The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:407 +Defined in: packages/query-core/dist-ts/src/types.d.ts:420 The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:412 +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:583 +Defined in: packages/query-core/dist-ts/src/types.d.ts:596 This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:587 +Defined in: packages/query-core/dist-ts/src/types.d.ts:600 This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:504 +Defined in: packages/query-core/dist-ts/src/types.d.ts:517 The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:591 +Defined in: packages/query-core/dist-ts/src/types.d.ts:604 Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:595 +Defined in: packages/query-core/dist-ts/src/types.d.ts:608 Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: packages/query-core/dist-ts/src/types.d.ts:497 `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:484 isError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:643 +Defined in: packages/query-core/dist-ts/src/types.d.ts:656 A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: packages/query-core/dist-ts/src/types.d.ts:438 Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:430 +Defined in: packages/query-core/dist-ts/src/types.d.ts:443 Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:435 +Defined in: packages/query-core/dist-ts/src/types.d.ts:448 A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:603 +Defined in: packages/query-core/dist-ts/src/types.d.ts:616 Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:611 +Defined in: packages/query-core/dist-ts/src/types.d.ts:624 Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:648 +Defined in: packages/query-core/dist-ts/src/types.d.ts:661 Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:649 +Defined in: packages/query-core/dist-ts/src/types.d.ts:662 Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: packages/query-core/dist-ts/src/types.d.ts:466 #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:645 +Defined in: packages/query-core/dist-ts/src/types.d.ts:658 Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:646 +Defined in: packages/query-core/dist-ts/src/types.d.ts:659 Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:458 +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:644 +Defined in: packages/query-core/dist-ts/src/types.d.ts:657 Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:651 +Defined in: packages/query-core/dist-ts/src/types.d.ts:664 Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:647 +Defined in: packages/query-core/dist-ts/src/types.d.ts:660 Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:475 +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:650 +Defined in: packages/query-core/dist-ts/src/types.d.ts:663 A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: packages/query-core/dist-ts/src/types.d.ts:501 A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:652 +Defined in: packages/query-core/dist-ts/src/types.d.ts:665 The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult.md index d6520e425d0..12d6c8d296b 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:626 +Defined in: packages/query-core/dist-ts/src/types.d.ts:639 ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:626 data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:627 +Defined in: packages/query-core/dist-ts/src/types.d.ts:640 The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:392 +Defined in: packages/query-core/dist-ts/src/types.d.ts:405 The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:628 +Defined in: packages/query-core/dist-ts/src/types.d.ts:641 The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:416 +Defined in: packages/query-core/dist-ts/src/types.d.ts:429 The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:401 +Defined in: packages/query-core/dist-ts/src/types.d.ts:414 The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:407 +Defined in: packages/query-core/dist-ts/src/types.d.ts:420 The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:412 +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:583 +Defined in: packages/query-core/dist-ts/src/types.d.ts:596 This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:587 +Defined in: packages/query-core/dist-ts/src/types.d.ts:600 This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:504 +Defined in: packages/query-core/dist-ts/src/types.d.ts:517 The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:591 +Defined in: packages/query-core/dist-ts/src/types.d.ts:604 Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:595 +Defined in: packages/query-core/dist-ts/src/types.d.ts:608 Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: packages/query-core/dist-ts/src/types.d.ts:497 `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:484 isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:629 +Defined in: packages/query-core/dist-ts/src/types.d.ts:642 A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: packages/query-core/dist-ts/src/types.d.ts:438 Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:430 +Defined in: packages/query-core/dist-ts/src/types.d.ts:443 Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:435 +Defined in: packages/query-core/dist-ts/src/types.d.ts:448 A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:603 +Defined in: packages/query-core/dist-ts/src/types.d.ts:616 Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:611 +Defined in: packages/query-core/dist-ts/src/types.d.ts:624 Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:634 +Defined in: packages/query-core/dist-ts/src/types.d.ts:647 Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:635 +Defined in: packages/query-core/dist-ts/src/types.d.ts:648 Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: packages/query-core/dist-ts/src/types.d.ts:466 #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:631 +Defined in: packages/query-core/dist-ts/src/types.d.ts:644 Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:632 +Defined in: packages/query-core/dist-ts/src/types.d.ts:645 Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:458 +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:630 +Defined in: packages/query-core/dist-ts/src/types.d.ts:643 Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:637 +Defined in: packages/query-core/dist-ts/src/types.d.ts:650 Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:633 +Defined in: packages/query-core/dist-ts/src/types.d.ts:646 Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:475 +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:636 +Defined in: packages/query-core/dist-ts/src/types.d.ts:649 A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: packages/query-core/dist-ts/src/types.d.ts:501 A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:638 +Defined in: packages/query-core/dist-ts/src/types.d.ts:651 The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult.md index 71b2ad1203c..775730f6200 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:613 +Defined in: packages/query-core/dist-ts/src/types.d.ts:626 ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:613 data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:614 +Defined in: packages/query-core/dist-ts/src/types.d.ts:627 The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:392 +Defined in: packages/query-core/dist-ts/src/types.d.ts:405 The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:615 +Defined in: packages/query-core/dist-ts/src/types.d.ts:628 The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:416 +Defined in: packages/query-core/dist-ts/src/types.d.ts:429 The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:401 +Defined in: packages/query-core/dist-ts/src/types.d.ts:414 The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:407 +Defined in: packages/query-core/dist-ts/src/types.d.ts:420 The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:412 +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:583 +Defined in: packages/query-core/dist-ts/src/types.d.ts:596 This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:587 +Defined in: packages/query-core/dist-ts/src/types.d.ts:600 This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:504 +Defined in: packages/query-core/dist-ts/src/types.d.ts:517 The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:591 +Defined in: packages/query-core/dist-ts/src/types.d.ts:604 Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:595 +Defined in: packages/query-core/dist-ts/src/types.d.ts:608 Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: packages/query-core/dist-ts/src/types.d.ts:497 `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:484 isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:616 +Defined in: packages/query-core/dist-ts/src/types.d.ts:629 A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: packages/query-core/dist-ts/src/types.d.ts:438 Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:430 +Defined in: packages/query-core/dist-ts/src/types.d.ts:443 Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:435 +Defined in: packages/query-core/dist-ts/src/types.d.ts:448 A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:603 +Defined in: packages/query-core/dist-ts/src/types.d.ts:616 Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:611 +Defined in: packages/query-core/dist-ts/src/types.d.ts:624 Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:620 +Defined in: packages/query-core/dist-ts/src/types.d.ts:633 Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:621 +Defined in: packages/query-core/dist-ts/src/types.d.ts:634 Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: packages/query-core/dist-ts/src/types.d.ts:466 #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:440 +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:618 +Defined in: packages/query-core/dist-ts/src/types.d.ts:631 Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:458 +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:617 +Defined in: packages/query-core/dist-ts/src/types.d.ts:630 Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:623 +Defined in: packages/query-core/dist-ts/src/types.d.ts:636 Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:619 +Defined in: packages/query-core/dist-ts/src/types.d.ts:632 Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:475 +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:622 +Defined in: packages/query-core/dist-ts/src/types.d.ts:635 A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: packages/query-core/dist-ts/src/types.d.ts:501 A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:624 +Defined in: packages/query-core/dist-ts/src/types.d.ts:637 The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index d9fea0e9b28..c85ec282368 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:680 +Defined in: packages/query-core/dist-ts/src/types.d.ts:693 ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:680 data: TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:681 +Defined in: packages/query-core/dist-ts/src/types.d.ts:694 The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:392 +Defined in: packages/query-core/dist-ts/src/types.d.ts:405 The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:683 +Defined in: packages/query-core/dist-ts/src/types.d.ts:696 The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:416 +Defined in: packages/query-core/dist-ts/src/types.d.ts:429 The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:401 +Defined in: packages/query-core/dist-ts/src/types.d.ts:414 The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:407 +Defined in: packages/query-core/dist-ts/src/types.d.ts:420 The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:412 +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:583 +Defined in: packages/query-core/dist-ts/src/types.d.ts:596 This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:587 +Defined in: packages/query-core/dist-ts/src/types.d.ts:600 This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:504 +Defined in: packages/query-core/dist-ts/src/types.d.ts:517 The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:591 +Defined in: packages/query-core/dist-ts/src/types.d.ts:604 Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:595 +Defined in: packages/query-core/dist-ts/src/types.d.ts:608 Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: packages/query-core/dist-ts/src/types.d.ts:497 `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:484 isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:682 +Defined in: packages/query-core/dist-ts/src/types.d.ts:695 A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: packages/query-core/dist-ts/src/types.d.ts:438 Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:430 +Defined in: packages/query-core/dist-ts/src/types.d.ts:443 Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:435 +Defined in: packages/query-core/dist-ts/src/types.d.ts:448 A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:603 +Defined in: packages/query-core/dist-ts/src/types.d.ts:616 Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:611 +Defined in: packages/query-core/dist-ts/src/types.d.ts:624 Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:690 +Defined in: packages/query-core/dist-ts/src/types.d.ts:703 Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:691 +Defined in: packages/query-core/dist-ts/src/types.d.ts:704 Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: packages/query-core/dist-ts/src/types.d.ts:466 #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:685 +Defined in: packages/query-core/dist-ts/src/types.d.ts:698 Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:686 +Defined in: packages/query-core/dist-ts/src/types.d.ts:699 Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:458 +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:684 +Defined in: packages/query-core/dist-ts/src/types.d.ts:697 Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:689 +Defined in: packages/query-core/dist-ts/src/types.d.ts:702 Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:687 +Defined in: packages/query-core/dist-ts/src/types.d.ts:700 Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:475 +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:688 +Defined in: packages/query-core/dist-ts/src/types.d.ts:701 A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: packages/query-core/dist-ts/src/types.d.ts:501 A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:692 +Defined in: packages/query-core/dist-ts/src/types.d.ts:705 The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index 64b206abc12..d914f0d80ab 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:654 +Defined in: packages/query-core/dist-ts/src/types.d.ts:667 ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:654 data: TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:655 +Defined in: packages/query-core/dist-ts/src/types.d.ts:668 The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:392 +Defined in: packages/query-core/dist-ts/src/types.d.ts:405 The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:656 +Defined in: packages/query-core/dist-ts/src/types.d.ts:669 The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:416 +Defined in: packages/query-core/dist-ts/src/types.d.ts:429 The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:401 +Defined in: packages/query-core/dist-ts/src/types.d.ts:414 The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:407 +Defined in: packages/query-core/dist-ts/src/types.d.ts:420 The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:412 +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:583 +Defined in: packages/query-core/dist-ts/src/types.d.ts:596 This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:587 +Defined in: packages/query-core/dist-ts/src/types.d.ts:600 This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:504 +Defined in: packages/query-core/dist-ts/src/types.d.ts:517 The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:591 +Defined in: packages/query-core/dist-ts/src/types.d.ts:604 Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:595 +Defined in: packages/query-core/dist-ts/src/types.d.ts:608 Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: packages/query-core/dist-ts/src/types.d.ts:497 `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:484 isError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:657 +Defined in: packages/query-core/dist-ts/src/types.d.ts:670 A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: packages/query-core/dist-ts/src/types.d.ts:438 Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:430 +Defined in: packages/query-core/dist-ts/src/types.d.ts:443 Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:435 +Defined in: packages/query-core/dist-ts/src/types.d.ts:448 A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:603 +Defined in: packages/query-core/dist-ts/src/types.d.ts:616 Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:611 +Defined in: packages/query-core/dist-ts/src/types.d.ts:624 Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:599 +Defined in: packages/query-core/dist-ts/src/types.d.ts:612 Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:607 +Defined in: packages/query-core/dist-ts/src/types.d.ts:620 Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: packages/query-core/dist-ts/src/types.d.ts:466 #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:659 +Defined in: packages/query-core/dist-ts/src/types.d.ts:672 Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:660 +Defined in: packages/query-core/dist-ts/src/types.d.ts:673 Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:458 +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:658 +Defined in: packages/query-core/dist-ts/src/types.d.ts:671 Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:663 +Defined in: packages/query-core/dist-ts/src/types.d.ts:676 Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:661 +Defined in: packages/query-core/dist-ts/src/types.d.ts:674 Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:475 +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:662 +Defined in: packages/query-core/dist-ts/src/types.d.ts:675 A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: packages/query-core/dist-ts/src/types.d.ts:501 A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:664 +Defined in: packages/query-core/dist-ts/src/types.d.ts:677 The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 4753b83e279..44a718888ed 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:666 +Defined in: packages/query-core/dist-ts/src/types.d.ts:679 ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:666 data: TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:667 +Defined in: packages/query-core/dist-ts/src/types.d.ts:680 The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:392 +Defined in: packages/query-core/dist-ts/src/types.d.ts:405 The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:668 +Defined in: packages/query-core/dist-ts/src/types.d.ts:681 The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:416 +Defined in: packages/query-core/dist-ts/src/types.d.ts:429 The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:401 +Defined in: packages/query-core/dist-ts/src/types.d.ts:414 The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:407 +Defined in: packages/query-core/dist-ts/src/types.d.ts:420 The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:412 +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:583 +Defined in: packages/query-core/dist-ts/src/types.d.ts:596 This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:587 +Defined in: packages/query-core/dist-ts/src/types.d.ts:600 This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:504 +Defined in: packages/query-core/dist-ts/src/types.d.ts:517 The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:591 +Defined in: packages/query-core/dist-ts/src/types.d.ts:604 Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:595 +Defined in: packages/query-core/dist-ts/src/types.d.ts:608 Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: packages/query-core/dist-ts/src/types.d.ts:497 `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:484 isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:669 +Defined in: packages/query-core/dist-ts/src/types.d.ts:682 A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: packages/query-core/dist-ts/src/types.d.ts:438 Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:430 +Defined in: packages/query-core/dist-ts/src/types.d.ts:443 Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:435 +Defined in: packages/query-core/dist-ts/src/types.d.ts:448 A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:603 +Defined in: packages/query-core/dist-ts/src/types.d.ts:616 Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:611 +Defined in: packages/query-core/dist-ts/src/types.d.ts:624 Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:674 +Defined in: packages/query-core/dist-ts/src/types.d.ts:687 Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:675 +Defined in: packages/query-core/dist-ts/src/types.d.ts:688 Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: packages/query-core/dist-ts/src/types.d.ts:466 #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:671 +Defined in: packages/query-core/dist-ts/src/types.d.ts:684 Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:672 +Defined in: packages/query-core/dist-ts/src/types.d.ts:685 Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:458 +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:670 +Defined in: packages/query-core/dist-ts/src/types.d.ts:683 Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:677 +Defined in: packages/query-core/dist-ts/src/types.d.ts:690 Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:673 +Defined in: packages/query-core/dist-ts/src/types.d.ts:686 Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:475 +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:676 +Defined in: packages/query-core/dist-ts/src/types.d.ts:689 A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: packages/query-core/dist-ts/src/types.d.ts:501 A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:678 +Defined in: packages/query-core/dist-ts/src/types.d.ts:691 The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InvalidateOptions.md b/docs/framework/angular/reference/interfaces/InvalidateOptions.md index b9379fc841d..8eff9d55ad4 100644 --- a/docs/framework/angular/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/angular/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:356 +Defined in: packages/query-core/dist-ts/src/types.d.ts:369 ## Extends @@ -17,7 +17,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:356 optional cancelRefetch: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:349 +Defined in: packages/query-core/dist-ts/src/types.d.ts:354 If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:339 +Defined in: packages/query-core/dist-ts/src/types.d.ts:344 + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/angular/reference/interfaces/InvalidateQueryFilters.md index 098a8172342..849f946e918 100644 --- a/docs/framework/angular/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/angular/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:351 +Defined in: packages/query-core/dist-ts/src/types.d.ts:356 Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -100,7 +100,14 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:352 +Defined in: packages/query-core/dist-ts/src/types.d.ts:365 + +Controls which of the matched (now-invalidated) queries are refetched in the background. +Defaults to `'active'`. +- `'active'`: only queries with at least one active observer are refetched. +- `'inactive'`: only queries with no active observer are refetched. +- `'all'`: every matched query is refetched, active or not. +- `'none'`: no query is refetched; matched queries are only marked as invalidated. *** diff --git a/docs/framework/angular/reference/interfaces/MutateOptions.md b/docs/framework/angular/reference/interfaces/MutateOptions.md index eecdf77cdff..d9a2080253f 100644 --- a/docs/framework/angular/reference/interfaces/MutateOptions.md +++ b/docs/framework/angular/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:731 +Defined in: packages/query-core/dist-ts/src/types.d.ts:744 ## Type Parameters @@ -31,7 +31,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:731 optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:733 +Defined in: packages/query-core/dist-ts/src/types.d.ts:746 #### Parameters @@ -63,7 +63,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:733 optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:734 +Defined in: packages/query-core/dist-ts/src/types.d.ts:747 #### Parameters @@ -99,7 +99,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:734 optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:732 +Defined in: packages/query-core/dist-ts/src/types.d.ts:745 #### Parameters diff --git a/docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md index d9599c54af6..df0b4edaeca 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:744 +Defined in: packages/query-core/dist-ts/src/types.d.ts:757 The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:748 +Defined in: packages/query-core/dist-ts/src/types.d.ts:761 The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:757 +Defined in: packages/query-core/dist-ts/src/types.d.ts:770 The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:762 +Defined in: packages/query-core/dist-ts/src/types.d.ts:775 A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:767 +Defined in: packages/query-core/dist-ts/src/types.d.ts:780 A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:772 +Defined in: packages/query-core/dist-ts/src/types.d.ts:785 A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:777 +Defined in: packages/query-core/dist-ts/src/types.d.ts:790 A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:797 +Defined in: packages/query-core/dist-ts/src/types.d.ts:810 The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:801 +Defined in: packages/query-core/dist-ts/src/types.d.ts:814 A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:786 +Defined in: packages/query-core/dist-ts/src/types.d.ts:799 The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:752 +Defined in: packages/query-core/dist-ts/src/types.d.ts:765 The variables object passed to the `mutationFn`. diff --git a/docs/framework/angular/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/angular/reference/interfaces/MutationObserverErrorResult.md index bd010e5549e..d22b2ec7e46 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:823 +Defined in: packages/query-core/dist-ts/src/types.d.ts:836 The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:824 +Defined in: packages/query-core/dist-ts/src/types.d.ts:837 The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:825 +Defined in: packages/query-core/dist-ts/src/types.d.ts:838 The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:827 +Defined in: packages/query-core/dist-ts/src/types.d.ts:840 A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:828 +Defined in: packages/query-core/dist-ts/src/types.d.ts:841 A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:829 +Defined in: packages/query-core/dist-ts/src/types.d.ts:842 A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:830 +Defined in: packages/query-core/dist-ts/src/types.d.ts:843 A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:797 +Defined in: packages/query-core/dist-ts/src/types.d.ts:810 The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:801 +Defined in: packages/query-core/dist-ts/src/types.d.ts:814 A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:831 +Defined in: packages/query-core/dist-ts/src/types.d.ts:844 The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:826 +Defined in: packages/query-core/dist-ts/src/types.d.ts:839 The variables object passed to the `mutationFn`. diff --git a/docs/framework/angular/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/angular/reference/interfaces/MutationObserverIdleResult.md index 5e7fbd3253a..7b5c3034542 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:803 +Defined in: packages/query-core/dist-ts/src/types.d.ts:816 The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:804 +Defined in: packages/query-core/dist-ts/src/types.d.ts:817 The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:806 +Defined in: packages/query-core/dist-ts/src/types.d.ts:819 The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:807 +Defined in: packages/query-core/dist-ts/src/types.d.ts:820 A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:808 +Defined in: packages/query-core/dist-ts/src/types.d.ts:821 A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:809 +Defined in: packages/query-core/dist-ts/src/types.d.ts:822 A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:810 +Defined in: packages/query-core/dist-ts/src/types.d.ts:823 A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:797 +Defined in: packages/query-core/dist-ts/src/types.d.ts:810 The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:801 +Defined in: packages/query-core/dist-ts/src/types.d.ts:814 A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:811 +Defined in: packages/query-core/dist-ts/src/types.d.ts:824 The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:805 +Defined in: packages/query-core/dist-ts/src/types.d.ts:818 The variables object passed to the `mutationFn`. diff --git a/docs/framework/angular/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/angular/reference/interfaces/MutationObserverLoadingResult.md index a56fe5fcc80..0b3fa2d6f82 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:813 +Defined in: packages/query-core/dist-ts/src/types.d.ts:826 The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:814 +Defined in: packages/query-core/dist-ts/src/types.d.ts:827 The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:816 +Defined in: packages/query-core/dist-ts/src/types.d.ts:829 The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:817 +Defined in: packages/query-core/dist-ts/src/types.d.ts:830 A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:818 +Defined in: packages/query-core/dist-ts/src/types.d.ts:831 A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:819 +Defined in: packages/query-core/dist-ts/src/types.d.ts:832 A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:820 +Defined in: packages/query-core/dist-ts/src/types.d.ts:833 A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:797 +Defined in: packages/query-core/dist-ts/src/types.d.ts:810 The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:801 +Defined in: packages/query-core/dist-ts/src/types.d.ts:814 A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:821 +Defined in: packages/query-core/dist-ts/src/types.d.ts:834 The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:815 +Defined in: packages/query-core/dist-ts/src/types.d.ts:828 The variables object passed to the `mutationFn`. diff --git a/docs/framework/angular/reference/interfaces/MutationObserverOptions.md b/docs/framework/angular/reference/interfaces/MutationObserverOptions.md index 09b360cc3a5..2c5721c22f7 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:728 +Defined in: packages/query-core/dist-ts/src/types.d.ts:741 ## Extends @@ -35,7 +35,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:728 optional gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:722 +Defined in: packages/query-core/dist-ts/src/types.d.ts:735 #### Inherited from @@ -49,7 +49,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:722 optional meta: Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:725 +Defined in: packages/query-core/dist-ts/src/types.d.ts:738 #### Inherited from @@ -63,7 +63,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:725 optional mutationFn: MutationFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:713 +Defined in: packages/query-core/dist-ts/src/types.d.ts:726 #### Inherited from @@ -77,7 +77,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:713 optional mutationKey: readonly unknown[]; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:714 +Defined in: packages/query-core/dist-ts/src/types.d.ts:727 #### Inherited from @@ -91,7 +91,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:714 optional networkMode: NetworkMode; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:721 +Defined in: packages/query-core/dist-ts/src/types.d.ts:734 #### Inherited from @@ -105,7 +105,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:721 optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:717 +Defined in: packages/query-core/dist-ts/src/types.d.ts:730 #### Parameters @@ -141,7 +141,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:717 optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:715 +Defined in: packages/query-core/dist-ts/src/types.d.ts:728 #### Parameters @@ -169,7 +169,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:715 optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:718 +Defined in: packages/query-core/dist-ts/src/types.d.ts:731 #### Parameters @@ -209,7 +209,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:718 optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:716 +Defined in: packages/query-core/dist-ts/src/types.d.ts:729 #### Parameters @@ -245,7 +245,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:716 optional retry: RetryValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:719 +Defined in: packages/query-core/dist-ts/src/types.d.ts:732 #### Inherited from @@ -259,7 +259,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:719 optional retryDelay: RetryDelayValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:720 +Defined in: packages/query-core/dist-ts/src/types.d.ts:733 #### Inherited from @@ -273,7 +273,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:720 optional scope: MutationScope; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:726 +Defined in: packages/query-core/dist-ts/src/types.d.ts:739 #### Inherited from @@ -287,4 +287,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:726 optional throwOnError: boolean | (error) => boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:729 +Defined in: packages/query-core/dist-ts/src/types.d.ts:742 diff --git a/docs/framework/angular/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/angular/reference/interfaces/MutationObserverSuccessResult.md index 580d357a294..a80cfc3d10a 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:833 +Defined in: packages/query-core/dist-ts/src/types.d.ts:846 The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:834 +Defined in: packages/query-core/dist-ts/src/types.d.ts:847 The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:835 +Defined in: packages/query-core/dist-ts/src/types.d.ts:848 The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:837 +Defined in: packages/query-core/dist-ts/src/types.d.ts:850 A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:838 +Defined in: packages/query-core/dist-ts/src/types.d.ts:851 A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:839 +Defined in: packages/query-core/dist-ts/src/types.d.ts:852 A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:840 +Defined in: packages/query-core/dist-ts/src/types.d.ts:853 A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:797 +Defined in: packages/query-core/dist-ts/src/types.d.ts:810 The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:801 +Defined in: packages/query-core/dist-ts/src/types.d.ts:814 A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:841 +Defined in: packages/query-core/dist-ts/src/types.d.ts:854 The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:836 +Defined in: packages/query-core/dist-ts/src/types.d.ts:849 The variables object passed to the `mutationFn`. diff --git a/docs/framework/angular/reference/interfaces/MutationOptions.md b/docs/framework/angular/reference/interfaces/MutationOptions.md index 090bb10ec79..f98c35a8118 100644 --- a/docs/framework/angular/reference/interfaces/MutationOptions.md +++ b/docs/framework/angular/reference/interfaces/MutationOptions.md @@ -3,7 +3,7 @@ id: MutationOptions title: MutationOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:712 +Defined in: packages/query-core/dist-ts/src/types.d.ts:725 ## Extended by @@ -35,7 +35,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:712 optional gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:722 +Defined in: packages/query-core/dist-ts/src/types.d.ts:735 *** @@ -45,7 +45,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:722 optional meta: Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:725 +Defined in: packages/query-core/dist-ts/src/types.d.ts:738 *** @@ -55,7 +55,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:725 optional mutationFn: MutationFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:713 +Defined in: packages/query-core/dist-ts/src/types.d.ts:726 *** @@ -65,7 +65,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:713 optional mutationKey: readonly unknown[]; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:714 +Defined in: packages/query-core/dist-ts/src/types.d.ts:727 *** @@ -75,7 +75,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:714 optional networkMode: NetworkMode; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:721 +Defined in: packages/query-core/dist-ts/src/types.d.ts:734 *** @@ -85,7 +85,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:721 optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:717 +Defined in: packages/query-core/dist-ts/src/types.d.ts:730 #### Parameters @@ -117,7 +117,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:717 optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:715 +Defined in: packages/query-core/dist-ts/src/types.d.ts:728 #### Parameters @@ -141,7 +141,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:715 optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:718 +Defined in: packages/query-core/dist-ts/src/types.d.ts:731 #### Parameters @@ -177,7 +177,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:718 optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:716 +Defined in: packages/query-core/dist-ts/src/types.d.ts:729 #### Parameters @@ -209,7 +209,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:716 optional retry: RetryValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:719 +Defined in: packages/query-core/dist-ts/src/types.d.ts:732 *** @@ -219,7 +219,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:719 optional retryDelay: RetryDelayValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:720 +Defined in: packages/query-core/dist-ts/src/types.d.ts:733 *** @@ -229,4 +229,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:720 optional scope: MutationScope; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:726 +Defined in: packages/query-core/dist-ts/src/types.d.ts:739 diff --git a/docs/framework/angular/reference/interfaces/NotifyEvent.md b/docs/framework/angular/reference/interfaces/NotifyEvent.md index 46dca30007d..59890a48254 100644 --- a/docs/framework/angular/reference/interfaces/NotifyEvent.md +++ b/docs/framework/angular/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:863 +Defined in: packages/query-core/dist-ts/src/types.d.ts:886 ## Properties @@ -13,4 +13,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:863 type: NotifyEventType; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:864 +Defined in: packages/query-core/dist-ts/src/types.d.ts:887 diff --git a/docs/framework/angular/reference/interfaces/QueryCacheConfig.md b/docs/framework/angular/reference/interfaces/QueryCacheConfig.md index 9869f2e196f..fbfdc5735f2 100644 --- a/docs/framework/angular/reference/interfaces/QueryCacheConfig.md +++ b/docs/framework/angular/reference/interfaces/QueryCacheConfig.md @@ -3,11 +3,12 @@ id: QueryCacheConfig title: QueryCacheConfig --- -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:13 +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:14 Global callbacks that fire for every query handled by a `QueryCache`, regardless of which component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can -override, these callbacks are always called. +override, these callbacks are always called. Unlike `MutationCacheConfig`'s callbacks, these +are fire-and-forget: their return value is not awaited before the query settles. ## Properties @@ -17,7 +18,7 @@ override, these callbacks are always called. optional onError: (error, query) => void; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:15 +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:16 Called when any query in the cache encounters an error. @@ -43,7 +44,7 @@ Called when any query in the cache encounters an error. optional onSettled: (data, error, query) => void; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:19 +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:20 Called when any query in the cache is settled, either successfully or with an error. @@ -73,7 +74,7 @@ Called when any query in the cache is settled, either successfully or with an er optional onSuccess: (data, query) => void; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:17 +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:18 Called when any query in the cache is successful. diff --git a/docs/framework/angular/reference/interfaces/QueryClientConfig.md b/docs/framework/angular/reference/interfaces/QueryClientConfig.md index f3f0d1778ff..d6ccb67158e 100644 --- a/docs/framework/angular/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/angular/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:844 +Defined in: packages/query-core/dist-ts/src/types.d.ts:857 ## Properties @@ -13,7 +13,9 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:844 optional defaultOptions: DefaultOptions; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:847 +Defined in: packages/query-core/dist-ts/src/types.d.ts:866 + +Default options for all queries and mutations created through this client. *** @@ -23,7 +25,10 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:847 optional mutationCache: MutationCache; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:846 +Defined in: packages/query-core/dist-ts/src/types.d.ts:864 + +The mutation cache this client is connected to. A new `MutationCache` is created if not +provided. *** @@ -33,4 +38,6 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:846 optional queryCache: QueryCache; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:845 +Defined in: packages/query-core/dist-ts/src/types.d.ts:859 + +The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/angular/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/angular/reference/interfaces/QueryObserverBaseResult.md index 91c0d8449eb..7d9acb5dc6a 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:384 +Defined in: packages/query-core/dist-ts/src/types.d.ts:397 ## Extended by @@ -33,7 +33,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:384 data: TData | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:388 +Defined in: packages/query-core/dist-ts/src/types.d.ts:401 The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:392 +Defined in: packages/query-core/dist-ts/src/types.d.ts:405 The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:397 +Defined in: packages/query-core/dist-ts/src/types.d.ts:410 The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:416 +Defined in: packages/query-core/dist-ts/src/types.d.ts:429 The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:401 +Defined in: packages/query-core/dist-ts/src/types.d.ts:414 The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:407 +Defined in: packages/query-core/dist-ts/src/types.d.ts:420 The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:412 +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:504 +Defined in: packages/query-core/dist-ts/src/types.d.ts:517 The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: packages/query-core/dist-ts/src/types.d.ts:497 `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:484 isError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:421 +Defined in: packages/query-core/dist-ts/src/types.d.ts:434 A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: packages/query-core/dist-ts/src/types.d.ts:438 Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:430 +Defined in: packages/query-core/dist-ts/src/types.d.ts:443 Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:435 +Defined in: packages/query-core/dist-ts/src/types.d.ts:448 A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: packages/query-core/dist-ts/src/types.d.ts:466 #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:440 +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:448 +Defined in: packages/query-core/dist-ts/src/types.d.ts:461 Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:458 +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:444 +Defined in: packages/query-core/dist-ts/src/types.d.ts:457 Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:462 +Defined in: packages/query-core/dist-ts/src/types.d.ts:475 Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:466 +Defined in: packages/query-core/dist-ts/src/types.d.ts:479 Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:475 +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:480 +Defined in: packages/query-core/dist-ts/src/types.d.ts:493 A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: packages/query-core/dist-ts/src/types.d.ts:501 A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:496 +Defined in: packages/query-core/dist-ts/src/types.d.ts:509 The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/angular/reference/interfaces/QueryObserverLoadingErrorResult.md index 9d4b6021bb0..ab6f2c64a18 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:529 +Defined in: packages/query-core/dist-ts/src/types.d.ts:542 ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:529 data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:530 +Defined in: packages/query-core/dist-ts/src/types.d.ts:543 The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:392 +Defined in: packages/query-core/dist-ts/src/types.d.ts:405 The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:531 +Defined in: packages/query-core/dist-ts/src/types.d.ts:544 The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:416 +Defined in: packages/query-core/dist-ts/src/types.d.ts:429 The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:401 +Defined in: packages/query-core/dist-ts/src/types.d.ts:414 The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:407 +Defined in: packages/query-core/dist-ts/src/types.d.ts:420 The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:412 +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:504 +Defined in: packages/query-core/dist-ts/src/types.d.ts:517 The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: packages/query-core/dist-ts/src/types.d.ts:497 `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:484 isError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:532 +Defined in: packages/query-core/dist-ts/src/types.d.ts:545 A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: packages/query-core/dist-ts/src/types.d.ts:438 Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:430 +Defined in: packages/query-core/dist-ts/src/types.d.ts:443 Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:435 +Defined in: packages/query-core/dist-ts/src/types.d.ts:448 A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: packages/query-core/dist-ts/src/types.d.ts:466 #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:534 +Defined in: packages/query-core/dist-ts/src/types.d.ts:547 Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:535 +Defined in: packages/query-core/dist-ts/src/types.d.ts:548 Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:458 +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:533 +Defined in: packages/query-core/dist-ts/src/types.d.ts:546 Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:538 +Defined in: packages/query-core/dist-ts/src/types.d.ts:551 Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:536 +Defined in: packages/query-core/dist-ts/src/types.d.ts:549 Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:475 +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:537 +Defined in: packages/query-core/dist-ts/src/types.d.ts:550 A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: packages/query-core/dist-ts/src/types.d.ts:501 A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:539 +Defined in: packages/query-core/dist-ts/src/types.d.ts:552 The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/angular/reference/interfaces/QueryObserverLoadingResult.md index 9900069ea66..412b9f547b3 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:517 +Defined in: packages/query-core/dist-ts/src/types.d.ts:530 ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:517 data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:518 +Defined in: packages/query-core/dist-ts/src/types.d.ts:531 The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:392 +Defined in: packages/query-core/dist-ts/src/types.d.ts:405 The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:519 +Defined in: packages/query-core/dist-ts/src/types.d.ts:532 The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:416 +Defined in: packages/query-core/dist-ts/src/types.d.ts:429 The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:401 +Defined in: packages/query-core/dist-ts/src/types.d.ts:414 The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:407 +Defined in: packages/query-core/dist-ts/src/types.d.ts:420 The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:412 +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:504 +Defined in: packages/query-core/dist-ts/src/types.d.ts:517 The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: packages/query-core/dist-ts/src/types.d.ts:497 `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:484 isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:520 +Defined in: packages/query-core/dist-ts/src/types.d.ts:533 A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: packages/query-core/dist-ts/src/types.d.ts:438 Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:430 +Defined in: packages/query-core/dist-ts/src/types.d.ts:443 Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:435 +Defined in: packages/query-core/dist-ts/src/types.d.ts:448 A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: packages/query-core/dist-ts/src/types.d.ts:466 #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:522 +Defined in: packages/query-core/dist-ts/src/types.d.ts:535 Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:523 +Defined in: packages/query-core/dist-ts/src/types.d.ts:536 Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:458 +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:521 +Defined in: packages/query-core/dist-ts/src/types.d.ts:534 Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:526 +Defined in: packages/query-core/dist-ts/src/types.d.ts:539 Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:524 +Defined in: packages/query-core/dist-ts/src/types.d.ts:537 Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:475 +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:525 +Defined in: packages/query-core/dist-ts/src/types.d.ts:538 A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: packages/query-core/dist-ts/src/types.d.ts:501 A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:527 +Defined in: packages/query-core/dist-ts/src/types.d.ts:540 The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/angular/reference/interfaces/QueryObserverPendingResult.md index d4a52d6ae6d..bc233dd8c64 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:506 +Defined in: packages/query-core/dist-ts/src/types.d.ts:519 ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:506 data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:507 +Defined in: packages/query-core/dist-ts/src/types.d.ts:520 The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:392 +Defined in: packages/query-core/dist-ts/src/types.d.ts:405 The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:508 +Defined in: packages/query-core/dist-ts/src/types.d.ts:521 The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:416 +Defined in: packages/query-core/dist-ts/src/types.d.ts:429 The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:401 +Defined in: packages/query-core/dist-ts/src/types.d.ts:414 The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:407 +Defined in: packages/query-core/dist-ts/src/types.d.ts:420 The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:412 +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:504 +Defined in: packages/query-core/dist-ts/src/types.d.ts:517 The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: packages/query-core/dist-ts/src/types.d.ts:497 `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:484 isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:509 +Defined in: packages/query-core/dist-ts/src/types.d.ts:522 A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: packages/query-core/dist-ts/src/types.d.ts:438 Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:430 +Defined in: packages/query-core/dist-ts/src/types.d.ts:443 Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:435 +Defined in: packages/query-core/dist-ts/src/types.d.ts:448 A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: packages/query-core/dist-ts/src/types.d.ts:466 #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:440 +Defined in: packages/query-core/dist-ts/src/types.d.ts:453 Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:511 +Defined in: packages/query-core/dist-ts/src/types.d.ts:524 Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:458 +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:510 +Defined in: packages/query-core/dist-ts/src/types.d.ts:523 Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:514 +Defined in: packages/query-core/dist-ts/src/types.d.ts:527 Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:512 +Defined in: packages/query-core/dist-ts/src/types.d.ts:525 Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:475 +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:513 +Defined in: packages/query-core/dist-ts/src/types.d.ts:526 A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: packages/query-core/dist-ts/src/types.d.ts:501 A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:515 +Defined in: packages/query-core/dist-ts/src/types.d.ts:528 The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/angular/reference/interfaces/QueryObserverPlaceholderResult.md index 5b2a91f6f2d..1717a64e43b 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:565 +Defined in: packages/query-core/dist-ts/src/types.d.ts:578 ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:565 data: TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:566 +Defined in: packages/query-core/dist-ts/src/types.d.ts:579 The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:392 +Defined in: packages/query-core/dist-ts/src/types.d.ts:405 The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:568 +Defined in: packages/query-core/dist-ts/src/types.d.ts:581 The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:416 +Defined in: packages/query-core/dist-ts/src/types.d.ts:429 The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:401 +Defined in: packages/query-core/dist-ts/src/types.d.ts:414 The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:407 +Defined in: packages/query-core/dist-ts/src/types.d.ts:420 The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:412 +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:504 +Defined in: packages/query-core/dist-ts/src/types.d.ts:517 The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: packages/query-core/dist-ts/src/types.d.ts:497 `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:484 isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:567 +Defined in: packages/query-core/dist-ts/src/types.d.ts:580 A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: packages/query-core/dist-ts/src/types.d.ts:438 Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:430 +Defined in: packages/query-core/dist-ts/src/types.d.ts:443 Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:435 +Defined in: packages/query-core/dist-ts/src/types.d.ts:448 A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: packages/query-core/dist-ts/src/types.d.ts:466 #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:570 +Defined in: packages/query-core/dist-ts/src/types.d.ts:583 Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:571 +Defined in: packages/query-core/dist-ts/src/types.d.ts:584 Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:458 +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:569 +Defined in: packages/query-core/dist-ts/src/types.d.ts:582 Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:574 +Defined in: packages/query-core/dist-ts/src/types.d.ts:587 Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:572 +Defined in: packages/query-core/dist-ts/src/types.d.ts:585 Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:475 +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:573 +Defined in: packages/query-core/dist-ts/src/types.d.ts:586 A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: packages/query-core/dist-ts/src/types.d.ts:501 A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:575 +Defined in: packages/query-core/dist-ts/src/types.d.ts:588 The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/angular/reference/interfaces/QueryObserverRefetchErrorResult.md index 5677a114ddc..2fd52a94249 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:541 +Defined in: packages/query-core/dist-ts/src/types.d.ts:554 ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:541 data: TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:542 +Defined in: packages/query-core/dist-ts/src/types.d.ts:555 The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:392 +Defined in: packages/query-core/dist-ts/src/types.d.ts:405 The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:543 +Defined in: packages/query-core/dist-ts/src/types.d.ts:556 The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:416 +Defined in: packages/query-core/dist-ts/src/types.d.ts:429 The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:401 +Defined in: packages/query-core/dist-ts/src/types.d.ts:414 The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:407 +Defined in: packages/query-core/dist-ts/src/types.d.ts:420 The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:412 +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:504 +Defined in: packages/query-core/dist-ts/src/types.d.ts:517 The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: packages/query-core/dist-ts/src/types.d.ts:497 `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:484 isError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:544 +Defined in: packages/query-core/dist-ts/src/types.d.ts:557 A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: packages/query-core/dist-ts/src/types.d.ts:438 Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:430 +Defined in: packages/query-core/dist-ts/src/types.d.ts:443 Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:435 +Defined in: packages/query-core/dist-ts/src/types.d.ts:448 A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: packages/query-core/dist-ts/src/types.d.ts:466 #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:546 +Defined in: packages/query-core/dist-ts/src/types.d.ts:559 Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:547 +Defined in: packages/query-core/dist-ts/src/types.d.ts:560 Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:458 +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:545 +Defined in: packages/query-core/dist-ts/src/types.d.ts:558 Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:550 +Defined in: packages/query-core/dist-ts/src/types.d.ts:563 Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:548 +Defined in: packages/query-core/dist-ts/src/types.d.ts:561 Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:475 +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:549 +Defined in: packages/query-core/dist-ts/src/types.d.ts:562 A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: packages/query-core/dist-ts/src/types.d.ts:501 A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:551 +Defined in: packages/query-core/dist-ts/src/types.d.ts:564 The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/angular/reference/interfaces/QueryObserverSuccessResult.md index bac555610c7..4da4d4d92d3 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:553 +Defined in: packages/query-core/dist-ts/src/types.d.ts:566 ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:553 data: TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:554 +Defined in: packages/query-core/dist-ts/src/types.d.ts:567 The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:392 +Defined in: packages/query-core/dist-ts/src/types.d.ts:405 The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:555 +Defined in: packages/query-core/dist-ts/src/types.d.ts:568 The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:416 +Defined in: packages/query-core/dist-ts/src/types.d.ts:429 The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:401 +Defined in: packages/query-core/dist-ts/src/types.d.ts:414 The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:407 +Defined in: packages/query-core/dist-ts/src/types.d.ts:420 The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:412 +Defined in: packages/query-core/dist-ts/src/types.d.ts:425 The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:504 +Defined in: packages/query-core/dist-ts/src/types.d.ts:517 The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: packages/query-core/dist-ts/src/types.d.ts:497 `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:484 isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:556 +Defined in: packages/query-core/dist-ts/src/types.d.ts:569 A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: packages/query-core/dist-ts/src/types.d.ts:438 Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:430 +Defined in: packages/query-core/dist-ts/src/types.d.ts:443 Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:435 +Defined in: packages/query-core/dist-ts/src/types.d.ts:448 A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: packages/query-core/dist-ts/src/types.d.ts:466 #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:558 +Defined in: packages/query-core/dist-ts/src/types.d.ts:571 Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:559 +Defined in: packages/query-core/dist-ts/src/types.d.ts:572 Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:458 +Defined in: packages/query-core/dist-ts/src/types.d.ts:471 A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:557 +Defined in: packages/query-core/dist-ts/src/types.d.ts:570 Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:562 +Defined in: packages/query-core/dist-ts/src/types.d.ts:575 Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:560 +Defined in: packages/query-core/dist-ts/src/types.d.ts:573 Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: packages/query-core/dist-ts/src/types.d.ts:484 Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:475 +Defined in: packages/query-core/dist-ts/src/types.d.ts:488 Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:561 +Defined in: packages/query-core/dist-ts/src/types.d.ts:574 A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: packages/query-core/dist-ts/src/types.d.ts:501 A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:563 +Defined in: packages/query-core/dist-ts/src/types.d.ts:576 The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/RefetchOptions.md b/docs/framework/angular/reference/interfaces/RefetchOptions.md index 88ca9aed42d..c12c1e20a12 100644 --- a/docs/framework/angular/reference/interfaces/RefetchOptions.md +++ b/docs/framework/angular/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:341 +Defined in: packages/query-core/dist-ts/src/types.d.ts:346 ## Extends @@ -22,7 +22,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:341 optional cancelRefetch: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:349 +Defined in: packages/query-core/dist-ts/src/types.d.ts:354 If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,7 +38,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:339 +Defined in: packages/query-core/dist-ts/src/types.d.ts:344 + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/RefetchQueryFilters.md b/docs/framework/angular/reference/interfaces/RefetchQueryFilters.md index 245019de966..e0ad9b35c96 100644 --- a/docs/framework/angular/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/angular/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:354 +Defined in: packages/query-core/dist-ts/src/types.d.ts:367 Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. diff --git a/docs/framework/angular/reference/interfaces/ResetOptions.md b/docs/framework/angular/reference/interfaces/ResetOptions.md index 520cd8e49bc..033b02f0b9e 100644 --- a/docs/framework/angular/reference/interfaces/ResetOptions.md +++ b/docs/framework/angular/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:358 +Defined in: packages/query-core/dist-ts/src/types.d.ts:371 ## Extends @@ -17,7 +17,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:358 optional cancelRefetch: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:349 +Defined in: packages/query-core/dist-ts/src/types.d.ts:354 If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:339 +Defined in: packages/query-core/dist-ts/src/types.d.ts:344 + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/ResultOptions.md b/docs/framework/angular/reference/interfaces/ResultOptions.md index 7408f5f9e1f..7120fe1e661 100644 --- a/docs/framework/angular/reference/interfaces/ResultOptions.md +++ b/docs/framework/angular/reference/interfaces/ResultOptions.md @@ -19,4 +19,8 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:338 optional throwOnError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:339 +Defined in: packages/query-core/dist-ts/src/types.d.ts:344 + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. diff --git a/docs/framework/angular/reference/interfaces/SetDataOptions.md b/docs/framework/angular/reference/interfaces/SetDataOptions.md index 287dd808a9c..da79f9f093c 100644 --- a/docs/framework/angular/reference/interfaces/SetDataOptions.md +++ b/docs/framework/angular/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:859 +Defined in: packages/query-core/dist-ts/src/types.d.ts:882 ## Properties @@ -13,4 +13,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:859 optional updatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:860 +Defined in: packages/query-core/dist-ts/src/types.d.ts:883 diff --git a/docs/framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index fd10c3af111..920021ae2c5 100644 --- a/docs/framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:694 +Defined in: packages/query-core/dist-ts/src/types.d.ts:707 ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/angular/reference/type-aliases/DefinedQueryObserverResult.md index 70947ba3fca..aa4eb6fb0fd 100644 --- a/docs/framework/angular/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/angular/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:577 +Defined in: packages/query-core/dist-ts/src/types.d.ts:590 ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/FetchStatus.md b/docs/framework/angular/reference/type-aliases/FetchStatus.md index cfa8b902067..85d190a2c72 100644 --- a/docs/framework/angular/reference/type-aliases/FetchStatus.md +++ b/docs/framework/angular/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:383 +Defined in: packages/query-core/dist-ts/src/types.d.ts:396 diff --git a/docs/framework/angular/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/angular/reference/type-aliases/InfiniteQueryObserverResult.md index cd9b2615e8c..092de84271f 100644 --- a/docs/framework/angular/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/angular/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:695 +Defined in: packages/query-core/dist-ts/src/types.d.ts:708 ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/MutateFunction.md b/docs/framework/angular/reference/type-aliases/MutateFunction.md index 21ba61ea438..d7d5b74e21c 100644 --- a/docs/framework/angular/reference/type-aliases/MutateFunction.md +++ b/docs/framework/angular/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:743 +Defined in: packages/query-core/dist-ts/src/types.d.ts:756 ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/MutateFunctionRest.md b/docs/framework/angular/reference/type-aliases/MutateFunctionRest.md index fc226535f95..16c670cdd56 100644 --- a/docs/framework/angular/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/angular/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:736 +Defined in: packages/query-core/dist-ts/src/types.d.ts:749 ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/MutationFunction.md b/docs/framework/angular/reference/type-aliases/MutationFunction.md index a0cdf4a0a9a..344a658ee9f 100644 --- a/docs/framework/angular/reference/type-aliases/MutationFunction.md +++ b/docs/framework/angular/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:711 +Defined in: packages/query-core/dist-ts/src/types.d.ts:724 ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/MutationFunctionContext.md b/docs/framework/angular/reference/type-aliases/MutationFunctionContext.md index d89f80b019e..f5a39e5e547 100644 --- a/docs/framework/angular/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/angular/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:706 +Defined in: packages/query-core/dist-ts/src/types.d.ts:719 ## Properties @@ -17,7 +17,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:706 client: QueryClient; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:707 +Defined in: packages/query-core/dist-ts/src/types.d.ts:720 *** @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:707 meta: MutationMeta | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:708 +Defined in: packages/query-core/dist-ts/src/types.d.ts:721 *** @@ -37,4 +37,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:708 optional mutationKey: MutationKey; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:709 +Defined in: packages/query-core/dist-ts/src/types.d.ts:722 diff --git a/docs/framework/angular/reference/type-aliases/MutationKey.md b/docs/framework/angular/reference/type-aliases/MutationKey.md index 8c704ce1029..6df59e8b0ac 100644 --- a/docs/framework/angular/reference/type-aliases/MutationKey.md +++ b/docs/framework/angular/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:696 +Defined in: packages/query-core/dist-ts/src/types.d.ts:709 diff --git a/docs/framework/angular/reference/type-aliases/MutationMeta.md b/docs/framework/angular/reference/type-aliases/MutationMeta.md index 68f70c02138..0dcd9a48865 100644 --- a/docs/framework/angular/reference/type-aliases/MutationMeta.md +++ b/docs/framework/angular/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:703 +Defined in: packages/query-core/dist-ts/src/types.d.ts:716 diff --git a/docs/framework/angular/reference/type-aliases/MutationObserverResult.md b/docs/framework/angular/reference/type-aliases/MutationObserverResult.md index b4a85e897e5..4edbb46566d 100644 --- a/docs/framework/angular/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/angular/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:843 +Defined in: packages/query-core/dist-ts/src/types.d.ts:856 ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/MutationScope.md b/docs/framework/angular/reference/type-aliases/MutationScope.md index 9d665f75b98..6f9c7619c08 100644 --- a/docs/framework/angular/reference/type-aliases/MutationScope.md +++ b/docs/framework/angular/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:700 +Defined in: packages/query-core/dist-ts/src/types.d.ts:713 ## Properties @@ -17,4 +17,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:700 id: string; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:701 +Defined in: packages/query-core/dist-ts/src/types.d.ts:714 diff --git a/docs/framework/angular/reference/type-aliases/MutationStatus.md b/docs/framework/angular/reference/type-aliases/MutationStatus.md index 3687df72ad0..79b6078e8b6 100644 --- a/docs/framework/angular/reference/type-aliases/MutationStatus.md +++ b/docs/framework/angular/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:699 +Defined in: packages/query-core/dist-ts/src/types.d.ts:712 diff --git a/docs/framework/angular/reference/type-aliases/NotifyEventType.md b/docs/framework/angular/reference/type-aliases/NotifyEventType.md index 219ad984119..170b153e290 100644 --- a/docs/framework/angular/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/angular/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:862 +Defined in: packages/query-core/dist-ts/src/types.d.ts:885 diff --git a/docs/framework/angular/reference/type-aliases/QueryCacheNotifyEvent.md b/docs/framework/angular/reference/type-aliases/QueryCacheNotifyEvent.md index c6d8466de6a..d6485450a3d 100644 --- a/docs/framework/angular/reference/type-aliases/QueryCacheNotifyEvent.md +++ b/docs/framework/angular/reference/type-aliases/QueryCacheNotifyEvent.md @@ -14,7 +14,7 @@ type QueryCacheNotifyEvent = | NotifyEventQueryObserverOptionsUpdated; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:58 +Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:59 The event passed to a `QueryCache` subscriber. Fired whenever a query is added or removed from the cache, its state is updated (e.g. via `query.setState` or `queryClient.removeQueries`), or diff --git a/docs/framework/angular/reference/type-aliases/QueryObserverResult.md b/docs/framework/angular/reference/type-aliases/QueryObserverResult.md index 53aa9f89f43..091c81e5d36 100644 --- a/docs/framework/angular/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/angular/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:578 +Defined in: packages/query-core/dist-ts/src/types.d.ts:591 ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/QueryStatus.md b/docs/framework/angular/reference/type-aliases/QueryStatus.md index e78d78304f8..b8208b1b575 100644 --- a/docs/framework/angular/reference/type-aliases/QueryStatus.md +++ b/docs/framework/angular/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:382 +Defined in: packages/query-core/dist-ts/src/types.d.ts:395 diff --git a/docs/framework/angular/reference/type-aliases/TimeoutProvider.md b/docs/framework/angular/reference/type-aliases/TimeoutProvider.md index e51973f15be..24ad323cb2c 100644 --- a/docs/framework/angular/reference/type-aliases/TimeoutProvider.md +++ b/docs/framework/angular/reference/type-aliases/TimeoutProvider.md @@ -7,10 +7,16 @@ title: TimeoutProvider type TimeoutProvider = object; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:22 +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:28 Backend for timer functions. +Timers are performance-sensitive: short-lived timers (delays under a few seconds) tend to be +latency-sensitive, while long-lived ones may benefit more from coalescing — batching timers +with similar deadlines together — which the default provider (backed by the platform's global +`setTimeout`/`setInterval`) does not do. A custom provider can implement coalescing, and can +also support delays longer than the ~24-day maximum of the global `setTimeout`. + ## Type Parameters ### TTimerId @@ -25,7 +31,7 @@ Backend for timer functions. readonly clearInterval: (intervalId) => void; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:26 +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:32 #### Parameters @@ -45,7 +51,7 @@ Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:26 readonly clearTimeout: (timeoutId) => void; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:24 +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:30 #### Parameters @@ -65,7 +71,7 @@ Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:24 readonly setInterval: (callback, delay) => TTimerId; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:25 +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:31 #### Parameters @@ -89,7 +95,7 @@ Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:25 readonly setTimeout: (callback, delay) => TTimerId; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:23 +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:29 #### Parameters diff --git a/docs/framework/angular/reference/variables/environmentManager.md b/docs/framework/angular/reference/variables/environmentManager.md index 04aed247301..e2975e30dec 100644 --- a/docs/framework/angular/reference/variables/environmentManager.md +++ b/docs/framework/angular/reference/variables/environmentManager.md @@ -7,9 +7,13 @@ title: environmentManager const environmentManager: object; ``` -Defined in: packages/query-core/dist-ts/src/environmentManager.d.ts:9 +Defined in: packages/query-core/dist-ts/src/environmentManager.d.ts:23 -Manages environment detection used by TanStack Query internals. +Manages how TanStack Query detects whether the current runtime should be treated as +server-side. By default, this uses the same detection as the exported `isServer` utility. + +Override this for runtimes that are not traditional browser/server environments (e.g. +extension workers), where the default detection would give the wrong answer. ## Type Declaration @@ -36,3 +40,14 @@ Overrides the server check globally. #### Returns `void` + +## Example + +```ts +import { environmentManager, isServer } from '@tanstack/query-core' + +environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis)) + +// Restore the default behavior: +environmentManager.setIsServer(() => isServer) +``` diff --git a/docs/framework/angular/reference/variables/notifyManager.md b/docs/framework/angular/reference/variables/notifyManager.md index a8d4ab6335d..862acf71bd9 100644 --- a/docs/framework/angular/reference/variables/notifyManager.md +++ b/docs/framework/angular/reference/variables/notifyManager.md @@ -7,7 +7,7 @@ title: notifyManager const notifyManager: object; ``` -Defined in: packages/query-core/dist-ts/src/notifyManager.d.ts:61 +Defined in: packages/query-core/dist-ts/src/notifyManager.d.ts:70 Handles scheduling and batching callbacks in TanStack Query. @@ -90,7 +90,8 @@ readonly setBatchNotifyFunction: (fn) => void; ``` Use this method to set a custom function to batch notifications together into a single tick. -By default React Query will use the batch function provided by ReactDOM or React Native. +Framework adapters use this to plug in their own batching primitive, so that a single query +update only triggers one re-render instead of one per subscriber. #### Parameters @@ -102,6 +103,15 @@ By default React Query will use the batch function provided by ReactDOM or React `void` +#### Example + +```ts +import { notifyManager } from '@tanstack/query-core' +import { batch } from 'solid-js' + +notifyManager.setBatchNotifyFunction(batch) +``` + ### setNotifyFunction() ```ts diff --git a/docs/framework/angular/reference/variables/timeoutManager.md b/docs/framework/angular/reference/variables/timeoutManager.md index 554e83c7d57..4decb9720c6 100644 --- a/docs/framework/angular/reference/variables/timeoutManager.md +++ b/docs/framework/angular/reference/variables/timeoutManager.md @@ -7,6 +7,6 @@ title: timeoutManager const timeoutManager: TimeoutManager; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:147 +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:153 Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/lit/reference/classes/Mutation.md b/docs/framework/lit/reference/classes/Mutation.md index 4e85a5b2d4c..e038a9cd394 100644 --- a/docs/framework/lit/reference/classes/Mutation.md +++ b/docs/framework/lit/reference/classes/Mutation.md @@ -219,7 +219,7 @@ Removable.destroy execute(variables): Promise; ``` -Defined in: [packages/query-core/src/mutation.ts:283](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L283) +Defined in: [packages/query-core/src/mutation.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L284) Runs the mutation function for the given variables through a retryer, and drives the mutation's state and lifecycle callbacks through to settlement. @@ -254,7 +254,8 @@ the original error is re-thrown. #### Example ```ts -// typically invoked by MutationObserver.mutate, not called directly +// Called internally by `MutationObserver.mutate` and `Mutation.continue` — +// applications normally trigger mutations through those, not this method. const data = await mutation.execute(variables) ``` diff --git a/docs/framework/lit/reference/classes/MutationCache.md b/docs/framework/lit/reference/classes/MutationCache.md index cad2b065eda..067363d312b 100644 --- a/docs/framework/lit/reference/classes/MutationCache.md +++ b/docs/framework/lit/reference/classes/MutationCache.md @@ -3,7 +3,7 @@ id: MutationCache title: MutationCache --- -Defined in: [packages/query-core/src/mutationCache.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L117) +Defined in: [packages/query-core/src/mutationCache.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L124) The `MutationCache` is the storage for mutations. @@ -11,6 +11,14 @@ Normally, you will not interact with the `MutationCache` directly and instead us `QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of safe/known updates to the cache, such as mutations being added, removed, or updated. +## Example + +```ts +const unsubscribe = mutationCache.subscribe((event) => { + console.log(event.type, event.mutation) +}) +``` + ## Extends - `Subscribable`\<`MutationCacheListener`\> @@ -23,7 +31,7 @@ safe/known updates to the cache, such as mutations being added, removed, or upda new MutationCache(config): MutationCache; ``` -Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) +Defined in: [packages/query-core/src/mutationCache.ts:129](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L129) #### Parameters @@ -49,7 +57,7 @@ Subscribable.constructor config: MutationCacheConfig = {}; ``` -Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) +Defined in: [packages/query-core/src/mutationCache.ts:129](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L129) *** @@ -75,7 +83,7 @@ Subscribable.listeners clear(): void; ``` -Defined in: [packages/query-core/src/mutationCache.ts:229](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L229) +Defined in: [packages/query-core/src/mutationCache.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L236) Removes all mutations from the cache. @@ -101,7 +109,7 @@ find(filters): | undefined; ``` -Defined in: [packages/query-core/src/mutationCache.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L271) +Defined in: [packages/query-core/src/mutationCache.ts:278](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L278) A slightly more advanced method that can be used to get an existing mutation instance from the cache. If the mutation does not exist, `undefined` is returned. @@ -158,7 +166,7 @@ const mutation = mutationCache.find({ mutationKey: ['addPost'] }) findAll(filters): Mutation[]; ``` -Defined in: [packages/query-core/src/mutationCache.ts:301](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L301) +Defined in: [packages/query-core/src/mutationCache.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L308) An even more advanced method that can be used to get existing mutation instances from the cache that match the given filters. If no mutations match, an empty array is returned. @@ -196,7 +204,7 @@ const mutations = mutationCache.findAll({ mutationKey: ['addPost'] }) getAll(): Mutation[]; ``` -Defined in: [packages/query-core/src/mutationCache.ts:252](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L252) +Defined in: [packages/query-core/src/mutationCache.ts:259](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L259) Returns all mutations within the cache. diff --git a/docs/framework/lit/reference/classes/QueryCache.md b/docs/framework/lit/reference/classes/QueryCache.md index 2b9aeb6e26a..b3ebf24e6fc 100644 --- a/docs/framework/lit/reference/classes/QueryCache.md +++ b/docs/framework/lit/reference/classes/QueryCache.md @@ -3,14 +3,24 @@ id: QueryCache title: QueryCache --- -Defined in: [packages/query-core/src/queryCache.ts:113](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L113) +Defined in: [packages/query-core/src/queryCache.ts:123](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L123) The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta information, and state of the queries it contains. Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient` for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of -safe/known updates to the cache, such as queries being added, removed, or updated. +safe/known updates to the cache, such as queries being added, removed, or updated — updates made +outside of the cache's own tracked mechanisms (e.g. mutating a query's state object directly) do +not notify subscribers. + +## Example + +```ts +const unsubscribe = queryCache.subscribe((event) => { + console.log(event.type, event.query) +}) +``` ## Extends @@ -24,7 +34,7 @@ safe/known updates to the cache, such as queries being added, removed, or update new QueryCache(config): QueryCache; ``` -Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) +Defined in: [packages/query-core/src/queryCache.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L126) #### Parameters @@ -50,7 +60,7 @@ Subscribable.constructor config: QueryCacheConfig = {}; ``` -Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) +Defined in: [packages/query-core/src/queryCache.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L126) *** @@ -79,7 +89,7 @@ build( state?): Query; ``` -Defined in: [packages/query-core/src/queryCache.ts:137](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L137) +Defined in: [packages/query-core/src/queryCache.ts:147](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L147) Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or builds and adds a new one to the cache if none exists yet. Used by framework adapters and @@ -141,7 +151,7 @@ const query = queryCache.build(queryClient, { clear(): void; ``` -Defined in: [packages/query-core/src/queryCache.ts:222](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L222) +Defined in: [packages/query-core/src/queryCache.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L232) Removes all queries from the cache. @@ -167,7 +177,7 @@ find(filters): | undefined; ``` -Defined in: [packages/query-core/src/queryCache.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L289) +Defined in: [packages/query-core/src/queryCache.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L299) A slightly more advanced method that can be used to get an existing query instance from the cache. This instance not only contains all the state for the query, but all of the instances, @@ -223,7 +233,7 @@ const query = queryCache.find({ queryKey: ['posts'] }) findAll(filters): Query[]; ``` -Defined in: [packages/query-core/src/queryCache.ts:314](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L314) +Defined in: [packages/query-core/src/queryCache.ts:324](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L324) An even more advanced method that can be used to get existing query instances from the cache that partially match a query key. If no queries match, an empty array is returned. @@ -263,7 +273,7 @@ get(queryHash): | undefined; ``` -Defined in: [packages/query-core/src/queryCache.ts:244](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L244) +Defined in: [packages/query-core/src/queryCache.ts:254](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L254) Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none exists. Unlike [QueryCache#find](#find), this looks up by the already-computed hash rather @@ -316,7 +326,7 @@ const query = queryCache.get(queryHash) getAll(): Query[]; ``` -Defined in: [packages/query-core/src/queryCache.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L267) +Defined in: [packages/query-core/src/queryCache.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L277) Returns all queries within the cache. @@ -400,7 +410,7 @@ Subscribable.onUnsubscribe remove(query): void; ``` -Defined in: [packages/query-core/src/queryCache.ts:198](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L198) +Defined in: [packages/query-core/src/queryCache.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L208) Destroys the given `Query` and removes it from the cache, notifying subscribers with a `'removed'` event. A no-op if the query is no longer the one currently stored under its hash diff --git a/docs/framework/lit/reference/classes/QueryClient.md b/docs/framework/lit/reference/classes/QueryClient.md index 7c44606f696..2b0254ffb05 100644 --- a/docs/framework/lit/reference/classes/QueryClient.md +++ b/docs/framework/lit/reference/classes/QueryClient.md @@ -3,12 +3,14 @@ id: QueryClient title: QueryClient --- -Defined in: [packages/query-core/src/queryClient.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L78) +Defined in: [packages/query-core/src/queryClient.ts:79](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L79) `QueryClient` is used to interact with a cache of queries and mutations. It owns a `QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds the default options that are applied to queries and mutations created through it. +## Example + ```ts const queryClient = new QueryClient({ defaultOptions: { @@ -29,7 +31,7 @@ await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts }) new QueryClient(config): QueryClient; ``` -Defined in: [packages/query-core/src/queryClient.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L88) +Defined in: [packages/query-core/src/queryClient.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L89) #### Parameters @@ -49,7 +51,7 @@ Defined in: [packages/query-core/src/queryClient.ts:88](https://github.com/TanSt cancelQueries(filters?, cancelOptions?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L425) +Defined in: [packages/query-core/src/queryClient.ts:432](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L432) Cancels outgoing fetches for queries matching the given filters. Most useful when performing optimistic updates, since any outgoing refetch that resolves afterwards would otherwise @@ -92,7 +94,7 @@ await queryClient.cancelQueries({ queryKey: ['posts'], exact: true }) clear(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1073) +Defined in: [packages/query-core/src/queryClient.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1083) Clears both the query cache and the mutation cache this client is connected to. @@ -117,7 +119,7 @@ queryClient.clear() defaultMutationOptions(options?): T; ``` -Defined in: [packages/query-core/src/queryClient.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1047) +Defined in: [packages/query-core/src/queryClient.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1057) The mutation counterpart of [QueryClient#defaultQueryOptions](#defaultqueryoptions). Called by framework adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the @@ -148,7 +150,7 @@ on top. A no-op if the options are already defaulted (`_defaulted: true`). defaultQueryOptions(options): DefaultedQueryObserverOptions; ``` -Defined in: [packages/query-core/src/queryClient.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L960) +Defined in: [packages/query-core/src/queryClient.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L970) Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the @@ -199,7 +201,7 @@ on top. A no-op if the options are already defaulted (`_defaulted: true`). ensureInfiniteQueryData(options): Promise>; ``` -Defined in: [packages/query-core/src/queryClient.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L725) +Defined in: [packages/query-core/src/queryClient.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L735) #### Type Parameters @@ -245,7 +247,7 @@ Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This ensureQueryData(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L196) +Defined in: [packages/query-core/src/queryClient.ts:197](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L197) #### Type Parameters @@ -287,7 +289,7 @@ Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method fetchInfiniteQuery(options): Promise>; ``` -Defined in: [packages/query-core/src/queryClient.ts:682](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L682) +Defined in: [packages/query-core/src/queryClient.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L692) #### Type Parameters @@ -333,7 +335,7 @@ Use queryClient.infiniteQuery(options) instead. This method will be removed in t fetchQuery(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L590) +Defined in: [packages/query-core/src/queryClient.ts:600](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L600) #### Type Parameters @@ -379,7 +381,7 @@ Use queryClient.query(options) instead. This method will be removed in the next getDefaultOptions(): DefaultOptions; ``` -Defined in: [packages/query-core/src/queryClient.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L808) +Defined in: [packages/query-core/src/queryClient.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L818) Returns the default options that were set when creating the client, or via [QueryClient#setDefaultOptions](#setdefaultoptions). @@ -405,7 +407,7 @@ const defaultOptions = queryClient.getDefaultOptions() getMutationCache(): MutationCache; ``` -Defined in: [packages/query-core/src/queryClient.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L792) +Defined in: [packages/query-core/src/queryClient.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L802) Returns the mutation cache this client is connected to. @@ -431,7 +433,7 @@ const mutations = mutationCache.findAll({ status: 'pending' }) getMutationDefaults(mutationKey): OmitKeyof, "mutationKey">; ``` -Defined in: [packages/query-core/src/queryClient.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L935) +Defined in: [packages/query-core/src/queryClient.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L945) Returns the default options registered for mutations whose mutation key partially matches the given `mutationKey`, via [QueryClient#setMutationDefaults](#setmutationdefaults). If multiple registered @@ -461,12 +463,18 @@ const defaultOptions = queryClient.getMutationDefaults(['addPost']) getQueriesData(filters): [readonly unknown[], TQueryFnData | undefined][]; ``` -Defined in: [packages/query-core/src/queryClient.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L233) +Defined in: [packages/query-core/src/queryClient.ts:240](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L240) Imperative (non-reactive) way to retrieve the cached data of multiple queries at once. Only queries matching the given filters are returned; if none match, an empty array is returned. +Because the matched queries can hold data of different shapes (e.g. a broad filter can match +queries with unrelated data types), the `TQueryFnData` generic defaults to `unknown` rather +than being inferred. Passing a more specific type is a convenience for call sites that know +every matched query holds the same shape — it is not checked against the actual cache +contents. + #### Type Parameters ##### TQueryFnData @@ -505,7 +513,7 @@ const data = queryClient.getQueriesData({ queryKey: ['posts'] }) getQueryCache(): QueryCache; ``` -Defined in: [packages/query-core/src/queryClient.ts:776](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L776) +Defined in: [packages/query-core/src/queryClient.ts:786](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L786) Returns the query cache this client is connected to. @@ -531,7 +539,7 @@ const queries = queryCache.findAll({ queryKey: ['posts'] }) getQueryData(queryKey): TInferredQueryFnData | undefined; ``` -Defined in: [packages/query-core/src/queryClient.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L182) +Defined in: [packages/query-core/src/queryClient.ts:183](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L183) Imperative (non-reactive) way to retrieve data for a QueryKey. Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. @@ -575,7 +583,7 @@ Use `useQuery` to create a `QueryObserver` that subscribes to changes. getQueryDefaults(queryKey): OmitKeyof, "queryKey">; ``` -Defined in: [packages/query-core/src/queryClient.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L878) +Defined in: [packages/query-core/src/queryClient.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L888) Returns the default options registered for queries whose query key partially matches the given `queryKey`, via [QueryClient#setQueryDefaults](#setquerydefaults). If multiple registered defaults @@ -607,7 +615,7 @@ getQueryState(options): Promise[] ? InfiniteData : TData>; ``` -Defined in: [packages/query-core/src/queryClient.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L656) +Defined in: [packages/query-core/src/queryClient.ts:666](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L666) Asynchronous method to fetch and cache an infinite query, resolving with an [InfiniteData](../interfaces/InfiniteData.md) object or throwing with the error. @@ -723,7 +731,7 @@ try { invalidateQueries(filters?, options?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:453](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L453) +Defined in: [packages/query-core/src/queryClient.ts:460](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L460) Marks queries matching the given filters as invalidated. Unlike [QueryClient#removeQueries](#removequeries), invalidated queries stay in the cache. @@ -766,7 +774,7 @@ await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' isFetching(filters?): number; ``` -Defined in: [packages/query-core/src/queryClient.ts:149](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L149) +Defined in: [packages/query-core/src/queryClient.ts:150](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L150) Returns the number of queries in the cache that are currently fetching, optionally matching a set of filters. This includes background-fetching, loading new pages, and @@ -804,7 +812,7 @@ if (queryClient.isFetching()) { isMutating(filters?): number; ``` -Defined in: [packages/query-core/src/queryClient.ts:167](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L167) +Defined in: [packages/query-core/src/queryClient.ts:168](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L168) Returns the number of mutations in the cache that are currently pending, optionally matching a set of filters. @@ -841,7 +849,7 @@ if (queryClient.isMutating()) { mount(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L103) +Defined in: [packages/query-core/src/queryClient.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L104) Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start listening for focus/online events and resume paused mutations. Ref-counted via an internal @@ -860,7 +868,7 @@ the shared listeners until the last one unmounts. prefetchInfiniteQuery(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L704) +Defined in: [packages/query-core/src/queryClient.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L714) #### Type Parameters @@ -906,7 +914,7 @@ Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.ca prefetchQuery(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:624](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L624) +Defined in: [packages/query-core/src/queryClient.ts:634](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L634) #### Type Parameters @@ -948,7 +956,7 @@ Use queryClient.query(options) instead. You can swallow errors with `.catch(noop query(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:544](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L544) +Defined in: [packages/query-core/src/queryClient.ts:554](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L554) Asynchronous method to fetch and cache a query, resolving with the data or throwing with the error. @@ -958,12 +966,15 @@ If the query already exists in the cache and its data is not stale (per the give and the promise resolves once the fetch settles. If a `select` function is provided, it is applied to the data in both cases (cached or freshly fetched) before it is returned. -Unlike `useQuery`, retries are disabled by default here (`retry: false`) unless explicitly -configured, since there is no component to catch a thrown error and retry through re-render. +Unlike a reactive observer, retries are disabled by default here (`retry: false`) unless +explicitly configured, since there is no component to catch a thrown error and retry through +re-render. -The accepted options are a subset of `useQuery`'s options: fields that only make sense for a -reactive observer (e.g. `enabled`, `refetchInterval`, `refetchOnWindowFocus`, `notifyOnChangeProps`, -`throwOnError`, `suspense`, `placeholderData`) are not part of this method's options. +The accepted options are `QueryObserverOptions` minus the fields that only make sense for a +reactive observer — `enabled`, `refetchInterval`, `refetchIntervalInBackground`, +`refetchOnWindowFocus`, `refetchOnReconnect`, `refetchOnMount`, `retryOnMount`, +`notifyOnChangeProps`, `throwOnError`, `suspense`, and `placeholderData` are not part of this +method's options. This method replaces the deprecated `fetchQuery`, and — combined with `{ staleTime: 'static' }` — the deprecated `ensureQueryData`. @@ -1022,7 +1033,7 @@ try { refetchQueries(filters?, options?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:490](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L490) +Defined in: [packages/query-core/src/queryClient.ts:497](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L497) Refetches queries matching the given filters, regardless of whether they are stale. Without filters, every query in the cache is refetched. Queries that are disabled, or static (only @@ -1067,7 +1078,7 @@ await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' }) removeQueries(filters?): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:369](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L369) +Defined in: [packages/query-core/src/queryClient.ts:376](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L376) Removes queries from the cache that match the given filters. Unlike [QueryClient#invalidateQueries](#invalidatequeries) or [QueryClient#refetchQueries](#refetchqueries), this removes @@ -1104,7 +1115,7 @@ queryClient.removeQueries({ queryKey: ['posts'], exact: true }) resetQueries(filters?, options?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L390) +Defined in: [packages/query-core/src/queryClient.ts:397](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L397) Resets queries matching the given filters back to their initial state (e.g. any `initialData`), notifying subscribers rather than removing them. Active queries among the @@ -1144,7 +1155,7 @@ await queryClient.resetQueries({ queryKey: ['posts'], exact: true }) resumePausedMutations(): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:757](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L757) +Defined in: [packages/query-core/src/queryClient.ts:767](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L767) Resumes mutations that were paused because there was no network connection. Does nothing (resolving immediately) if the client is currently offline. @@ -1170,7 +1181,7 @@ await queryClient.resumePausedMutations() setDefaultOptions(options): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L829) +Defined in: [packages/query-core/src/queryClient.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L839) Dynamically sets the default options for this client, overwriting any previously defined default options. @@ -1210,7 +1221,7 @@ queryClient.setDefaultOptions({ setMutationDefaults(mutationKey, options): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L907) +Defined in: [packages/query-core/src/queryClient.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L917) Sets default options for mutations whose mutation key partially matches the given `mutationKey`. As with [QueryClient#setQueryDefaults](#setquerydefaults), the order of registration @@ -1269,7 +1280,7 @@ setQueriesData( options?): [readonly unknown[], TQueryFnData | undefined][]; ``` -Defined in: [packages/query-core/src/queryClient.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L312) +Defined in: [packages/query-core/src/queryClient.ts:319](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L319) Synchronous way to immediately update the cached data of multiple queries at once, using filters or partial query key matching. Only queries that already exist and match the given @@ -1323,7 +1334,7 @@ setQueryData( options?): NoInfer | undefined; ``` -Defined in: [packages/query-core/src/queryClient.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L264) +Defined in: [packages/query-core/src/queryClient.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L271) Synchronous way to immediately update a query's cached data. If the updater (or the value passed) resolves to `undefined`, the cache is left untouched and no query is created; @@ -1387,7 +1398,7 @@ queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost]) setQueryDefaults(queryKey, options): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L848) +Defined in: [packages/query-core/src/queryClient.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L858) Sets default options for queries whose query key partially matches the given `queryKey`. @@ -1444,7 +1455,7 @@ await queryClient.query({ queryKey: ['posts'] }) unmount(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L126) +Defined in: [packages/query-core/src/queryClient.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L127) The inverse of [QueryClient#mount](#mount) — called by a framework adapter's `QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online diff --git a/docs/framework/lit/reference/functions/experimental_streamedQuery.md b/docs/framework/lit/reference/functions/experimental_streamedQuery.md index afd44df7c5f..4c490322d60 100644 --- a/docs/framework/lit/reference/functions/experimental_streamedQuery.md +++ b/docs/framework/lit/reference/functions/experimental_streamedQuery.md @@ -4,10 +4,10 @@ title: experimental_streamedQuery --- ```ts -function experimental_streamedQuery(queryFn): QueryFunction; +function experimental_streamedQuery(streamFn): QueryFunction; ``` -Defined in: [packages/query-core/src/streamedQuery.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L60) +Defined in: [packages/query-core/src/streamedQuery.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L75) This is a helper function to create a query function that streams data from an AsyncIterable. Data will be an Array of all the chunks received. @@ -30,7 +30,7 @@ The query will stay in fetchStatus 'fetching' until the stream ends. ## Parameters -### queryFn +### streamFn `StreamedQueryParams`\<`TQueryFnData`, `TData`, `TQueryKey`\> diff --git a/docs/framework/lit/reference/interfaces/CancelOptions.md b/docs/framework/lit/reference/interfaces/CancelOptions.md index 2b9293712d2..14394c18533 100644 --- a/docs/framework/lit/reference/interfaces/CancelOptions.md +++ b/docs/framework/lit/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) +Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1466) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1444) +Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1467) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1445](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1445) +Defined in: [packages/query-core/src/types.ts:1468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1468) diff --git a/docs/framework/lit/reference/interfaces/DefaultOptions.md b/docs/framework/lit/reference/interfaces/DefaultOptions.md index 149ef5b3444..026116d11db 100644 --- a/docs/framework/lit/reference/interfaces/DefaultOptions.md +++ b/docs/framework/lit/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) +Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) ## Type Parameters @@ -19,7 +19,9 @@ Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/ optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) + +Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). *** @@ -29,7 +31,9 @@ Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/ optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) + +Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). #### deserializeData? @@ -63,7 +67,9 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) + +Default options applied to every mutation, unless overridden per-mutation. *** @@ -73,4 +79,6 @@ Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/ optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) + +Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/lit/reference/interfaces/FetchNextPageOptions.md b/docs/framework/lit/reference/interfaces/FetchNextPageOptions.md index fefe7f30c13..d12afe35fe1 100644 --- a/docs/framework/lit/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/lit/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L716) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) +Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/lit/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/lit/reference/interfaces/FetchPreviousPageOptions.md index ad3c3c736c9..93ca92088f1 100644 --- a/docs/framework/lit/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/lit/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) +Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult.md index 94347ea2e40..f1443c39625 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) +Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) +Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) +Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) +Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) +Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 3e0d3a79fa1..7c55201c028 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) +Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult.md index f6400f44b52..f9541ebd73b 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) +Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult.md index 53d910f545d..1bab3233ec9 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1009) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1013](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1013) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1027](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1027) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1017](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1017) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1016](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1016) +Defined in: [packages/query-core/src/types.ts:1029](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1029) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1021](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1021) +Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1023](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1023) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index 5949179bc6f..58310e1af49 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) +Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) +Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) +Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index e299e60ddc3..22ed760c153 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) +Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) +Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) +Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 7b550e0a90b..732c882f86f 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) +Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) +Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InvalidateOptions.md b/docs/framework/lit/reference/interfaces/InvalidateOptions.md index 494afe1c465..1cd96c88165 100644 --- a/docs/framework/lit/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/lit/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L700) +Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L713) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/lit/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/lit/reference/interfaces/InvalidateQueryFilters.md index 4824d80d910..35fd04b9378 100644 --- a/docs/framework/lit/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/lit/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:690](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L690) +Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -100,7 +100,14 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:693](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L693) +Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) + +Controls which of the matched (now-invalidated) queries are refetched in the background. +Defaults to `'active'`. +- `'active'`: only queries with at least one active observer are refetched. +- `'inactive'`: only queries with no active observer are refetched. +- `'all'`: every matched query is refetched, active or not. +- `'none'`: no query is refetched; matched queries are only marked as invalidated. *** diff --git a/docs/framework/lit/reference/interfaces/MutateOptions.md b/docs/framework/lit/reference/interfaces/MutateOptions.md index a0af091a997..6e27e4e6d29 100644 --- a/docs/framework/lit/reference/interfaces/MutateOptions.md +++ b/docs/framework/lit/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1228) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1234) +Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1247) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1222](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1222) +Defined in: [packages/query-core/src/types.ts:1235](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1235) #### Parameters diff --git a/docs/framework/lit/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/lit/reference/interfaces/MutationObserverBaseResult.md index 98810323966..190d4d4d3b6 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) +Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) +Defined in: [packages/query-core/src/types.ts:1289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1289) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1285) +Defined in: [packages/query-core/src/types.ts:1298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1298) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) +Defined in: [packages/query-core/src/types.ts:1303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1303) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1295) +Defined in: [packages/query-core/src/types.ts:1308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1308) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1300](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1300) +Defined in: [packages/query-core/src/types.ts:1313](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1313) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1305](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1305) +Defined in: [packages/query-core/src/types.ts:1318](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1318) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1314](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1314) +Defined in: [packages/query-core/src/types.ts:1327](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1327) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) +Defined in: [packages/query-core/src/types.ts:1293](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1293) The variables object passed to the `mutationFn`. diff --git a/docs/framework/lit/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/lit/reference/interfaces/MutationObserverErrorResult.md index d61f244ced4..03af3a33d12 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1374](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1374) +Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1385](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1385) +Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1386](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1386) +Defined in: [packages/query-core/src/types.ts:1399](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1399) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1388](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1388) +Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1389](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1389) +Defined in: [packages/query-core/src/types.ts:1402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1402) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1390) +Defined in: [packages/query-core/src/types.ts:1403](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1403) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) +Defined in: [packages/query-core/src/types.ts:1404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1404) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) +Defined in: [packages/query-core/src/types.ts:1405](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1405) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) +Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) The variables object passed to the `mutationFn`. diff --git a/docs/framework/lit/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/lit/reference/interfaces/MutationObserverIdleResult.md index 93655da0aa5..833db327a04 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1332](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1332) +Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) +Defined in: [packages/query-core/src/types.ts:1356](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1356) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) +Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1346](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1346) +Defined in: [packages/query-core/src/types.ts:1359](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1359) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1347) +Defined in: [packages/query-core/src/types.ts:1360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1360) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) +Defined in: [packages/query-core/src/types.ts:1361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1361) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1349) +Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1350](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1350) +Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) +Defined in: [packages/query-core/src/types.ts:1357](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1357) The variables object passed to the `mutationFn`. diff --git a/docs/framework/lit/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/lit/reference/interfaces/MutationObserverLoadingResult.md index de146c45f5c..6732628f444 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) +Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1364](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1364) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) +Defined in: [packages/query-core/src/types.ts:1379](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1379) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1367](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1367) +Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) +Defined in: [packages/query-core/src/types.ts:1381](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1381) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1369](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1369) +Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1370](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1370) +Defined in: [packages/query-core/src/types.ts:1383](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1383) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1371](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1371) +Defined in: [packages/query-core/src/types.ts:1384](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1384) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1365) +Defined in: [packages/query-core/src/types.ts:1378](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1378) The variables object passed to the `mutationFn`. diff --git a/docs/framework/lit/reference/interfaces/MutationObserverOptions.md b/docs/framework/lit/reference/interfaces/MutationObserverOptions.md index fe59cc7444d..be502d19332 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) +Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1220) ## Extends @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) #### Inherited from @@ -49,7 +49,7 @@ Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) #### Inherited from @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) #### Inherited from @@ -77,7 +77,7 @@ Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) +Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) #### Inherited from @@ -91,7 +91,7 @@ Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Inherited from @@ -105,7 +105,7 @@ Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Parameters @@ -141,7 +141,7 @@ Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) #### Parameters @@ -169,7 +169,7 @@ Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) #### Parameters @@ -209,7 +209,7 @@ Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) #### Parameters @@ -245,7 +245,7 @@ Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) #### Inherited from @@ -259,7 +259,7 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) #### Inherited from @@ -273,7 +273,7 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) +Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) #### Inherited from @@ -287,4 +287,4 @@ Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) diff --git a/docs/framework/lit/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/lit/reference/interfaces/MutationObserverSuccessResult.md index b50ec4ab6f1..89e8c2739cc 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) +Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1406](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1406) +Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1407) +Defined in: [packages/query-core/src/types.ts:1420](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1420) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1409) +Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1410](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1410) +Defined in: [packages/query-core/src/types.ts:1423](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1423) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) +Defined in: [packages/query-core/src/types.ts:1424](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1424) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) +Defined in: [packages/query-core/src/types.ts:1425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1425) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) +Defined in: [packages/query-core/src/types.ts:1426](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1426) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) +Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) The variables object passed to the `mutationFn`. diff --git a/docs/framework/lit/reference/interfaces/MutationOptions.md b/docs/framework/lit/reference/interfaces/MutationOptions.md index f641d241142..8721b62d099 100644 --- a/docs/framework/lit/reference/interfaces/MutationOptions.md +++ b/docs/framework/lit/reference/interfaces/MutationOptions.md @@ -3,7 +3,7 @@ id: MutationOptions title: MutationOptions --- -Defined in: [packages/query-core/src/types.ts:1166](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1166) +Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) ## Extended by @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1166](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) *** @@ -45,7 +45,7 @@ Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) *** @@ -55,7 +55,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) *** @@ -65,7 +65,7 @@ Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) +Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) *** @@ -75,7 +75,7 @@ Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) *** @@ -85,7 +85,7 @@ Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Parameters @@ -117,7 +117,7 @@ Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) #### Parameters @@ -141,7 +141,7 @@ Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) #### Parameters @@ -177,7 +177,7 @@ Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) #### Parameters @@ -209,7 +209,7 @@ Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) *** @@ -219,7 +219,7 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) *** @@ -229,4 +229,4 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) +Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) diff --git a/docs/framework/lit/reference/interfaces/NotifyEvent.md b/docs/framework/lit/reference/interfaces/NotifyEvent.md index 1dc93464df1..17b3241654f 100644 --- a/docs/framework/lit/reference/interfaces/NotifyEvent.md +++ b/docs/framework/lit/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1462) +Defined in: [packages/query-core/src/types.ts:1485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1485) diff --git a/docs/framework/lit/reference/interfaces/QueryCacheConfig.md b/docs/framework/lit/reference/interfaces/QueryCacheConfig.md index 69ea600366c..3c6aebe496f 100644 --- a/docs/framework/lit/reference/interfaces/QueryCacheConfig.md +++ b/docs/framework/lit/reference/interfaces/QueryCacheConfig.md @@ -3,11 +3,12 @@ id: QueryCacheConfig title: QueryCacheConfig --- -Defined in: [packages/query-core/src/queryCache.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L24) +Defined in: [packages/query-core/src/queryCache.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L25) Global callbacks that fire for every query handled by a `QueryCache`, regardless of which component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can -override, these callbacks are always called. +override, these callbacks are always called. Unlike `MutationCacheConfig`'s callbacks, these +are fire-and-forget: their return value is not awaited before the query settles. ## Properties @@ -17,7 +18,7 @@ override, these callbacks are always called. optional onError: (error, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L26) +Defined in: [packages/query-core/src/queryCache.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L27) Called when any query in the cache encounters an error. @@ -43,7 +44,7 @@ Called when any query in the cache encounters an error. optional onSettled: (data, error, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L33) +Defined in: [packages/query-core/src/queryCache.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L34) Called when any query in the cache is settled, either successfully or with an error. @@ -73,7 +74,7 @@ Called when any query in the cache is settled, either successfully or with an er optional onSuccess: (data, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L31) +Defined in: [packages/query-core/src/queryCache.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L32) Called when any query in the cache is successful. diff --git a/docs/framework/lit/reference/interfaces/QueryClientConfig.md b/docs/framework/lit/reference/interfaces/QueryClientConfig.md index 7c9bc255b35..b04dadba88c 100644 --- a/docs/framework/lit/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/lit/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [packages/query-core/src/types.ts:1427](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1427) +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) ## Properties @@ -13,7 +13,9 @@ Defined in: [packages/query-core/src/types.ts:1427](https://github.com/TanStack/ optional defaultOptions: DefaultOptions; ``` -Defined in: [packages/query-core/src/types.ts:1430](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1430) +Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) + +Default options for all queries and mutations created through this client. *** @@ -23,7 +25,10 @@ Defined in: [packages/query-core/src/types.ts:1430](https://github.com/TanStack/ optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) +Defined in: [packages/query-core/src/types.ts:1447](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1447) + +The mutation cache this client is connected to. A new `MutationCache` is created if not +provided. *** @@ -33,4 +38,6 @@ Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/ optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1428) +Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) + +The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/lit/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/lit/reference/interfaces/QueryObserverBaseResult.md index 2840be27e27..4689d9d661a 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) +Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L743) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) +Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) +Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) +Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) +Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/lit/reference/interfaces/QueryObserverLoadingErrorResult.md index 97d5d5125a7..86ae34b80ab 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) +Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/lit/reference/interfaces/QueryObserverLoadingResult.md index 1f442f18130..a0024077883 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L873) +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) +Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) +Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:885](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L885) +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:884](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L884) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/lit/reference/interfaces/QueryObserverPendingResult.md index ad040ff9cc5..21fab248a7c 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:862](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L862) +Defined in: [packages/query-core/src/types.ts:875](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L875) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) +Defined in: [packages/query-core/src/types.ts:876](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L876) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:864](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L864) +Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:866](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L866) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:865](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L865) +Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:869](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L869) +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) +Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:870](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L870) +Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/lit/reference/interfaces/QueryObserverPlaceholderResult.md index 8a1ae61dee9..89af2502c11 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) +Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) +Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) +Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) +Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/lit/reference/interfaces/QueryObserverRefetchErrorResult.md index c8d5274697a..dab5586fdc1 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) +Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/lit/reference/interfaces/QueryObserverSuccessResult.md index e3c834e6c3a..b180b89ca62 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) +Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/RefetchOptions.md b/docs/framework/lit/reference/interfaces/RefetchOptions.md index a3db94b1674..b502dcd3492 100644 --- a/docs/framework/lit/reference/interfaces/RefetchOptions.md +++ b/docs/framework/lit/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L679) +Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L684) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,7 +38,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/lit/reference/interfaces/RefetchQueryFilters.md b/docs/framework/lit/reference/interfaces/RefetchQueryFilters.md index f2b6b287875..84f917c6201 100644 --- a/docs/framework/lit/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/lit/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:696](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L696) +Defined in: [packages/query-core/src/types.ts:709](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L709) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. diff --git a/docs/framework/lit/reference/interfaces/ResetOptions.md b/docs/framework/lit/reference/interfaces/ResetOptions.md index bfa931717f8..1855fef3064 100644 --- a/docs/framework/lit/reference/interfaces/ResetOptions.md +++ b/docs/framework/lit/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) +Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L714) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/lit/reference/interfaces/ResultOptions.md b/docs/framework/lit/reference/interfaces/ResultOptions.md index dbf00d6c67e..9766c56d1a6 100644 --- a/docs/framework/lit/reference/interfaces/ResultOptions.md +++ b/docs/framework/lit/reference/interfaces/ResultOptions.md @@ -19,4 +19,8 @@ Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. diff --git a/docs/framework/lit/reference/interfaces/SetDataOptions.md b/docs/framework/lit/reference/interfaces/SetDataOptions.md index 5fcbcfdf7cd..4262e781b05 100644 --- a/docs/framework/lit/reference/interfaces/SetDataOptions.md +++ b/docs/framework/lit/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1448) +Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1471) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) +Defined in: [packages/query-core/src/types.ts:1472](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1472) diff --git a/docs/framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index b0761bffacc..0b7be77eb7d 100644 --- a/docs/framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/lit/reference/type-aliases/DefinedQueryObserverResult.md index 144e0567b6d..f8d52177d06 100644 --- a/docs/framework/lit/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/lit/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/FetchStatus.md b/docs/framework/lit/reference/type-aliases/FetchStatus.md index 4dae9444af6..7b71e54eacd 100644 --- a/docs/framework/lit/reference/type-aliases/FetchStatus.md +++ b/docs/framework/lit/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) diff --git a/docs/framework/lit/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/lit/reference/type-aliases/InfiniteQueryObserverResult.md index 08d178e4fb0..e7822e69448 100644 --- a/docs/framework/lit/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/lit/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/MutateFunction.md b/docs/framework/lit/reference/type-aliases/MutateFunction.md index f574ca7f8ca..284bd0fc270 100644 --- a/docs/framework/lit/reference/type-aliases/MutateFunction.md +++ b/docs/framework/lit/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1258) +Defined in: [packages/query-core/src/types.ts:1271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1271) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/MutateFunctionRest.md b/docs/framework/lit/reference/type-aliases/MutateFunctionRest.md index aef21572aeb..a2f16ea5302 100644 --- a/docs/framework/lit/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/lit/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1243](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1243) +Defined in: [packages/query-core/src/types.ts:1256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1256) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/MutationFunction.md b/docs/framework/lit/reference/type-aliases/MutationFunction.md index e306a5f1a48..4c8c7aed384 100644 --- a/docs/framework/lit/reference/type-aliases/MutationFunction.md +++ b/docs/framework/lit/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1161](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1161) +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/MutationFunctionContext.md b/docs/framework/lit/reference/type-aliases/MutationFunctionContext.md index b29a54df298..ef228cc53d3 100644 --- a/docs/framework/lit/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/lit/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) +Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) +Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1169) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) +Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1170) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1158](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1158) +Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) diff --git a/docs/framework/lit/reference/type-aliases/MutationKey.md b/docs/framework/lit/reference/type-aliases/MutationKey.md index f89c6959883..7157d6052fd 100644 --- a/docs/framework/lit/reference/type-aliases/MutationKey.md +++ b/docs/framework/lit/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) diff --git a/docs/framework/lit/reference/type-aliases/MutationMeta.md b/docs/framework/lit/reference/type-aliases/MutationMeta.md index e1d481cdcf1..f3bf9984fab 100644 --- a/docs/framework/lit/reference/type-aliases/MutationMeta.md +++ b/docs/framework/lit/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1147](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1147) +Defined in: [packages/query-core/src/types.ts:1160](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1160) diff --git a/docs/framework/lit/reference/type-aliases/MutationObserverResult.md b/docs/framework/lit/reference/type-aliases/MutationObserverResult.md index efbc2881319..ad7dab33719 100644 --- a/docs/framework/lit/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/lit/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) +Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/MutationScope.md b/docs/framework/lit/reference/type-aliases/MutationScope.md index 6ec14643477..a2511c903d9 100644 --- a/docs/framework/lit/reference/type-aliases/MutationScope.md +++ b/docs/framework/lit/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) +Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) +Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) diff --git a/docs/framework/lit/reference/type-aliases/MutationStatus.md b/docs/framework/lit/reference/type-aliases/MutationStatus.md index eedf0fb979a..d9b58cdd26f 100644 --- a/docs/framework/lit/reference/type-aliases/MutationStatus.md +++ b/docs/framework/lit/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) +Defined in: [packages/query-core/src/types.ts:1154](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1154) diff --git a/docs/framework/lit/reference/type-aliases/NotifyEventType.md b/docs/framework/lit/reference/type-aliases/NotifyEventType.md index 4c4f5e46007..57d44fb7b0b 100644 --- a/docs/framework/lit/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/lit/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) diff --git a/docs/framework/lit/reference/type-aliases/QueryCacheNotifyEvent.md b/docs/framework/lit/reference/type-aliases/QueryCacheNotifyEvent.md index 1a3039093c4..0d4cadc4f89 100644 --- a/docs/framework/lit/reference/type-aliases/QueryCacheNotifyEvent.md +++ b/docs/framework/lit/reference/type-aliases/QueryCacheNotifyEvent.md @@ -14,7 +14,7 @@ type QueryCacheNotifyEvent = | NotifyEventQueryObserverOptionsUpdated; ``` -Defined in: [packages/query-core/src/queryCache.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L84) +Defined in: [packages/query-core/src/queryCache.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L85) The event passed to a `QueryCache` subscriber. Fired whenever a query is added or removed from the cache, its state is updated (e.g. via `query.setState` or `queryClient.removeQueries`), or diff --git a/docs/framework/lit/reference/type-aliases/QueryObserverResult.md b/docs/framework/lit/reference/type-aliases/QueryObserverResult.md index c132281b78e..6ee9c323535 100644 --- a/docs/framework/lit/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/lit/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) +Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/QueryStatus.md b/docs/framework/lit/reference/type-aliases/QueryStatus.md index ed6059e03ec..3fc872e604b 100644 --- a/docs/framework/lit/reference/type-aliases/QueryStatus.md +++ b/docs/framework/lit/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) +Defined in: [packages/query-core/src/types.ts:740](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L740) diff --git a/docs/framework/lit/reference/type-aliases/TimeoutProvider.md b/docs/framework/lit/reference/type-aliases/TimeoutProvider.md index 6416fe4c557..3509105bcd1 100644 --- a/docs/framework/lit/reference/type-aliases/TimeoutProvider.md +++ b/docs/framework/lit/reference/type-aliases/TimeoutProvider.md @@ -7,10 +7,16 @@ title: TimeoutProvider type TimeoutProvider = object; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:22](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L22) +Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) Backend for timer functions. +Timers are performance-sensitive: short-lived timers (delays under a few seconds) tend to be +latency-sensitive, while long-lived ones may benefit more from coalescing — batching timers +with similar deadlines together — which the default provider (backed by the platform's global +`setTimeout`/`setInterval`) does not do. A custom provider can implement coalescing, and can +also support delays longer than the ~24-day maximum of the global `setTimeout`. + ## Type Parameters ### TTimerId @@ -25,7 +31,7 @@ Backend for timer functions. readonly clearInterval: (intervalId) => void; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) +Defined in: [packages/query-core/src/timeoutManager.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L34) #### Parameters @@ -45,7 +51,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/Ta readonly clearTimeout: (timeoutId) => void; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L25) +Defined in: [packages/query-core/src/timeoutManager.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L31) #### Parameters @@ -65,7 +71,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/Ta readonly setInterval: (callback, delay) => TTimerId; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L27) +Defined in: [packages/query-core/src/timeoutManager.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L33) #### Parameters @@ -89,7 +95,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/Ta readonly setTimeout: (callback, delay) => TTimerId; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L24) +Defined in: [packages/query-core/src/timeoutManager.ts:30](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L30) #### Parameters diff --git a/docs/framework/lit/reference/variables/environmentManager.md b/docs/framework/lit/reference/variables/environmentManager.md index caa1d70b2b6..e207cfd2484 100644 --- a/docs/framework/lit/reference/variables/environmentManager.md +++ b/docs/framework/lit/reference/variables/environmentManager.md @@ -7,9 +7,13 @@ title: environmentManager const environmentManager: object; ``` -Defined in: [packages/query-core/src/environmentManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L15) +Defined in: [packages/query-core/src/environmentManager.ts:29](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L29) -Manages environment detection used by TanStack Query internals. +Manages how TanStack Query detects whether the current runtime should be treated as +server-side. By default, this uses the same detection as the exported `isServer` utility. + +Override this for runtimes that are not traditional browser/server environments (e.g. +extension workers), where the default detection would give the wrong answer. ## Type Declaration @@ -42,3 +46,14 @@ Overrides the server check globally. #### Returns `void` + +## Example + +```ts +import { environmentManager, isServer } from '@tanstack/query-core' + +environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis)) + +// Restore the default behavior: +environmentManager.setIsServer(() => isServer) +``` diff --git a/docs/framework/lit/reference/variables/notifyManager.md b/docs/framework/lit/reference/variables/notifyManager.md index e5ecca8df60..4bdf3478be0 100644 --- a/docs/framework/lit/reference/variables/notifyManager.md +++ b/docs/framework/lit/reference/variables/notifyManager.md @@ -7,7 +7,7 @@ title: notifyManager const notifyManager: object; ``` -Defined in: [packages/query-core/src/notifyManager.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L135) +Defined in: [packages/query-core/src/notifyManager.ts:144](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L144) Handles scheduling and batching callbacks in TanStack Query. @@ -90,7 +90,8 @@ readonly setBatchNotifyFunction: (fn) => void; ``` Use this method to set a custom function to batch notifications together into a single tick. -By default React Query will use the batch function provided by ReactDOM or React Native. +Framework adapters use this to plug in their own batching primitive, so that a single query +update only triggers one re-render instead of one per subscriber. #### Parameters @@ -102,6 +103,15 @@ By default React Query will use the batch function provided by ReactDOM or React `void` +#### Example + +```ts +import { notifyManager } from '@tanstack/query-core' +import { batch } from 'solid-js' + +notifyManager.setBatchNotifyFunction(batch) +``` + ### setNotifyFunction() ```ts diff --git a/docs/framework/lit/reference/variables/timeoutManager.md b/docs/framework/lit/reference/variables/timeoutManager.md index 2dcfa29b55a..ef9cca969e9 100644 --- a/docs/framework/lit/reference/variables/timeoutManager.md +++ b/docs/framework/lit/reference/variables/timeoutManager.md @@ -7,6 +7,6 @@ title: timeoutManager const timeoutManager: TimeoutManager; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:226](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L226) +Defined in: [packages/query-core/src/timeoutManager.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L232) Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/preact/reference/classes/Mutation.md b/docs/framework/preact/reference/classes/Mutation.md index 4e85a5b2d4c..e038a9cd394 100644 --- a/docs/framework/preact/reference/classes/Mutation.md +++ b/docs/framework/preact/reference/classes/Mutation.md @@ -219,7 +219,7 @@ Removable.destroy execute(variables): Promise; ``` -Defined in: [packages/query-core/src/mutation.ts:283](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L283) +Defined in: [packages/query-core/src/mutation.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L284) Runs the mutation function for the given variables through a retryer, and drives the mutation's state and lifecycle callbacks through to settlement. @@ -254,7 +254,8 @@ the original error is re-thrown. #### Example ```ts -// typically invoked by MutationObserver.mutate, not called directly +// Called internally by `MutationObserver.mutate` and `Mutation.continue` — +// applications normally trigger mutations through those, not this method. const data = await mutation.execute(variables) ``` diff --git a/docs/framework/preact/reference/classes/MutationCache.md b/docs/framework/preact/reference/classes/MutationCache.md index f79919b1c4b..5a172b4cb9b 100644 --- a/docs/framework/preact/reference/classes/MutationCache.md +++ b/docs/framework/preact/reference/classes/MutationCache.md @@ -3,7 +3,7 @@ id: MutationCache title: MutationCache --- -Defined in: [packages/query-core/src/mutationCache.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L117) +Defined in: [packages/query-core/src/mutationCache.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L124) The `MutationCache` is the storage for mutations. @@ -11,6 +11,14 @@ Normally, you will not interact with the `MutationCache` directly and instead us `QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of safe/known updates to the cache, such as mutations being added, removed, or updated. +## Example + +```ts +const unsubscribe = mutationCache.subscribe((event) => { + console.log(event.type, event.mutation) +}) +``` + ## Extends - `Subscribable`\<`MutationCacheListener`\> @@ -23,7 +31,7 @@ safe/known updates to the cache, such as mutations being added, removed, or upda new MutationCache(config): MutationCache; ``` -Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) +Defined in: [packages/query-core/src/mutationCache.ts:129](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L129) #### Parameters @@ -49,7 +57,7 @@ Subscribable.constructor config: MutationCacheConfig = {}; ``` -Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) +Defined in: [packages/query-core/src/mutationCache.ts:129](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L129) *** @@ -75,7 +83,7 @@ Subscribable.listeners clear(): void; ``` -Defined in: [packages/query-core/src/mutationCache.ts:229](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L229) +Defined in: [packages/query-core/src/mutationCache.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L236) Removes all mutations from the cache. @@ -101,7 +109,7 @@ find(filters): | undefined; ``` -Defined in: [packages/query-core/src/mutationCache.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L271) +Defined in: [packages/query-core/src/mutationCache.ts:278](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L278) A slightly more advanced method that can be used to get an existing mutation instance from the cache. If the mutation does not exist, `undefined` is returned. @@ -158,7 +166,7 @@ const mutation = mutationCache.find({ mutationKey: ['addPost'] }) findAll(filters): Mutation[]; ``` -Defined in: [packages/query-core/src/mutationCache.ts:301](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L301) +Defined in: [packages/query-core/src/mutationCache.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L308) An even more advanced method that can be used to get existing mutation instances from the cache that match the given filters. If no mutations match, an empty array is returned. @@ -196,7 +204,7 @@ const mutations = mutationCache.findAll({ mutationKey: ['addPost'] }) getAll(): Mutation[]; ``` -Defined in: [packages/query-core/src/mutationCache.ts:252](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L252) +Defined in: [packages/query-core/src/mutationCache.ts:259](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L259) Returns all mutations within the cache. diff --git a/docs/framework/preact/reference/classes/QueryCache.md b/docs/framework/preact/reference/classes/QueryCache.md index 8e435445b2c..b7a577b5e54 100644 --- a/docs/framework/preact/reference/classes/QueryCache.md +++ b/docs/framework/preact/reference/classes/QueryCache.md @@ -3,14 +3,24 @@ id: QueryCache title: QueryCache --- -Defined in: [packages/query-core/src/queryCache.ts:113](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L113) +Defined in: [packages/query-core/src/queryCache.ts:123](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L123) The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta information, and state of the queries it contains. Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient` for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of -safe/known updates to the cache, such as queries being added, removed, or updated. +safe/known updates to the cache, such as queries being added, removed, or updated — updates made +outside of the cache's own tracked mechanisms (e.g. mutating a query's state object directly) do +not notify subscribers. + +## Example + +```ts +const unsubscribe = queryCache.subscribe((event) => { + console.log(event.type, event.query) +}) +``` ## Extends @@ -24,7 +34,7 @@ safe/known updates to the cache, such as queries being added, removed, or update new QueryCache(config): QueryCache; ``` -Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) +Defined in: [packages/query-core/src/queryCache.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L126) #### Parameters @@ -50,7 +60,7 @@ Subscribable.constructor config: QueryCacheConfig = {}; ``` -Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) +Defined in: [packages/query-core/src/queryCache.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L126) *** @@ -79,7 +89,7 @@ build( state?): Query; ``` -Defined in: [packages/query-core/src/queryCache.ts:137](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L137) +Defined in: [packages/query-core/src/queryCache.ts:147](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L147) Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or builds and adds a new one to the cache if none exists yet. Used by framework adapters and @@ -141,7 +151,7 @@ const query = queryCache.build(queryClient, { clear(): void; ``` -Defined in: [packages/query-core/src/queryCache.ts:222](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L222) +Defined in: [packages/query-core/src/queryCache.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L232) Removes all queries from the cache. @@ -167,7 +177,7 @@ find(filters): | undefined; ``` -Defined in: [packages/query-core/src/queryCache.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L289) +Defined in: [packages/query-core/src/queryCache.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L299) A slightly more advanced method that can be used to get an existing query instance from the cache. This instance not only contains all the state for the query, but all of the instances, @@ -223,7 +233,7 @@ const query = queryCache.find({ queryKey: ['posts'] }) findAll(filters): Query[]; ``` -Defined in: [packages/query-core/src/queryCache.ts:314](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L314) +Defined in: [packages/query-core/src/queryCache.ts:324](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L324) An even more advanced method that can be used to get existing query instances from the cache that partially match a query key. If no queries match, an empty array is returned. @@ -263,7 +273,7 @@ get(queryHash): | undefined; ``` -Defined in: [packages/query-core/src/queryCache.ts:244](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L244) +Defined in: [packages/query-core/src/queryCache.ts:254](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L254) Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none exists. Unlike [QueryCache#find](#find), this looks up by the already-computed hash rather @@ -316,7 +326,7 @@ const query = queryCache.get(queryHash) getAll(): Query[]; ``` -Defined in: [packages/query-core/src/queryCache.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L267) +Defined in: [packages/query-core/src/queryCache.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L277) Returns all queries within the cache. @@ -400,7 +410,7 @@ Subscribable.onUnsubscribe remove(query): void; ``` -Defined in: [packages/query-core/src/queryCache.ts:198](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L198) +Defined in: [packages/query-core/src/queryCache.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L208) Destroys the given `Query` and removes it from the cache, notifying subscribers with a `'removed'` event. A no-op if the query is no longer the one currently stored under its hash diff --git a/docs/framework/preact/reference/classes/QueryClient.md b/docs/framework/preact/reference/classes/QueryClient.md index 03250c00243..c7d1a034545 100644 --- a/docs/framework/preact/reference/classes/QueryClient.md +++ b/docs/framework/preact/reference/classes/QueryClient.md @@ -3,12 +3,14 @@ id: QueryClient title: QueryClient --- -Defined in: [packages/query-core/src/queryClient.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L78) +Defined in: [packages/query-core/src/queryClient.ts:79](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L79) `QueryClient` is used to interact with a cache of queries and mutations. It owns a `QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds the default options that are applied to queries and mutations created through it. +## Example + ```ts const queryClient = new QueryClient({ defaultOptions: { @@ -29,7 +31,7 @@ await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts }) new QueryClient(config): QueryClient; ``` -Defined in: [packages/query-core/src/queryClient.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L88) +Defined in: [packages/query-core/src/queryClient.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L89) #### Parameters @@ -49,7 +51,7 @@ Defined in: [packages/query-core/src/queryClient.ts:88](https://github.com/TanSt cancelQueries(filters?, cancelOptions?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L425) +Defined in: [packages/query-core/src/queryClient.ts:432](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L432) Cancels outgoing fetches for queries matching the given filters. Most useful when performing optimistic updates, since any outgoing refetch that resolves afterwards would otherwise @@ -92,7 +94,7 @@ await queryClient.cancelQueries({ queryKey: ['posts'], exact: true }) clear(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1073) +Defined in: [packages/query-core/src/queryClient.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1083) Clears both the query cache and the mutation cache this client is connected to. @@ -117,7 +119,7 @@ queryClient.clear() defaultMutationOptions(options?): T; ``` -Defined in: [packages/query-core/src/queryClient.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1047) +Defined in: [packages/query-core/src/queryClient.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1057) The mutation counterpart of [QueryClient#defaultQueryOptions](#defaultqueryoptions). Called by framework adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the @@ -148,7 +150,7 @@ on top. A no-op if the options are already defaulted (`_defaulted: true`). defaultQueryOptions(options): DefaultedQueryObserverOptions; ``` -Defined in: [packages/query-core/src/queryClient.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L960) +Defined in: [packages/query-core/src/queryClient.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L970) Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the @@ -199,7 +201,7 @@ on top. A no-op if the options are already defaulted (`_defaulted: true`). ensureInfiniteQueryData(options): Promise>; ``` -Defined in: [packages/query-core/src/queryClient.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L725) +Defined in: [packages/query-core/src/queryClient.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L735) #### Type Parameters @@ -245,7 +247,7 @@ Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This ensureQueryData(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L196) +Defined in: [packages/query-core/src/queryClient.ts:197](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L197) #### Type Parameters @@ -287,7 +289,7 @@ Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method fetchInfiniteQuery(options): Promise>; ``` -Defined in: [packages/query-core/src/queryClient.ts:682](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L682) +Defined in: [packages/query-core/src/queryClient.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L692) #### Type Parameters @@ -333,7 +335,7 @@ Use queryClient.infiniteQuery(options) instead. This method will be removed in t fetchQuery(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L590) +Defined in: [packages/query-core/src/queryClient.ts:600](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L600) #### Type Parameters @@ -379,7 +381,7 @@ Use queryClient.query(options) instead. This method will be removed in the next getDefaultOptions(): DefaultOptions; ``` -Defined in: [packages/query-core/src/queryClient.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L808) +Defined in: [packages/query-core/src/queryClient.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L818) Returns the default options that were set when creating the client, or via [QueryClient#setDefaultOptions](#setdefaultoptions). @@ -405,7 +407,7 @@ const defaultOptions = queryClient.getDefaultOptions() getMutationCache(): MutationCache; ``` -Defined in: [packages/query-core/src/queryClient.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L792) +Defined in: [packages/query-core/src/queryClient.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L802) Returns the mutation cache this client is connected to. @@ -431,7 +433,7 @@ const mutations = mutationCache.findAll({ status: 'pending' }) getMutationDefaults(mutationKey): OmitKeyof, "mutationKey">; ``` -Defined in: [packages/query-core/src/queryClient.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L935) +Defined in: [packages/query-core/src/queryClient.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L945) Returns the default options registered for mutations whose mutation key partially matches the given `mutationKey`, via [QueryClient#setMutationDefaults](#setmutationdefaults). If multiple registered @@ -461,12 +463,18 @@ const defaultOptions = queryClient.getMutationDefaults(['addPost']) getQueriesData(filters): [readonly unknown[], TQueryFnData | undefined][]; ``` -Defined in: [packages/query-core/src/queryClient.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L233) +Defined in: [packages/query-core/src/queryClient.ts:240](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L240) Imperative (non-reactive) way to retrieve the cached data of multiple queries at once. Only queries matching the given filters are returned; if none match, an empty array is returned. +Because the matched queries can hold data of different shapes (e.g. a broad filter can match +queries with unrelated data types), the `TQueryFnData` generic defaults to `unknown` rather +than being inferred. Passing a more specific type is a convenience for call sites that know +every matched query holds the same shape — it is not checked against the actual cache +contents. + #### Type Parameters ##### TQueryFnData @@ -505,7 +513,7 @@ const data = queryClient.getQueriesData({ queryKey: ['posts'] }) getQueryCache(): QueryCache; ``` -Defined in: [packages/query-core/src/queryClient.ts:776](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L776) +Defined in: [packages/query-core/src/queryClient.ts:786](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L786) Returns the query cache this client is connected to. @@ -531,7 +539,7 @@ const queries = queryCache.findAll({ queryKey: ['posts'] }) getQueryData(queryKey): TInferredQueryFnData | undefined; ``` -Defined in: [packages/query-core/src/queryClient.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L182) +Defined in: [packages/query-core/src/queryClient.ts:183](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L183) Imperative (non-reactive) way to retrieve data for a QueryKey. Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. @@ -575,7 +583,7 @@ Use `useQuery` to create a `QueryObserver` that subscribes to changes. getQueryDefaults(queryKey): OmitKeyof, "queryKey">; ``` -Defined in: [packages/query-core/src/queryClient.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L878) +Defined in: [packages/query-core/src/queryClient.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L888) Returns the default options registered for queries whose query key partially matches the given `queryKey`, via [QueryClient#setQueryDefaults](#setquerydefaults). If multiple registered defaults @@ -607,7 +615,7 @@ getQueryState(options): Promise[] ? InfiniteData : TData>; ``` -Defined in: [packages/query-core/src/queryClient.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L656) +Defined in: [packages/query-core/src/queryClient.ts:666](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L666) Asynchronous method to fetch and cache an infinite query, resolving with an [InfiniteData](../interfaces/InfiniteData.md) object or throwing with the error. @@ -723,7 +731,7 @@ try { invalidateQueries(filters?, options?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:453](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L453) +Defined in: [packages/query-core/src/queryClient.ts:460](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L460) Marks queries matching the given filters as invalidated. Unlike [QueryClient#removeQueries](#removequeries), invalidated queries stay in the cache. @@ -766,7 +774,7 @@ await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' isFetching(filters?): number; ``` -Defined in: [packages/query-core/src/queryClient.ts:149](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L149) +Defined in: [packages/query-core/src/queryClient.ts:150](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L150) Returns the number of queries in the cache that are currently fetching, optionally matching a set of filters. This includes background-fetching, loading new pages, and @@ -804,7 +812,7 @@ if (queryClient.isFetching()) { isMutating(filters?): number; ``` -Defined in: [packages/query-core/src/queryClient.ts:167](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L167) +Defined in: [packages/query-core/src/queryClient.ts:168](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L168) Returns the number of mutations in the cache that are currently pending, optionally matching a set of filters. @@ -841,7 +849,7 @@ if (queryClient.isMutating()) { mount(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L103) +Defined in: [packages/query-core/src/queryClient.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L104) Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start listening for focus/online events and resume paused mutations. Ref-counted via an internal @@ -860,7 +868,7 @@ the shared listeners until the last one unmounts. prefetchInfiniteQuery(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L704) +Defined in: [packages/query-core/src/queryClient.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L714) #### Type Parameters @@ -906,7 +914,7 @@ Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.ca prefetchQuery(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:624](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L624) +Defined in: [packages/query-core/src/queryClient.ts:634](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L634) #### Type Parameters @@ -948,7 +956,7 @@ Use queryClient.query(options) instead. You can swallow errors with `.catch(noop query(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:544](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L544) +Defined in: [packages/query-core/src/queryClient.ts:554](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L554) Asynchronous method to fetch and cache a query, resolving with the data or throwing with the error. @@ -958,12 +966,15 @@ If the query already exists in the cache and its data is not stale (per the give and the promise resolves once the fetch settles. If a `select` function is provided, it is applied to the data in both cases (cached or freshly fetched) before it is returned. -Unlike `useQuery`, retries are disabled by default here (`retry: false`) unless explicitly -configured, since there is no component to catch a thrown error and retry through re-render. +Unlike a reactive observer, retries are disabled by default here (`retry: false`) unless +explicitly configured, since there is no component to catch a thrown error and retry through +re-render. -The accepted options are a subset of `useQuery`'s options: fields that only make sense for a -reactive observer (e.g. `enabled`, `refetchInterval`, `refetchOnWindowFocus`, `notifyOnChangeProps`, -`throwOnError`, `suspense`, `placeholderData`) are not part of this method's options. +The accepted options are `QueryObserverOptions` minus the fields that only make sense for a +reactive observer — `enabled`, `refetchInterval`, `refetchIntervalInBackground`, +`refetchOnWindowFocus`, `refetchOnReconnect`, `refetchOnMount`, `retryOnMount`, +`notifyOnChangeProps`, `throwOnError`, `suspense`, and `placeholderData` are not part of this +method's options. This method replaces the deprecated `fetchQuery`, and — combined with `{ staleTime: 'static' }` — the deprecated `ensureQueryData`. @@ -1022,7 +1033,7 @@ try { refetchQueries(filters?, options?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:490](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L490) +Defined in: [packages/query-core/src/queryClient.ts:497](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L497) Refetches queries matching the given filters, regardless of whether they are stale. Without filters, every query in the cache is refetched. Queries that are disabled, or static (only @@ -1067,7 +1078,7 @@ await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' }) removeQueries(filters?): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:369](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L369) +Defined in: [packages/query-core/src/queryClient.ts:376](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L376) Removes queries from the cache that match the given filters. Unlike [QueryClient#invalidateQueries](#invalidatequeries) or [QueryClient#refetchQueries](#refetchqueries), this removes @@ -1104,7 +1115,7 @@ queryClient.removeQueries({ queryKey: ['posts'], exact: true }) resetQueries(filters?, options?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L390) +Defined in: [packages/query-core/src/queryClient.ts:397](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L397) Resets queries matching the given filters back to their initial state (e.g. any `initialData`), notifying subscribers rather than removing them. Active queries among the @@ -1144,7 +1155,7 @@ await queryClient.resetQueries({ queryKey: ['posts'], exact: true }) resumePausedMutations(): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:757](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L757) +Defined in: [packages/query-core/src/queryClient.ts:767](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L767) Resumes mutations that were paused because there was no network connection. Does nothing (resolving immediately) if the client is currently offline. @@ -1170,7 +1181,7 @@ await queryClient.resumePausedMutations() setDefaultOptions(options): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L829) +Defined in: [packages/query-core/src/queryClient.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L839) Dynamically sets the default options for this client, overwriting any previously defined default options. @@ -1210,7 +1221,7 @@ queryClient.setDefaultOptions({ setMutationDefaults(mutationKey, options): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L907) +Defined in: [packages/query-core/src/queryClient.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L917) Sets default options for mutations whose mutation key partially matches the given `mutationKey`. As with [QueryClient#setQueryDefaults](#setquerydefaults), the order of registration @@ -1269,7 +1280,7 @@ setQueriesData( options?): [readonly unknown[], TQueryFnData | undefined][]; ``` -Defined in: [packages/query-core/src/queryClient.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L312) +Defined in: [packages/query-core/src/queryClient.ts:319](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L319) Synchronous way to immediately update the cached data of multiple queries at once, using filters or partial query key matching. Only queries that already exist and match the given @@ -1323,7 +1334,7 @@ setQueryData( options?): NoInfer | undefined; ``` -Defined in: [packages/query-core/src/queryClient.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L264) +Defined in: [packages/query-core/src/queryClient.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L271) Synchronous way to immediately update a query's cached data. If the updater (or the value passed) resolves to `undefined`, the cache is left untouched and no query is created; @@ -1387,7 +1398,7 @@ queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost]) setQueryDefaults(queryKey, options): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L848) +Defined in: [packages/query-core/src/queryClient.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L858) Sets default options for queries whose query key partially matches the given `queryKey`. @@ -1444,7 +1455,7 @@ await queryClient.query({ queryKey: ['posts'] }) unmount(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L126) +Defined in: [packages/query-core/src/queryClient.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L127) The inverse of [QueryClient#mount](#mount) — called by a framework adapter's `QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online diff --git a/docs/framework/preact/reference/functions/experimental_streamedQuery.md b/docs/framework/preact/reference/functions/experimental_streamedQuery.md index afd44df7c5f..4c490322d60 100644 --- a/docs/framework/preact/reference/functions/experimental_streamedQuery.md +++ b/docs/framework/preact/reference/functions/experimental_streamedQuery.md @@ -4,10 +4,10 @@ title: experimental_streamedQuery --- ```ts -function experimental_streamedQuery(queryFn): QueryFunction; +function experimental_streamedQuery(streamFn): QueryFunction; ``` -Defined in: [packages/query-core/src/streamedQuery.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L60) +Defined in: [packages/query-core/src/streamedQuery.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L75) This is a helper function to create a query function that streams data from an AsyncIterable. Data will be an Array of all the chunks received. @@ -30,7 +30,7 @@ The query will stay in fetchStatus 'fetching' until the stream ends. ## Parameters -### queryFn +### streamFn `StreamedQueryParams`\<`TQueryFnData`, `TData`, `TQueryKey`\> diff --git a/docs/framework/preact/reference/interfaces/CancelOptions.md b/docs/framework/preact/reference/interfaces/CancelOptions.md index 2b9293712d2..14394c18533 100644 --- a/docs/framework/preact/reference/interfaces/CancelOptions.md +++ b/docs/framework/preact/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) +Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1466) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1444) +Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1467) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1445](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1445) +Defined in: [packages/query-core/src/types.ts:1468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1468) diff --git a/docs/framework/preact/reference/interfaces/DefaultOptions.md b/docs/framework/preact/reference/interfaces/DefaultOptions.md index 149ef5b3444..026116d11db 100644 --- a/docs/framework/preact/reference/interfaces/DefaultOptions.md +++ b/docs/framework/preact/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) +Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) ## Type Parameters @@ -19,7 +19,9 @@ Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/ optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) + +Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). *** @@ -29,7 +31,9 @@ Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/ optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) + +Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). #### deserializeData? @@ -63,7 +67,9 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) + +Default options applied to every mutation, unless overridden per-mutation. *** @@ -73,4 +79,6 @@ Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/ optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) + +Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/preact/reference/interfaces/FetchNextPageOptions.md b/docs/framework/preact/reference/interfaces/FetchNextPageOptions.md index fefe7f30c13..d12afe35fe1 100644 --- a/docs/framework/preact/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/preact/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L716) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) +Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/preact/reference/interfaces/FetchPreviousPageOptions.md index ad3c3c736c9..93ca92088f1 100644 --- a/docs/framework/preact/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/preact/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) +Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult.md index 94347ea2e40..f1443c39625 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) +Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) +Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) +Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) +Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) +Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 3e0d3a79fa1..7c55201c028 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) +Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult.md index f6400f44b52..f9541ebd73b 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) +Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult.md index 53d910f545d..1bab3233ec9 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1009) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1013](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1013) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1027](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1027) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1017](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1017) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1016](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1016) +Defined in: [packages/query-core/src/types.ts:1029](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1029) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1021](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1021) +Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1023](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1023) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index 5949179bc6f..58310e1af49 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) +Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) +Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) +Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index e299e60ddc3..22ed760c153 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) +Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) +Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) +Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 7b550e0a90b..732c882f86f 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) +Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) +Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InvalidateOptions.md b/docs/framework/preact/reference/interfaces/InvalidateOptions.md index 494afe1c465..1cd96c88165 100644 --- a/docs/framework/preact/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/preact/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L700) +Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L713) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/preact/reference/interfaces/InvalidateQueryFilters.md index 4824d80d910..35fd04b9378 100644 --- a/docs/framework/preact/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/preact/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:690](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L690) +Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -100,7 +100,14 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:693](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L693) +Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) + +Controls which of the matched (now-invalidated) queries are refetched in the background. +Defaults to `'active'`. +- `'active'`: only queries with at least one active observer are refetched. +- `'inactive'`: only queries with no active observer are refetched. +- `'all'`: every matched query is refetched, active or not. +- `'none'`: no query is refetched; matched queries are only marked as invalidated. *** diff --git a/docs/framework/preact/reference/interfaces/MutateOptions.md b/docs/framework/preact/reference/interfaces/MutateOptions.md index a0af091a997..6e27e4e6d29 100644 --- a/docs/framework/preact/reference/interfaces/MutateOptions.md +++ b/docs/framework/preact/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1228) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1234) +Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1247) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1222](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1222) +Defined in: [packages/query-core/src/types.ts:1235](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1235) #### Parameters diff --git a/docs/framework/preact/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/preact/reference/interfaces/MutationObserverBaseResult.md index 98810323966..190d4d4d3b6 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) +Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) +Defined in: [packages/query-core/src/types.ts:1289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1289) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1285) +Defined in: [packages/query-core/src/types.ts:1298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1298) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) +Defined in: [packages/query-core/src/types.ts:1303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1303) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1295) +Defined in: [packages/query-core/src/types.ts:1308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1308) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1300](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1300) +Defined in: [packages/query-core/src/types.ts:1313](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1313) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1305](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1305) +Defined in: [packages/query-core/src/types.ts:1318](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1318) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1314](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1314) +Defined in: [packages/query-core/src/types.ts:1327](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1327) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) +Defined in: [packages/query-core/src/types.ts:1293](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1293) The variables object passed to the `mutationFn`. diff --git a/docs/framework/preact/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/preact/reference/interfaces/MutationObserverErrorResult.md index d61f244ced4..03af3a33d12 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1374](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1374) +Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1385](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1385) +Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1386](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1386) +Defined in: [packages/query-core/src/types.ts:1399](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1399) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1388](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1388) +Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1389](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1389) +Defined in: [packages/query-core/src/types.ts:1402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1402) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1390) +Defined in: [packages/query-core/src/types.ts:1403](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1403) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) +Defined in: [packages/query-core/src/types.ts:1404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1404) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) +Defined in: [packages/query-core/src/types.ts:1405](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1405) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) +Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) The variables object passed to the `mutationFn`. diff --git a/docs/framework/preact/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/preact/reference/interfaces/MutationObserverIdleResult.md index 93655da0aa5..833db327a04 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1332](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1332) +Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) +Defined in: [packages/query-core/src/types.ts:1356](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1356) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) +Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1346](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1346) +Defined in: [packages/query-core/src/types.ts:1359](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1359) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1347) +Defined in: [packages/query-core/src/types.ts:1360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1360) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) +Defined in: [packages/query-core/src/types.ts:1361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1361) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1349) +Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1350](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1350) +Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) +Defined in: [packages/query-core/src/types.ts:1357](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1357) The variables object passed to the `mutationFn`. diff --git a/docs/framework/preact/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/preact/reference/interfaces/MutationObserverLoadingResult.md index de146c45f5c..6732628f444 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) +Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1364](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1364) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) +Defined in: [packages/query-core/src/types.ts:1379](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1379) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1367](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1367) +Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) +Defined in: [packages/query-core/src/types.ts:1381](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1381) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1369](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1369) +Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1370](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1370) +Defined in: [packages/query-core/src/types.ts:1383](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1383) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1371](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1371) +Defined in: [packages/query-core/src/types.ts:1384](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1384) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1365) +Defined in: [packages/query-core/src/types.ts:1378](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1378) The variables object passed to the `mutationFn`. diff --git a/docs/framework/preact/reference/interfaces/MutationObserverOptions.md b/docs/framework/preact/reference/interfaces/MutationObserverOptions.md index fe59cc7444d..be502d19332 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) +Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1220) ## Extends @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) #### Inherited from @@ -49,7 +49,7 @@ Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) #### Inherited from @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) #### Inherited from @@ -77,7 +77,7 @@ Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) +Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) #### Inherited from @@ -91,7 +91,7 @@ Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Inherited from @@ -105,7 +105,7 @@ Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Parameters @@ -141,7 +141,7 @@ Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) #### Parameters @@ -169,7 +169,7 @@ Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) #### Parameters @@ -209,7 +209,7 @@ Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) #### Parameters @@ -245,7 +245,7 @@ Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) #### Inherited from @@ -259,7 +259,7 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) #### Inherited from @@ -273,7 +273,7 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) +Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) #### Inherited from @@ -287,4 +287,4 @@ Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) diff --git a/docs/framework/preact/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/preact/reference/interfaces/MutationObserverSuccessResult.md index b50ec4ab6f1..89e8c2739cc 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) +Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1406](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1406) +Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1407) +Defined in: [packages/query-core/src/types.ts:1420](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1420) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1409) +Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1410](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1410) +Defined in: [packages/query-core/src/types.ts:1423](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1423) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) +Defined in: [packages/query-core/src/types.ts:1424](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1424) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) +Defined in: [packages/query-core/src/types.ts:1425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1425) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) +Defined in: [packages/query-core/src/types.ts:1426](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1426) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) +Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) The variables object passed to the `mutationFn`. diff --git a/docs/framework/preact/reference/interfaces/MutationOptions.md b/docs/framework/preact/reference/interfaces/MutationOptions.md index f641d241142..8721b62d099 100644 --- a/docs/framework/preact/reference/interfaces/MutationOptions.md +++ b/docs/framework/preact/reference/interfaces/MutationOptions.md @@ -3,7 +3,7 @@ id: MutationOptions title: MutationOptions --- -Defined in: [packages/query-core/src/types.ts:1166](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1166) +Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) ## Extended by @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1166](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) *** @@ -45,7 +45,7 @@ Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) *** @@ -55,7 +55,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) *** @@ -65,7 +65,7 @@ Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) +Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) *** @@ -75,7 +75,7 @@ Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) *** @@ -85,7 +85,7 @@ Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Parameters @@ -117,7 +117,7 @@ Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) #### Parameters @@ -141,7 +141,7 @@ Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) #### Parameters @@ -177,7 +177,7 @@ Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) #### Parameters @@ -209,7 +209,7 @@ Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) *** @@ -219,7 +219,7 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) *** @@ -229,4 +229,4 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) +Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) diff --git a/docs/framework/preact/reference/interfaces/NotifyEvent.md b/docs/framework/preact/reference/interfaces/NotifyEvent.md index 1dc93464df1..17b3241654f 100644 --- a/docs/framework/preact/reference/interfaces/NotifyEvent.md +++ b/docs/framework/preact/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1462) +Defined in: [packages/query-core/src/types.ts:1485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1485) diff --git a/docs/framework/preact/reference/interfaces/QueryCacheConfig.md b/docs/framework/preact/reference/interfaces/QueryCacheConfig.md index 69ea600366c..3c6aebe496f 100644 --- a/docs/framework/preact/reference/interfaces/QueryCacheConfig.md +++ b/docs/framework/preact/reference/interfaces/QueryCacheConfig.md @@ -3,11 +3,12 @@ id: QueryCacheConfig title: QueryCacheConfig --- -Defined in: [packages/query-core/src/queryCache.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L24) +Defined in: [packages/query-core/src/queryCache.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L25) Global callbacks that fire for every query handled by a `QueryCache`, regardless of which component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can -override, these callbacks are always called. +override, these callbacks are always called. Unlike `MutationCacheConfig`'s callbacks, these +are fire-and-forget: their return value is not awaited before the query settles. ## Properties @@ -17,7 +18,7 @@ override, these callbacks are always called. optional onError: (error, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L26) +Defined in: [packages/query-core/src/queryCache.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L27) Called when any query in the cache encounters an error. @@ -43,7 +44,7 @@ Called when any query in the cache encounters an error. optional onSettled: (data, error, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L33) +Defined in: [packages/query-core/src/queryCache.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L34) Called when any query in the cache is settled, either successfully or with an error. @@ -73,7 +74,7 @@ Called when any query in the cache is settled, either successfully or with an er optional onSuccess: (data, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L31) +Defined in: [packages/query-core/src/queryCache.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L32) Called when any query in the cache is successful. diff --git a/docs/framework/preact/reference/interfaces/QueryClientConfig.md b/docs/framework/preact/reference/interfaces/QueryClientConfig.md index 7c9bc255b35..b04dadba88c 100644 --- a/docs/framework/preact/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/preact/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [packages/query-core/src/types.ts:1427](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1427) +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) ## Properties @@ -13,7 +13,9 @@ Defined in: [packages/query-core/src/types.ts:1427](https://github.com/TanStack/ optional defaultOptions: DefaultOptions; ``` -Defined in: [packages/query-core/src/types.ts:1430](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1430) +Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) + +Default options for all queries and mutations created through this client. *** @@ -23,7 +25,10 @@ Defined in: [packages/query-core/src/types.ts:1430](https://github.com/TanStack/ optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) +Defined in: [packages/query-core/src/types.ts:1447](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1447) + +The mutation cache this client is connected to. A new `MutationCache` is created if not +provided. *** @@ -33,4 +38,6 @@ Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/ optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1428) +Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) + +The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/preact/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/preact/reference/interfaces/QueryObserverBaseResult.md index 2840be27e27..4689d9d661a 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) +Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L743) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) +Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) +Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) +Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) +Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/preact/reference/interfaces/QueryObserverLoadingErrorResult.md index 97d5d5125a7..86ae34b80ab 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) +Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/preact/reference/interfaces/QueryObserverLoadingResult.md index 1f442f18130..a0024077883 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L873) +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) +Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) +Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:885](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L885) +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:884](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L884) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/preact/reference/interfaces/QueryObserverPendingResult.md index ad040ff9cc5..21fab248a7c 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:862](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L862) +Defined in: [packages/query-core/src/types.ts:875](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L875) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) +Defined in: [packages/query-core/src/types.ts:876](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L876) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:864](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L864) +Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:866](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L866) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:865](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L865) +Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:869](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L869) +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) +Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:870](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L870) +Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/preact/reference/interfaces/QueryObserverPlaceholderResult.md index 8a1ae61dee9..89af2502c11 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) +Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) +Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) +Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) +Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/preact/reference/interfaces/QueryObserverRefetchErrorResult.md index c8d5274697a..dab5586fdc1 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) +Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/preact/reference/interfaces/QueryObserverSuccessResult.md index e3c834e6c3a..b180b89ca62 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) +Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/RefetchOptions.md b/docs/framework/preact/reference/interfaces/RefetchOptions.md index a3db94b1674..b502dcd3492 100644 --- a/docs/framework/preact/reference/interfaces/RefetchOptions.md +++ b/docs/framework/preact/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L679) +Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L684) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,7 +38,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/RefetchQueryFilters.md b/docs/framework/preact/reference/interfaces/RefetchQueryFilters.md index f2b6b287875..84f917c6201 100644 --- a/docs/framework/preact/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/preact/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:696](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L696) +Defined in: [packages/query-core/src/types.ts:709](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L709) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. diff --git a/docs/framework/preact/reference/interfaces/ResetOptions.md b/docs/framework/preact/reference/interfaces/ResetOptions.md index bfa931717f8..1855fef3064 100644 --- a/docs/framework/preact/reference/interfaces/ResetOptions.md +++ b/docs/framework/preact/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) +Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L714) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/ResultOptions.md b/docs/framework/preact/reference/interfaces/ResultOptions.md index dbf00d6c67e..9766c56d1a6 100644 --- a/docs/framework/preact/reference/interfaces/ResultOptions.md +++ b/docs/framework/preact/reference/interfaces/ResultOptions.md @@ -19,4 +19,8 @@ Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. diff --git a/docs/framework/preact/reference/interfaces/SetDataOptions.md b/docs/framework/preact/reference/interfaces/SetDataOptions.md index 5fcbcfdf7cd..4262e781b05 100644 --- a/docs/framework/preact/reference/interfaces/SetDataOptions.md +++ b/docs/framework/preact/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1448) +Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1471) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) +Defined in: [packages/query-core/src/types.ts:1472](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1472) diff --git a/docs/framework/preact/reference/interfaces/UseMutationOptions.md b/docs/framework/preact/reference/interfaces/UseMutationOptions.md index af61a2f0862..247d3411401 100644 --- a/docs/framework/preact/reference/interfaces/UseMutationOptions.md +++ b/docs/framework/preact/reference/interfaces/UseMutationOptions.md @@ -47,7 +47,7 @@ their `onMutateResult` parameter — useful for optimistic-update rollback data. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) #### Inherited from @@ -61,7 +61,7 @@ Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) #### Inherited from @@ -75,7 +75,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) #### Inherited from @@ -91,7 +91,7 @@ OmitKeyof.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) +Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) #### Inherited from @@ -105,7 +105,7 @@ Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Inherited from @@ -119,7 +119,7 @@ Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Parameters @@ -157,7 +157,7 @@ OmitKeyof.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) #### Parameters @@ -187,7 +187,7 @@ OmitKeyof.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) #### Parameters @@ -229,7 +229,7 @@ OmitKeyof.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) #### Parameters @@ -267,7 +267,7 @@ OmitKeyof.onSuccess optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) #### Inherited from @@ -283,7 +283,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) #### Inherited from @@ -299,7 +299,7 @@ OmitKeyof.retryDelay optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) +Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) #### Inherited from @@ -313,7 +313,7 @@ Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) #### Inherited from diff --git a/docs/framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index ced8e568299..d82cfa37d51 100644 --- a/docs/framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/preact/reference/type-aliases/DefinedQueryObserverResult.md index 7afdbfd38bc..97fcae175a9 100644 --- a/docs/framework/preact/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/preact/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/FetchStatus.md b/docs/framework/preact/reference/type-aliases/FetchStatus.md index 4dae9444af6..7b71e54eacd 100644 --- a/docs/framework/preact/reference/type-aliases/FetchStatus.md +++ b/docs/framework/preact/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) diff --git a/docs/framework/preact/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/preact/reference/type-aliases/InfiniteQueryObserverResult.md index 95fda780d1d..7a646bc1c38 100644 --- a/docs/framework/preact/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/preact/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/MutateFunction.md b/docs/framework/preact/reference/type-aliases/MutateFunction.md index f574ca7f8ca..284bd0fc270 100644 --- a/docs/framework/preact/reference/type-aliases/MutateFunction.md +++ b/docs/framework/preact/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1258) +Defined in: [packages/query-core/src/types.ts:1271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1271) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/MutateFunctionRest.md b/docs/framework/preact/reference/type-aliases/MutateFunctionRest.md index aef21572aeb..a2f16ea5302 100644 --- a/docs/framework/preact/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/preact/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1243](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1243) +Defined in: [packages/query-core/src/types.ts:1256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1256) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/MutationFunction.md b/docs/framework/preact/reference/type-aliases/MutationFunction.md index e306a5f1a48..4c8c7aed384 100644 --- a/docs/framework/preact/reference/type-aliases/MutationFunction.md +++ b/docs/framework/preact/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1161](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1161) +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/MutationFunctionContext.md b/docs/framework/preact/reference/type-aliases/MutationFunctionContext.md index b29a54df298..ef228cc53d3 100644 --- a/docs/framework/preact/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/preact/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) +Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) +Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1169) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) +Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1170) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1158](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1158) +Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) diff --git a/docs/framework/preact/reference/type-aliases/MutationKey.md b/docs/framework/preact/reference/type-aliases/MutationKey.md index f89c6959883..7157d6052fd 100644 --- a/docs/framework/preact/reference/type-aliases/MutationKey.md +++ b/docs/framework/preact/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) diff --git a/docs/framework/preact/reference/type-aliases/MutationMeta.md b/docs/framework/preact/reference/type-aliases/MutationMeta.md index e1d481cdcf1..f3bf9984fab 100644 --- a/docs/framework/preact/reference/type-aliases/MutationMeta.md +++ b/docs/framework/preact/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1147](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1147) +Defined in: [packages/query-core/src/types.ts:1160](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1160) diff --git a/docs/framework/preact/reference/type-aliases/MutationObserverResult.md b/docs/framework/preact/reference/type-aliases/MutationObserverResult.md index cbd07f40537..3390192e071 100644 --- a/docs/framework/preact/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/preact/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) +Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/MutationScope.md b/docs/framework/preact/reference/type-aliases/MutationScope.md index 6ec14643477..a2511c903d9 100644 --- a/docs/framework/preact/reference/type-aliases/MutationScope.md +++ b/docs/framework/preact/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) +Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) +Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) diff --git a/docs/framework/preact/reference/type-aliases/MutationStatus.md b/docs/framework/preact/reference/type-aliases/MutationStatus.md index eedf0fb979a..d9b58cdd26f 100644 --- a/docs/framework/preact/reference/type-aliases/MutationStatus.md +++ b/docs/framework/preact/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) +Defined in: [packages/query-core/src/types.ts:1154](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1154) diff --git a/docs/framework/preact/reference/type-aliases/NotifyEventType.md b/docs/framework/preact/reference/type-aliases/NotifyEventType.md index 7b788ced7af..94912df6c6b 100644 --- a/docs/framework/preact/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/preact/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) diff --git a/docs/framework/preact/reference/type-aliases/QueryCacheNotifyEvent.md b/docs/framework/preact/reference/type-aliases/QueryCacheNotifyEvent.md index 8e52da9e279..b92c76fb826 100644 --- a/docs/framework/preact/reference/type-aliases/QueryCacheNotifyEvent.md +++ b/docs/framework/preact/reference/type-aliases/QueryCacheNotifyEvent.md @@ -14,7 +14,7 @@ type QueryCacheNotifyEvent = | NotifyEventQueryObserverOptionsUpdated; ``` -Defined in: [packages/query-core/src/queryCache.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L84) +Defined in: [packages/query-core/src/queryCache.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L85) The event passed to a `QueryCache` subscriber. Fired whenever a query is added or removed from the cache, its state is updated (e.g. via `query.setState` or `queryClient.removeQueries`), or diff --git a/docs/framework/preact/reference/type-aliases/QueryObserverResult.md b/docs/framework/preact/reference/type-aliases/QueryObserverResult.md index f6c4118a978..f5c6c95d5f2 100644 --- a/docs/framework/preact/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/preact/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) +Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/QueryStatus.md b/docs/framework/preact/reference/type-aliases/QueryStatus.md index ed6059e03ec..3fc872e604b 100644 --- a/docs/framework/preact/reference/type-aliases/QueryStatus.md +++ b/docs/framework/preact/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) +Defined in: [packages/query-core/src/types.ts:740](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L740) diff --git a/docs/framework/preact/reference/type-aliases/TimeoutProvider.md b/docs/framework/preact/reference/type-aliases/TimeoutProvider.md index 6416fe4c557..3509105bcd1 100644 --- a/docs/framework/preact/reference/type-aliases/TimeoutProvider.md +++ b/docs/framework/preact/reference/type-aliases/TimeoutProvider.md @@ -7,10 +7,16 @@ title: TimeoutProvider type TimeoutProvider = object; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:22](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L22) +Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) Backend for timer functions. +Timers are performance-sensitive: short-lived timers (delays under a few seconds) tend to be +latency-sensitive, while long-lived ones may benefit more from coalescing — batching timers +with similar deadlines together — which the default provider (backed by the platform's global +`setTimeout`/`setInterval`) does not do. A custom provider can implement coalescing, and can +also support delays longer than the ~24-day maximum of the global `setTimeout`. + ## Type Parameters ### TTimerId @@ -25,7 +31,7 @@ Backend for timer functions. readonly clearInterval: (intervalId) => void; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) +Defined in: [packages/query-core/src/timeoutManager.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L34) #### Parameters @@ -45,7 +51,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/Ta readonly clearTimeout: (timeoutId) => void; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L25) +Defined in: [packages/query-core/src/timeoutManager.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L31) #### Parameters @@ -65,7 +71,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/Ta readonly setInterval: (callback, delay) => TTimerId; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L27) +Defined in: [packages/query-core/src/timeoutManager.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L33) #### Parameters @@ -89,7 +95,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/Ta readonly setTimeout: (callback, delay) => TTimerId; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L24) +Defined in: [packages/query-core/src/timeoutManager.ts:30](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L30) #### Parameters diff --git a/docs/framework/preact/reference/variables/environmentManager.md b/docs/framework/preact/reference/variables/environmentManager.md index caa1d70b2b6..e207cfd2484 100644 --- a/docs/framework/preact/reference/variables/environmentManager.md +++ b/docs/framework/preact/reference/variables/environmentManager.md @@ -7,9 +7,13 @@ title: environmentManager const environmentManager: object; ``` -Defined in: [packages/query-core/src/environmentManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L15) +Defined in: [packages/query-core/src/environmentManager.ts:29](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L29) -Manages environment detection used by TanStack Query internals. +Manages how TanStack Query detects whether the current runtime should be treated as +server-side. By default, this uses the same detection as the exported `isServer` utility. + +Override this for runtimes that are not traditional browser/server environments (e.g. +extension workers), where the default detection would give the wrong answer. ## Type Declaration @@ -42,3 +46,14 @@ Overrides the server check globally. #### Returns `void` + +## Example + +```ts +import { environmentManager, isServer } from '@tanstack/query-core' + +environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis)) + +// Restore the default behavior: +environmentManager.setIsServer(() => isServer) +``` diff --git a/docs/framework/preact/reference/variables/notifyManager.md b/docs/framework/preact/reference/variables/notifyManager.md index e5ecca8df60..4bdf3478be0 100644 --- a/docs/framework/preact/reference/variables/notifyManager.md +++ b/docs/framework/preact/reference/variables/notifyManager.md @@ -7,7 +7,7 @@ title: notifyManager const notifyManager: object; ``` -Defined in: [packages/query-core/src/notifyManager.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L135) +Defined in: [packages/query-core/src/notifyManager.ts:144](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L144) Handles scheduling and batching callbacks in TanStack Query. @@ -90,7 +90,8 @@ readonly setBatchNotifyFunction: (fn) => void; ``` Use this method to set a custom function to batch notifications together into a single tick. -By default React Query will use the batch function provided by ReactDOM or React Native. +Framework adapters use this to plug in their own batching primitive, so that a single query +update only triggers one re-render instead of one per subscriber. #### Parameters @@ -102,6 +103,15 @@ By default React Query will use the batch function provided by ReactDOM or React `void` +#### Example + +```ts +import { notifyManager } from '@tanstack/query-core' +import { batch } from 'solid-js' + +notifyManager.setBatchNotifyFunction(batch) +``` + ### setNotifyFunction() ```ts diff --git a/docs/framework/preact/reference/variables/timeoutManager.md b/docs/framework/preact/reference/variables/timeoutManager.md index 2dcfa29b55a..ef9cca969e9 100644 --- a/docs/framework/preact/reference/variables/timeoutManager.md +++ b/docs/framework/preact/reference/variables/timeoutManager.md @@ -7,6 +7,6 @@ title: timeoutManager const timeoutManager: TimeoutManager; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:226](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L226) +Defined in: [packages/query-core/src/timeoutManager.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L232) Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/react/reference/classes/Mutation.md b/docs/framework/react/reference/classes/Mutation.md index 4e85a5b2d4c..e038a9cd394 100644 --- a/docs/framework/react/reference/classes/Mutation.md +++ b/docs/framework/react/reference/classes/Mutation.md @@ -219,7 +219,7 @@ Removable.destroy execute(variables): Promise; ``` -Defined in: [packages/query-core/src/mutation.ts:283](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L283) +Defined in: [packages/query-core/src/mutation.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L284) Runs the mutation function for the given variables through a retryer, and drives the mutation's state and lifecycle callbacks through to settlement. @@ -254,7 +254,8 @@ the original error is re-thrown. #### Example ```ts -// typically invoked by MutationObserver.mutate, not called directly +// Called internally by `MutationObserver.mutate` and `Mutation.continue` — +// applications normally trigger mutations through those, not this method. const data = await mutation.execute(variables) ``` diff --git a/docs/framework/react/reference/classes/MutationCache.md b/docs/framework/react/reference/classes/MutationCache.md index f79919b1c4b..5a172b4cb9b 100644 --- a/docs/framework/react/reference/classes/MutationCache.md +++ b/docs/framework/react/reference/classes/MutationCache.md @@ -3,7 +3,7 @@ id: MutationCache title: MutationCache --- -Defined in: [packages/query-core/src/mutationCache.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L117) +Defined in: [packages/query-core/src/mutationCache.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L124) The `MutationCache` is the storage for mutations. @@ -11,6 +11,14 @@ Normally, you will not interact with the `MutationCache` directly and instead us `QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of safe/known updates to the cache, such as mutations being added, removed, or updated. +## Example + +```ts +const unsubscribe = mutationCache.subscribe((event) => { + console.log(event.type, event.mutation) +}) +``` + ## Extends - `Subscribable`\<`MutationCacheListener`\> @@ -23,7 +31,7 @@ safe/known updates to the cache, such as mutations being added, removed, or upda new MutationCache(config): MutationCache; ``` -Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) +Defined in: [packages/query-core/src/mutationCache.ts:129](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L129) #### Parameters @@ -49,7 +57,7 @@ Subscribable.constructor config: MutationCacheConfig = {}; ``` -Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) +Defined in: [packages/query-core/src/mutationCache.ts:129](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L129) *** @@ -75,7 +83,7 @@ Subscribable.listeners clear(): void; ``` -Defined in: [packages/query-core/src/mutationCache.ts:229](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L229) +Defined in: [packages/query-core/src/mutationCache.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L236) Removes all mutations from the cache. @@ -101,7 +109,7 @@ find(filters): | undefined; ``` -Defined in: [packages/query-core/src/mutationCache.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L271) +Defined in: [packages/query-core/src/mutationCache.ts:278](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L278) A slightly more advanced method that can be used to get an existing mutation instance from the cache. If the mutation does not exist, `undefined` is returned. @@ -158,7 +166,7 @@ const mutation = mutationCache.find({ mutationKey: ['addPost'] }) findAll(filters): Mutation[]; ``` -Defined in: [packages/query-core/src/mutationCache.ts:301](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L301) +Defined in: [packages/query-core/src/mutationCache.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L308) An even more advanced method that can be used to get existing mutation instances from the cache that match the given filters. If no mutations match, an empty array is returned. @@ -196,7 +204,7 @@ const mutations = mutationCache.findAll({ mutationKey: ['addPost'] }) getAll(): Mutation[]; ``` -Defined in: [packages/query-core/src/mutationCache.ts:252](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L252) +Defined in: [packages/query-core/src/mutationCache.ts:259](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L259) Returns all mutations within the cache. diff --git a/docs/framework/react/reference/classes/QueryCache.md b/docs/framework/react/reference/classes/QueryCache.md index 8e435445b2c..b7a577b5e54 100644 --- a/docs/framework/react/reference/classes/QueryCache.md +++ b/docs/framework/react/reference/classes/QueryCache.md @@ -3,14 +3,24 @@ id: QueryCache title: QueryCache --- -Defined in: [packages/query-core/src/queryCache.ts:113](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L113) +Defined in: [packages/query-core/src/queryCache.ts:123](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L123) The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta information, and state of the queries it contains. Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient` for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of -safe/known updates to the cache, such as queries being added, removed, or updated. +safe/known updates to the cache, such as queries being added, removed, or updated — updates made +outside of the cache's own tracked mechanisms (e.g. mutating a query's state object directly) do +not notify subscribers. + +## Example + +```ts +const unsubscribe = queryCache.subscribe((event) => { + console.log(event.type, event.query) +}) +``` ## Extends @@ -24,7 +34,7 @@ safe/known updates to the cache, such as queries being added, removed, or update new QueryCache(config): QueryCache; ``` -Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) +Defined in: [packages/query-core/src/queryCache.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L126) #### Parameters @@ -50,7 +60,7 @@ Subscribable.constructor config: QueryCacheConfig = {}; ``` -Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) +Defined in: [packages/query-core/src/queryCache.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L126) *** @@ -79,7 +89,7 @@ build( state?): Query; ``` -Defined in: [packages/query-core/src/queryCache.ts:137](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L137) +Defined in: [packages/query-core/src/queryCache.ts:147](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L147) Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or builds and adds a new one to the cache if none exists yet. Used by framework adapters and @@ -141,7 +151,7 @@ const query = queryCache.build(queryClient, { clear(): void; ``` -Defined in: [packages/query-core/src/queryCache.ts:222](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L222) +Defined in: [packages/query-core/src/queryCache.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L232) Removes all queries from the cache. @@ -167,7 +177,7 @@ find(filters): | undefined; ``` -Defined in: [packages/query-core/src/queryCache.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L289) +Defined in: [packages/query-core/src/queryCache.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L299) A slightly more advanced method that can be used to get an existing query instance from the cache. This instance not only contains all the state for the query, but all of the instances, @@ -223,7 +233,7 @@ const query = queryCache.find({ queryKey: ['posts'] }) findAll(filters): Query[]; ``` -Defined in: [packages/query-core/src/queryCache.ts:314](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L314) +Defined in: [packages/query-core/src/queryCache.ts:324](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L324) An even more advanced method that can be used to get existing query instances from the cache that partially match a query key. If no queries match, an empty array is returned. @@ -263,7 +273,7 @@ get(queryHash): | undefined; ``` -Defined in: [packages/query-core/src/queryCache.ts:244](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L244) +Defined in: [packages/query-core/src/queryCache.ts:254](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L254) Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none exists. Unlike [QueryCache#find](#find), this looks up by the already-computed hash rather @@ -316,7 +326,7 @@ const query = queryCache.get(queryHash) getAll(): Query[]; ``` -Defined in: [packages/query-core/src/queryCache.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L267) +Defined in: [packages/query-core/src/queryCache.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L277) Returns all queries within the cache. @@ -400,7 +410,7 @@ Subscribable.onUnsubscribe remove(query): void; ``` -Defined in: [packages/query-core/src/queryCache.ts:198](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L198) +Defined in: [packages/query-core/src/queryCache.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L208) Destroys the given `Query` and removes it from the cache, notifying subscribers with a `'removed'` event. A no-op if the query is no longer the one currently stored under its hash diff --git a/docs/framework/react/reference/classes/QueryClient.md b/docs/framework/react/reference/classes/QueryClient.md index 03250c00243..c7d1a034545 100644 --- a/docs/framework/react/reference/classes/QueryClient.md +++ b/docs/framework/react/reference/classes/QueryClient.md @@ -3,12 +3,14 @@ id: QueryClient title: QueryClient --- -Defined in: [packages/query-core/src/queryClient.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L78) +Defined in: [packages/query-core/src/queryClient.ts:79](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L79) `QueryClient` is used to interact with a cache of queries and mutations. It owns a `QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds the default options that are applied to queries and mutations created through it. +## Example + ```ts const queryClient = new QueryClient({ defaultOptions: { @@ -29,7 +31,7 @@ await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts }) new QueryClient(config): QueryClient; ``` -Defined in: [packages/query-core/src/queryClient.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L88) +Defined in: [packages/query-core/src/queryClient.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L89) #### Parameters @@ -49,7 +51,7 @@ Defined in: [packages/query-core/src/queryClient.ts:88](https://github.com/TanSt cancelQueries(filters?, cancelOptions?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L425) +Defined in: [packages/query-core/src/queryClient.ts:432](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L432) Cancels outgoing fetches for queries matching the given filters. Most useful when performing optimistic updates, since any outgoing refetch that resolves afterwards would otherwise @@ -92,7 +94,7 @@ await queryClient.cancelQueries({ queryKey: ['posts'], exact: true }) clear(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1073) +Defined in: [packages/query-core/src/queryClient.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1083) Clears both the query cache and the mutation cache this client is connected to. @@ -117,7 +119,7 @@ queryClient.clear() defaultMutationOptions(options?): T; ``` -Defined in: [packages/query-core/src/queryClient.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1047) +Defined in: [packages/query-core/src/queryClient.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1057) The mutation counterpart of [QueryClient#defaultQueryOptions](#defaultqueryoptions). Called by framework adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the @@ -148,7 +150,7 @@ on top. A no-op if the options are already defaulted (`_defaulted: true`). defaultQueryOptions(options): DefaultedQueryObserverOptions; ``` -Defined in: [packages/query-core/src/queryClient.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L960) +Defined in: [packages/query-core/src/queryClient.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L970) Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the @@ -199,7 +201,7 @@ on top. A no-op if the options are already defaulted (`_defaulted: true`). ensureInfiniteQueryData(options): Promise>; ``` -Defined in: [packages/query-core/src/queryClient.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L725) +Defined in: [packages/query-core/src/queryClient.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L735) #### Type Parameters @@ -245,7 +247,7 @@ Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This ensureQueryData(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L196) +Defined in: [packages/query-core/src/queryClient.ts:197](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L197) #### Type Parameters @@ -287,7 +289,7 @@ Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method fetchInfiniteQuery(options): Promise>; ``` -Defined in: [packages/query-core/src/queryClient.ts:682](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L682) +Defined in: [packages/query-core/src/queryClient.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L692) #### Type Parameters @@ -333,7 +335,7 @@ Use queryClient.infiniteQuery(options) instead. This method will be removed in t fetchQuery(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L590) +Defined in: [packages/query-core/src/queryClient.ts:600](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L600) #### Type Parameters @@ -379,7 +381,7 @@ Use queryClient.query(options) instead. This method will be removed in the next getDefaultOptions(): DefaultOptions; ``` -Defined in: [packages/query-core/src/queryClient.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L808) +Defined in: [packages/query-core/src/queryClient.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L818) Returns the default options that were set when creating the client, or via [QueryClient#setDefaultOptions](#setdefaultoptions). @@ -405,7 +407,7 @@ const defaultOptions = queryClient.getDefaultOptions() getMutationCache(): MutationCache; ``` -Defined in: [packages/query-core/src/queryClient.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L792) +Defined in: [packages/query-core/src/queryClient.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L802) Returns the mutation cache this client is connected to. @@ -431,7 +433,7 @@ const mutations = mutationCache.findAll({ status: 'pending' }) getMutationDefaults(mutationKey): OmitKeyof, "mutationKey">; ``` -Defined in: [packages/query-core/src/queryClient.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L935) +Defined in: [packages/query-core/src/queryClient.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L945) Returns the default options registered for mutations whose mutation key partially matches the given `mutationKey`, via [QueryClient#setMutationDefaults](#setmutationdefaults). If multiple registered @@ -461,12 +463,18 @@ const defaultOptions = queryClient.getMutationDefaults(['addPost']) getQueriesData(filters): [readonly unknown[], TQueryFnData | undefined][]; ``` -Defined in: [packages/query-core/src/queryClient.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L233) +Defined in: [packages/query-core/src/queryClient.ts:240](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L240) Imperative (non-reactive) way to retrieve the cached data of multiple queries at once. Only queries matching the given filters are returned; if none match, an empty array is returned. +Because the matched queries can hold data of different shapes (e.g. a broad filter can match +queries with unrelated data types), the `TQueryFnData` generic defaults to `unknown` rather +than being inferred. Passing a more specific type is a convenience for call sites that know +every matched query holds the same shape — it is not checked against the actual cache +contents. + #### Type Parameters ##### TQueryFnData @@ -505,7 +513,7 @@ const data = queryClient.getQueriesData({ queryKey: ['posts'] }) getQueryCache(): QueryCache; ``` -Defined in: [packages/query-core/src/queryClient.ts:776](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L776) +Defined in: [packages/query-core/src/queryClient.ts:786](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L786) Returns the query cache this client is connected to. @@ -531,7 +539,7 @@ const queries = queryCache.findAll({ queryKey: ['posts'] }) getQueryData(queryKey): TInferredQueryFnData | undefined; ``` -Defined in: [packages/query-core/src/queryClient.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L182) +Defined in: [packages/query-core/src/queryClient.ts:183](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L183) Imperative (non-reactive) way to retrieve data for a QueryKey. Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. @@ -575,7 +583,7 @@ Use `useQuery` to create a `QueryObserver` that subscribes to changes. getQueryDefaults(queryKey): OmitKeyof, "queryKey">; ``` -Defined in: [packages/query-core/src/queryClient.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L878) +Defined in: [packages/query-core/src/queryClient.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L888) Returns the default options registered for queries whose query key partially matches the given `queryKey`, via [QueryClient#setQueryDefaults](#setquerydefaults). If multiple registered defaults @@ -607,7 +615,7 @@ getQueryState(options): Promise[] ? InfiniteData : TData>; ``` -Defined in: [packages/query-core/src/queryClient.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L656) +Defined in: [packages/query-core/src/queryClient.ts:666](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L666) Asynchronous method to fetch and cache an infinite query, resolving with an [InfiniteData](../interfaces/InfiniteData.md) object or throwing with the error. @@ -723,7 +731,7 @@ try { invalidateQueries(filters?, options?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:453](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L453) +Defined in: [packages/query-core/src/queryClient.ts:460](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L460) Marks queries matching the given filters as invalidated. Unlike [QueryClient#removeQueries](#removequeries), invalidated queries stay in the cache. @@ -766,7 +774,7 @@ await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' isFetching(filters?): number; ``` -Defined in: [packages/query-core/src/queryClient.ts:149](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L149) +Defined in: [packages/query-core/src/queryClient.ts:150](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L150) Returns the number of queries in the cache that are currently fetching, optionally matching a set of filters. This includes background-fetching, loading new pages, and @@ -804,7 +812,7 @@ if (queryClient.isFetching()) { isMutating(filters?): number; ``` -Defined in: [packages/query-core/src/queryClient.ts:167](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L167) +Defined in: [packages/query-core/src/queryClient.ts:168](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L168) Returns the number of mutations in the cache that are currently pending, optionally matching a set of filters. @@ -841,7 +849,7 @@ if (queryClient.isMutating()) { mount(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L103) +Defined in: [packages/query-core/src/queryClient.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L104) Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start listening for focus/online events and resume paused mutations. Ref-counted via an internal @@ -860,7 +868,7 @@ the shared listeners until the last one unmounts. prefetchInfiniteQuery(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L704) +Defined in: [packages/query-core/src/queryClient.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L714) #### Type Parameters @@ -906,7 +914,7 @@ Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.ca prefetchQuery(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:624](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L624) +Defined in: [packages/query-core/src/queryClient.ts:634](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L634) #### Type Parameters @@ -948,7 +956,7 @@ Use queryClient.query(options) instead. You can swallow errors with `.catch(noop query(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:544](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L544) +Defined in: [packages/query-core/src/queryClient.ts:554](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L554) Asynchronous method to fetch and cache a query, resolving with the data or throwing with the error. @@ -958,12 +966,15 @@ If the query already exists in the cache and its data is not stale (per the give and the promise resolves once the fetch settles. If a `select` function is provided, it is applied to the data in both cases (cached or freshly fetched) before it is returned. -Unlike `useQuery`, retries are disabled by default here (`retry: false`) unless explicitly -configured, since there is no component to catch a thrown error and retry through re-render. +Unlike a reactive observer, retries are disabled by default here (`retry: false`) unless +explicitly configured, since there is no component to catch a thrown error and retry through +re-render. -The accepted options are a subset of `useQuery`'s options: fields that only make sense for a -reactive observer (e.g. `enabled`, `refetchInterval`, `refetchOnWindowFocus`, `notifyOnChangeProps`, -`throwOnError`, `suspense`, `placeholderData`) are not part of this method's options. +The accepted options are `QueryObserverOptions` minus the fields that only make sense for a +reactive observer — `enabled`, `refetchInterval`, `refetchIntervalInBackground`, +`refetchOnWindowFocus`, `refetchOnReconnect`, `refetchOnMount`, `retryOnMount`, +`notifyOnChangeProps`, `throwOnError`, `suspense`, and `placeholderData` are not part of this +method's options. This method replaces the deprecated `fetchQuery`, and — combined with `{ staleTime: 'static' }` — the deprecated `ensureQueryData`. @@ -1022,7 +1033,7 @@ try { refetchQueries(filters?, options?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:490](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L490) +Defined in: [packages/query-core/src/queryClient.ts:497](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L497) Refetches queries matching the given filters, regardless of whether they are stale. Without filters, every query in the cache is refetched. Queries that are disabled, or static (only @@ -1067,7 +1078,7 @@ await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' }) removeQueries(filters?): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:369](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L369) +Defined in: [packages/query-core/src/queryClient.ts:376](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L376) Removes queries from the cache that match the given filters. Unlike [QueryClient#invalidateQueries](#invalidatequeries) or [QueryClient#refetchQueries](#refetchqueries), this removes @@ -1104,7 +1115,7 @@ queryClient.removeQueries({ queryKey: ['posts'], exact: true }) resetQueries(filters?, options?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L390) +Defined in: [packages/query-core/src/queryClient.ts:397](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L397) Resets queries matching the given filters back to their initial state (e.g. any `initialData`), notifying subscribers rather than removing them. Active queries among the @@ -1144,7 +1155,7 @@ await queryClient.resetQueries({ queryKey: ['posts'], exact: true }) resumePausedMutations(): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:757](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L757) +Defined in: [packages/query-core/src/queryClient.ts:767](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L767) Resumes mutations that were paused because there was no network connection. Does nothing (resolving immediately) if the client is currently offline. @@ -1170,7 +1181,7 @@ await queryClient.resumePausedMutations() setDefaultOptions(options): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L829) +Defined in: [packages/query-core/src/queryClient.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L839) Dynamically sets the default options for this client, overwriting any previously defined default options. @@ -1210,7 +1221,7 @@ queryClient.setDefaultOptions({ setMutationDefaults(mutationKey, options): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L907) +Defined in: [packages/query-core/src/queryClient.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L917) Sets default options for mutations whose mutation key partially matches the given `mutationKey`. As with [QueryClient#setQueryDefaults](#setquerydefaults), the order of registration @@ -1269,7 +1280,7 @@ setQueriesData( options?): [readonly unknown[], TQueryFnData | undefined][]; ``` -Defined in: [packages/query-core/src/queryClient.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L312) +Defined in: [packages/query-core/src/queryClient.ts:319](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L319) Synchronous way to immediately update the cached data of multiple queries at once, using filters or partial query key matching. Only queries that already exist and match the given @@ -1323,7 +1334,7 @@ setQueryData( options?): NoInfer | undefined; ``` -Defined in: [packages/query-core/src/queryClient.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L264) +Defined in: [packages/query-core/src/queryClient.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L271) Synchronous way to immediately update a query's cached data. If the updater (or the value passed) resolves to `undefined`, the cache is left untouched and no query is created; @@ -1387,7 +1398,7 @@ queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost]) setQueryDefaults(queryKey, options): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L848) +Defined in: [packages/query-core/src/queryClient.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L858) Sets default options for queries whose query key partially matches the given `queryKey`. @@ -1444,7 +1455,7 @@ await queryClient.query({ queryKey: ['posts'] }) unmount(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L126) +Defined in: [packages/query-core/src/queryClient.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L127) The inverse of [QueryClient#mount](#mount) — called by a framework adapter's `QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online diff --git a/docs/framework/react/reference/functions/experimental_streamedQuery.md b/docs/framework/react/reference/functions/experimental_streamedQuery.md index afd44df7c5f..4c490322d60 100644 --- a/docs/framework/react/reference/functions/experimental_streamedQuery.md +++ b/docs/framework/react/reference/functions/experimental_streamedQuery.md @@ -4,10 +4,10 @@ title: experimental_streamedQuery --- ```ts -function experimental_streamedQuery(queryFn): QueryFunction; +function experimental_streamedQuery(streamFn): QueryFunction; ``` -Defined in: [packages/query-core/src/streamedQuery.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L60) +Defined in: [packages/query-core/src/streamedQuery.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L75) This is a helper function to create a query function that streams data from an AsyncIterable. Data will be an Array of all the chunks received. @@ -30,7 +30,7 @@ The query will stay in fetchStatus 'fetching' until the stream ends. ## Parameters -### queryFn +### streamFn `StreamedQueryParams`\<`TQueryFnData`, `TData`, `TQueryKey`\> diff --git a/docs/framework/react/reference/interfaces/CancelOptions.md b/docs/framework/react/reference/interfaces/CancelOptions.md index 2b9293712d2..14394c18533 100644 --- a/docs/framework/react/reference/interfaces/CancelOptions.md +++ b/docs/framework/react/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) +Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1466) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1444) +Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1467) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1445](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1445) +Defined in: [packages/query-core/src/types.ts:1468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1468) diff --git a/docs/framework/react/reference/interfaces/DefaultOptions.md b/docs/framework/react/reference/interfaces/DefaultOptions.md index 149ef5b3444..026116d11db 100644 --- a/docs/framework/react/reference/interfaces/DefaultOptions.md +++ b/docs/framework/react/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) +Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) ## Type Parameters @@ -19,7 +19,9 @@ Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/ optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) + +Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). *** @@ -29,7 +31,9 @@ Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/ optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) + +Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). #### deserializeData? @@ -63,7 +67,9 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) + +Default options applied to every mutation, unless overridden per-mutation. *** @@ -73,4 +79,6 @@ Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/ optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) + +Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/react/reference/interfaces/FetchNextPageOptions.md b/docs/framework/react/reference/interfaces/FetchNextPageOptions.md index fefe7f30c13..d12afe35fe1 100644 --- a/docs/framework/react/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/react/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L716) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) +Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/react/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/react/reference/interfaces/FetchPreviousPageOptions.md index ad3c3c736c9..93ca92088f1 100644 --- a/docs/framework/react/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/react/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) +Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverBaseResult.md index 94347ea2e40..f1443c39625 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) +Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) +Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) +Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) +Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) +Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 3e0d3a79fa1..7c55201c028 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) +Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult.md index f6400f44b52..f9541ebd73b 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) +Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverPendingResult.md index 53d910f545d..1bab3233ec9 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1009) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1013](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1013) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1027](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1027) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1017](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1017) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1016](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1016) +Defined in: [packages/query-core/src/types.ts:1029](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1029) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1021](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1021) +Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1023](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1023) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index 5949179bc6f..58310e1af49 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) +Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) +Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) +Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index e299e60ddc3..22ed760c153 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) +Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) +Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) +Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 7b550e0a90b..732c882f86f 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) +Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) +Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InvalidateOptions.md b/docs/framework/react/reference/interfaces/InvalidateOptions.md index 494afe1c465..1cd96c88165 100644 --- a/docs/framework/react/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/react/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L700) +Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L713) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/react/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/react/reference/interfaces/InvalidateQueryFilters.md index 4824d80d910..35fd04b9378 100644 --- a/docs/framework/react/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/react/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:690](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L690) +Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -100,7 +100,14 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:693](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L693) +Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) + +Controls which of the matched (now-invalidated) queries are refetched in the background. +Defaults to `'active'`. +- `'active'`: only queries with at least one active observer are refetched. +- `'inactive'`: only queries with no active observer are refetched. +- `'all'`: every matched query is refetched, active or not. +- `'none'`: no query is refetched; matched queries are only marked as invalidated. *** diff --git a/docs/framework/react/reference/interfaces/MutateOptions.md b/docs/framework/react/reference/interfaces/MutateOptions.md index a0af091a997..6e27e4e6d29 100644 --- a/docs/framework/react/reference/interfaces/MutateOptions.md +++ b/docs/framework/react/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1228) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1234) +Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1247) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1222](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1222) +Defined in: [packages/query-core/src/types.ts:1235](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1235) #### Parameters diff --git a/docs/framework/react/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/react/reference/interfaces/MutationObserverBaseResult.md index 98810323966..190d4d4d3b6 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/react/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) +Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) +Defined in: [packages/query-core/src/types.ts:1289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1289) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1285) +Defined in: [packages/query-core/src/types.ts:1298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1298) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) +Defined in: [packages/query-core/src/types.ts:1303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1303) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1295) +Defined in: [packages/query-core/src/types.ts:1308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1308) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1300](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1300) +Defined in: [packages/query-core/src/types.ts:1313](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1313) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1305](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1305) +Defined in: [packages/query-core/src/types.ts:1318](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1318) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1314](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1314) +Defined in: [packages/query-core/src/types.ts:1327](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1327) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) +Defined in: [packages/query-core/src/types.ts:1293](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1293) The variables object passed to the `mutationFn`. diff --git a/docs/framework/react/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/react/reference/interfaces/MutationObserverErrorResult.md index d61f244ced4..03af3a33d12 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/react/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1374](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1374) +Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1385](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1385) +Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1386](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1386) +Defined in: [packages/query-core/src/types.ts:1399](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1399) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1388](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1388) +Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1389](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1389) +Defined in: [packages/query-core/src/types.ts:1402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1402) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1390) +Defined in: [packages/query-core/src/types.ts:1403](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1403) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) +Defined in: [packages/query-core/src/types.ts:1404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1404) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) +Defined in: [packages/query-core/src/types.ts:1405](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1405) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) +Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) The variables object passed to the `mutationFn`. diff --git a/docs/framework/react/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/react/reference/interfaces/MutationObserverIdleResult.md index 93655da0aa5..833db327a04 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/react/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1332](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1332) +Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) +Defined in: [packages/query-core/src/types.ts:1356](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1356) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) +Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1346](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1346) +Defined in: [packages/query-core/src/types.ts:1359](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1359) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1347) +Defined in: [packages/query-core/src/types.ts:1360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1360) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) +Defined in: [packages/query-core/src/types.ts:1361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1361) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1349) +Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1350](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1350) +Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) +Defined in: [packages/query-core/src/types.ts:1357](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1357) The variables object passed to the `mutationFn`. diff --git a/docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md index de146c45f5c..6732628f444 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) +Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1364](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1364) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) +Defined in: [packages/query-core/src/types.ts:1379](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1379) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1367](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1367) +Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) +Defined in: [packages/query-core/src/types.ts:1381](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1381) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1369](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1369) +Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1370](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1370) +Defined in: [packages/query-core/src/types.ts:1383](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1383) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1371](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1371) +Defined in: [packages/query-core/src/types.ts:1384](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1384) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1365) +Defined in: [packages/query-core/src/types.ts:1378](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1378) The variables object passed to the `mutationFn`. diff --git a/docs/framework/react/reference/interfaces/MutationObserverOptions.md b/docs/framework/react/reference/interfaces/MutationObserverOptions.md index fe59cc7444d..be502d19332 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/react/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) +Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1220) ## Extends @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) #### Inherited from @@ -49,7 +49,7 @@ Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) #### Inherited from @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) #### Inherited from @@ -77,7 +77,7 @@ Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) +Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) #### Inherited from @@ -91,7 +91,7 @@ Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Inherited from @@ -105,7 +105,7 @@ Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Parameters @@ -141,7 +141,7 @@ Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) #### Parameters @@ -169,7 +169,7 @@ Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) #### Parameters @@ -209,7 +209,7 @@ Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) #### Parameters @@ -245,7 +245,7 @@ Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) #### Inherited from @@ -259,7 +259,7 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) #### Inherited from @@ -273,7 +273,7 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) +Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) #### Inherited from @@ -287,4 +287,4 @@ Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) diff --git a/docs/framework/react/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/react/reference/interfaces/MutationObserverSuccessResult.md index b50ec4ab6f1..89e8c2739cc 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/react/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) +Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1406](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1406) +Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1407) +Defined in: [packages/query-core/src/types.ts:1420](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1420) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1409) +Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1410](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1410) +Defined in: [packages/query-core/src/types.ts:1423](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1423) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) +Defined in: [packages/query-core/src/types.ts:1424](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1424) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) +Defined in: [packages/query-core/src/types.ts:1425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1425) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) +Defined in: [packages/query-core/src/types.ts:1426](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1426) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) +Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) The variables object passed to the `mutationFn`. diff --git a/docs/framework/react/reference/interfaces/MutationOptions.md b/docs/framework/react/reference/interfaces/MutationOptions.md index f641d241142..8721b62d099 100644 --- a/docs/framework/react/reference/interfaces/MutationOptions.md +++ b/docs/framework/react/reference/interfaces/MutationOptions.md @@ -3,7 +3,7 @@ id: MutationOptions title: MutationOptions --- -Defined in: [packages/query-core/src/types.ts:1166](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1166) +Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) ## Extended by @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1166](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) *** @@ -45,7 +45,7 @@ Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) *** @@ -55,7 +55,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) *** @@ -65,7 +65,7 @@ Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) +Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) *** @@ -75,7 +75,7 @@ Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) *** @@ -85,7 +85,7 @@ Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Parameters @@ -117,7 +117,7 @@ Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) #### Parameters @@ -141,7 +141,7 @@ Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) #### Parameters @@ -177,7 +177,7 @@ Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) #### Parameters @@ -209,7 +209,7 @@ Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) *** @@ -219,7 +219,7 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) *** @@ -229,4 +229,4 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) +Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) diff --git a/docs/framework/react/reference/interfaces/NotifyEvent.md b/docs/framework/react/reference/interfaces/NotifyEvent.md index 1dc93464df1..17b3241654f 100644 --- a/docs/framework/react/reference/interfaces/NotifyEvent.md +++ b/docs/framework/react/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1462) +Defined in: [packages/query-core/src/types.ts:1485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1485) diff --git a/docs/framework/react/reference/interfaces/QueryCacheConfig.md b/docs/framework/react/reference/interfaces/QueryCacheConfig.md index 69ea600366c..3c6aebe496f 100644 --- a/docs/framework/react/reference/interfaces/QueryCacheConfig.md +++ b/docs/framework/react/reference/interfaces/QueryCacheConfig.md @@ -3,11 +3,12 @@ id: QueryCacheConfig title: QueryCacheConfig --- -Defined in: [packages/query-core/src/queryCache.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L24) +Defined in: [packages/query-core/src/queryCache.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L25) Global callbacks that fire for every query handled by a `QueryCache`, regardless of which component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can -override, these callbacks are always called. +override, these callbacks are always called. Unlike `MutationCacheConfig`'s callbacks, these +are fire-and-forget: their return value is not awaited before the query settles. ## Properties @@ -17,7 +18,7 @@ override, these callbacks are always called. optional onError: (error, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L26) +Defined in: [packages/query-core/src/queryCache.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L27) Called when any query in the cache encounters an error. @@ -43,7 +44,7 @@ Called when any query in the cache encounters an error. optional onSettled: (data, error, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L33) +Defined in: [packages/query-core/src/queryCache.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L34) Called when any query in the cache is settled, either successfully or with an error. @@ -73,7 +74,7 @@ Called when any query in the cache is settled, either successfully or with an er optional onSuccess: (data, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L31) +Defined in: [packages/query-core/src/queryCache.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L32) Called when any query in the cache is successful. diff --git a/docs/framework/react/reference/interfaces/QueryClientConfig.md b/docs/framework/react/reference/interfaces/QueryClientConfig.md index 7c9bc255b35..b04dadba88c 100644 --- a/docs/framework/react/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/react/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [packages/query-core/src/types.ts:1427](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1427) +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) ## Properties @@ -13,7 +13,9 @@ Defined in: [packages/query-core/src/types.ts:1427](https://github.com/TanStack/ optional defaultOptions: DefaultOptions; ``` -Defined in: [packages/query-core/src/types.ts:1430](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1430) +Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) + +Default options for all queries and mutations created through this client. *** @@ -23,7 +25,10 @@ Defined in: [packages/query-core/src/types.ts:1430](https://github.com/TanStack/ optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) +Defined in: [packages/query-core/src/types.ts:1447](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1447) + +The mutation cache this client is connected to. A new `MutationCache` is created if not +provided. *** @@ -33,4 +38,6 @@ Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/ optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1428) +Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) + +The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/react/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/react/reference/interfaces/QueryObserverBaseResult.md index 2840be27e27..4689d9d661a 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) +Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L743) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) +Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) +Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) +Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) +Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/react/reference/interfaces/QueryObserverLoadingErrorResult.md index 97d5d5125a7..86ae34b80ab 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) +Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/react/reference/interfaces/QueryObserverLoadingResult.md index 1f442f18130..a0024077883 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L873) +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) +Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) +Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:885](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L885) +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:884](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L884) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/react/reference/interfaces/QueryObserverPendingResult.md index ad040ff9cc5..21fab248a7c 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:862](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L862) +Defined in: [packages/query-core/src/types.ts:875](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L875) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) +Defined in: [packages/query-core/src/types.ts:876](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L876) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:864](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L864) +Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:866](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L866) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:865](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L865) +Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:869](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L869) +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) +Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:870](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L870) +Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/react/reference/interfaces/QueryObserverPlaceholderResult.md index 8a1ae61dee9..89af2502c11 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) +Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) +Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) +Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) +Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/react/reference/interfaces/QueryObserverRefetchErrorResult.md index c8d5274697a..dab5586fdc1 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) +Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/react/reference/interfaces/QueryObserverSuccessResult.md index e3c834e6c3a..b180b89ca62 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) +Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/RefetchOptions.md b/docs/framework/react/reference/interfaces/RefetchOptions.md index a3db94b1674..b502dcd3492 100644 --- a/docs/framework/react/reference/interfaces/RefetchOptions.md +++ b/docs/framework/react/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L679) +Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L684) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,7 +38,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/react/reference/interfaces/RefetchQueryFilters.md b/docs/framework/react/reference/interfaces/RefetchQueryFilters.md index f2b6b287875..84f917c6201 100644 --- a/docs/framework/react/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/react/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:696](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L696) +Defined in: [packages/query-core/src/types.ts:709](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L709) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. diff --git a/docs/framework/react/reference/interfaces/ResetOptions.md b/docs/framework/react/reference/interfaces/ResetOptions.md index bfa931717f8..1855fef3064 100644 --- a/docs/framework/react/reference/interfaces/ResetOptions.md +++ b/docs/framework/react/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) +Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L714) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/react/reference/interfaces/ResultOptions.md b/docs/framework/react/reference/interfaces/ResultOptions.md index dbf00d6c67e..9766c56d1a6 100644 --- a/docs/framework/react/reference/interfaces/ResultOptions.md +++ b/docs/framework/react/reference/interfaces/ResultOptions.md @@ -19,4 +19,8 @@ Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. diff --git a/docs/framework/react/reference/interfaces/SetDataOptions.md b/docs/framework/react/reference/interfaces/SetDataOptions.md index 5fcbcfdf7cd..4262e781b05 100644 --- a/docs/framework/react/reference/interfaces/SetDataOptions.md +++ b/docs/framework/react/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1448) +Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1471) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) +Defined in: [packages/query-core/src/types.ts:1472](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1472) diff --git a/docs/framework/react/reference/interfaces/UseMutationOptions.md b/docs/framework/react/reference/interfaces/UseMutationOptions.md index e0e69f5bf86..78d7b495793 100644 --- a/docs/framework/react/reference/interfaces/UseMutationOptions.md +++ b/docs/framework/react/reference/interfaces/UseMutationOptions.md @@ -47,7 +47,7 @@ their `onMutateResult` parameter — useful for optimistic-update rollback data. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) #### Inherited from @@ -61,7 +61,7 @@ Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) #### Inherited from @@ -75,7 +75,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) #### Inherited from @@ -91,7 +91,7 @@ OmitKeyof.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) +Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) #### Inherited from @@ -105,7 +105,7 @@ Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Inherited from @@ -119,7 +119,7 @@ Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Parameters @@ -157,7 +157,7 @@ OmitKeyof.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) #### Parameters @@ -187,7 +187,7 @@ OmitKeyof.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) #### Parameters @@ -229,7 +229,7 @@ OmitKeyof.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) #### Parameters @@ -267,7 +267,7 @@ OmitKeyof.onSuccess optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) #### Inherited from @@ -283,7 +283,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) #### Inherited from @@ -299,7 +299,7 @@ OmitKeyof.retryDelay optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) +Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) #### Inherited from @@ -313,7 +313,7 @@ Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) #### Inherited from diff --git a/docs/framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index ced8e568299..d82cfa37d51 100644 --- a/docs/framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/react/reference/type-aliases/DefinedQueryObserverResult.md index 7afdbfd38bc..97fcae175a9 100644 --- a/docs/framework/react/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/react/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/FetchStatus.md b/docs/framework/react/reference/type-aliases/FetchStatus.md index 4dae9444af6..7b71e54eacd 100644 --- a/docs/framework/react/reference/type-aliases/FetchStatus.md +++ b/docs/framework/react/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) diff --git a/docs/framework/react/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/react/reference/type-aliases/InfiniteQueryObserverResult.md index 95fda780d1d..7a646bc1c38 100644 --- a/docs/framework/react/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/react/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/MutateFunction.md b/docs/framework/react/reference/type-aliases/MutateFunction.md index f574ca7f8ca..284bd0fc270 100644 --- a/docs/framework/react/reference/type-aliases/MutateFunction.md +++ b/docs/framework/react/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1258) +Defined in: [packages/query-core/src/types.ts:1271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1271) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/MutateFunctionRest.md b/docs/framework/react/reference/type-aliases/MutateFunctionRest.md index aef21572aeb..a2f16ea5302 100644 --- a/docs/framework/react/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/react/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1243](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1243) +Defined in: [packages/query-core/src/types.ts:1256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1256) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/MutationFunction.md b/docs/framework/react/reference/type-aliases/MutationFunction.md index e306a5f1a48..4c8c7aed384 100644 --- a/docs/framework/react/reference/type-aliases/MutationFunction.md +++ b/docs/framework/react/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1161](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1161) +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/MutationFunctionContext.md b/docs/framework/react/reference/type-aliases/MutationFunctionContext.md index b29a54df298..ef228cc53d3 100644 --- a/docs/framework/react/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/react/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) +Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) +Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1169) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) +Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1170) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1158](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1158) +Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) diff --git a/docs/framework/react/reference/type-aliases/MutationKey.md b/docs/framework/react/reference/type-aliases/MutationKey.md index f89c6959883..7157d6052fd 100644 --- a/docs/framework/react/reference/type-aliases/MutationKey.md +++ b/docs/framework/react/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) diff --git a/docs/framework/react/reference/type-aliases/MutationMeta.md b/docs/framework/react/reference/type-aliases/MutationMeta.md index e1d481cdcf1..f3bf9984fab 100644 --- a/docs/framework/react/reference/type-aliases/MutationMeta.md +++ b/docs/framework/react/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1147](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1147) +Defined in: [packages/query-core/src/types.ts:1160](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1160) diff --git a/docs/framework/react/reference/type-aliases/MutationObserverResult.md b/docs/framework/react/reference/type-aliases/MutationObserverResult.md index cbd07f40537..3390192e071 100644 --- a/docs/framework/react/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/react/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) +Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/MutationScope.md b/docs/framework/react/reference/type-aliases/MutationScope.md index 6ec14643477..a2511c903d9 100644 --- a/docs/framework/react/reference/type-aliases/MutationScope.md +++ b/docs/framework/react/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) +Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) +Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) diff --git a/docs/framework/react/reference/type-aliases/MutationStatus.md b/docs/framework/react/reference/type-aliases/MutationStatus.md index eedf0fb979a..d9b58cdd26f 100644 --- a/docs/framework/react/reference/type-aliases/MutationStatus.md +++ b/docs/framework/react/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) +Defined in: [packages/query-core/src/types.ts:1154](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1154) diff --git a/docs/framework/react/reference/type-aliases/NotifyEventType.md b/docs/framework/react/reference/type-aliases/NotifyEventType.md index 7b788ced7af..94912df6c6b 100644 --- a/docs/framework/react/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/react/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) diff --git a/docs/framework/react/reference/type-aliases/QueryCacheNotifyEvent.md b/docs/framework/react/reference/type-aliases/QueryCacheNotifyEvent.md index 8e52da9e279..b92c76fb826 100644 --- a/docs/framework/react/reference/type-aliases/QueryCacheNotifyEvent.md +++ b/docs/framework/react/reference/type-aliases/QueryCacheNotifyEvent.md @@ -14,7 +14,7 @@ type QueryCacheNotifyEvent = | NotifyEventQueryObserverOptionsUpdated; ``` -Defined in: [packages/query-core/src/queryCache.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L84) +Defined in: [packages/query-core/src/queryCache.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L85) The event passed to a `QueryCache` subscriber. Fired whenever a query is added or removed from the cache, its state is updated (e.g. via `query.setState` or `queryClient.removeQueries`), or diff --git a/docs/framework/react/reference/type-aliases/QueryObserverResult.md b/docs/framework/react/reference/type-aliases/QueryObserverResult.md index f6c4118a978..f5c6c95d5f2 100644 --- a/docs/framework/react/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/react/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) +Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/QueryStatus.md b/docs/framework/react/reference/type-aliases/QueryStatus.md index ed6059e03ec..3fc872e604b 100644 --- a/docs/framework/react/reference/type-aliases/QueryStatus.md +++ b/docs/framework/react/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) +Defined in: [packages/query-core/src/types.ts:740](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L740) diff --git a/docs/framework/react/reference/type-aliases/TimeoutProvider.md b/docs/framework/react/reference/type-aliases/TimeoutProvider.md index 6416fe4c557..3509105bcd1 100644 --- a/docs/framework/react/reference/type-aliases/TimeoutProvider.md +++ b/docs/framework/react/reference/type-aliases/TimeoutProvider.md @@ -7,10 +7,16 @@ title: TimeoutProvider type TimeoutProvider = object; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:22](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L22) +Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) Backend for timer functions. +Timers are performance-sensitive: short-lived timers (delays under a few seconds) tend to be +latency-sensitive, while long-lived ones may benefit more from coalescing — batching timers +with similar deadlines together — which the default provider (backed by the platform's global +`setTimeout`/`setInterval`) does not do. A custom provider can implement coalescing, and can +also support delays longer than the ~24-day maximum of the global `setTimeout`. + ## Type Parameters ### TTimerId @@ -25,7 +31,7 @@ Backend for timer functions. readonly clearInterval: (intervalId) => void; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) +Defined in: [packages/query-core/src/timeoutManager.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L34) #### Parameters @@ -45,7 +51,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/Ta readonly clearTimeout: (timeoutId) => void; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L25) +Defined in: [packages/query-core/src/timeoutManager.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L31) #### Parameters @@ -65,7 +71,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/Ta readonly setInterval: (callback, delay) => TTimerId; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L27) +Defined in: [packages/query-core/src/timeoutManager.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L33) #### Parameters @@ -89,7 +95,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/Ta readonly setTimeout: (callback, delay) => TTimerId; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L24) +Defined in: [packages/query-core/src/timeoutManager.ts:30](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L30) #### Parameters diff --git a/docs/framework/react/reference/variables/environmentManager.md b/docs/framework/react/reference/variables/environmentManager.md index caa1d70b2b6..e207cfd2484 100644 --- a/docs/framework/react/reference/variables/environmentManager.md +++ b/docs/framework/react/reference/variables/environmentManager.md @@ -7,9 +7,13 @@ title: environmentManager const environmentManager: object; ``` -Defined in: [packages/query-core/src/environmentManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L15) +Defined in: [packages/query-core/src/environmentManager.ts:29](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L29) -Manages environment detection used by TanStack Query internals. +Manages how TanStack Query detects whether the current runtime should be treated as +server-side. By default, this uses the same detection as the exported `isServer` utility. + +Override this for runtimes that are not traditional browser/server environments (e.g. +extension workers), where the default detection would give the wrong answer. ## Type Declaration @@ -42,3 +46,14 @@ Overrides the server check globally. #### Returns `void` + +## Example + +```ts +import { environmentManager, isServer } from '@tanstack/query-core' + +environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis)) + +// Restore the default behavior: +environmentManager.setIsServer(() => isServer) +``` diff --git a/docs/framework/react/reference/variables/notifyManager.md b/docs/framework/react/reference/variables/notifyManager.md index e5ecca8df60..4bdf3478be0 100644 --- a/docs/framework/react/reference/variables/notifyManager.md +++ b/docs/framework/react/reference/variables/notifyManager.md @@ -7,7 +7,7 @@ title: notifyManager const notifyManager: object; ``` -Defined in: [packages/query-core/src/notifyManager.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L135) +Defined in: [packages/query-core/src/notifyManager.ts:144](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L144) Handles scheduling and batching callbacks in TanStack Query. @@ -90,7 +90,8 @@ readonly setBatchNotifyFunction: (fn) => void; ``` Use this method to set a custom function to batch notifications together into a single tick. -By default React Query will use the batch function provided by ReactDOM or React Native. +Framework adapters use this to plug in their own batching primitive, so that a single query +update only triggers one re-render instead of one per subscriber. #### Parameters @@ -102,6 +103,15 @@ By default React Query will use the batch function provided by ReactDOM or React `void` +#### Example + +```ts +import { notifyManager } from '@tanstack/query-core' +import { batch } from 'solid-js' + +notifyManager.setBatchNotifyFunction(batch) +``` + ### setNotifyFunction() ```ts diff --git a/docs/framework/react/reference/variables/timeoutManager.md b/docs/framework/react/reference/variables/timeoutManager.md index 2dcfa29b55a..ef9cca969e9 100644 --- a/docs/framework/react/reference/variables/timeoutManager.md +++ b/docs/framework/react/reference/variables/timeoutManager.md @@ -7,6 +7,6 @@ title: timeoutManager const timeoutManager: TimeoutManager; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:226](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L226) +Defined in: [packages/query-core/src/timeoutManager.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L232) Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/solid/reference/classes/Mutation.md b/docs/framework/solid/reference/classes/Mutation.md index 4e85a5b2d4c..e038a9cd394 100644 --- a/docs/framework/solid/reference/classes/Mutation.md +++ b/docs/framework/solid/reference/classes/Mutation.md @@ -219,7 +219,7 @@ Removable.destroy execute(variables): Promise; ``` -Defined in: [packages/query-core/src/mutation.ts:283](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L283) +Defined in: [packages/query-core/src/mutation.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L284) Runs the mutation function for the given variables through a retryer, and drives the mutation's state and lifecycle callbacks through to settlement. @@ -254,7 +254,8 @@ the original error is re-thrown. #### Example ```ts -// typically invoked by MutationObserver.mutate, not called directly +// Called internally by `MutationObserver.mutate` and `Mutation.continue` — +// applications normally trigger mutations through those, not this method. const data = await mutation.execute(variables) ``` diff --git a/docs/framework/solid/reference/classes/MutationCache.md b/docs/framework/solid/reference/classes/MutationCache.md index f79919b1c4b..5a172b4cb9b 100644 --- a/docs/framework/solid/reference/classes/MutationCache.md +++ b/docs/framework/solid/reference/classes/MutationCache.md @@ -3,7 +3,7 @@ id: MutationCache title: MutationCache --- -Defined in: [packages/query-core/src/mutationCache.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L117) +Defined in: [packages/query-core/src/mutationCache.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L124) The `MutationCache` is the storage for mutations. @@ -11,6 +11,14 @@ Normally, you will not interact with the `MutationCache` directly and instead us `QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of safe/known updates to the cache, such as mutations being added, removed, or updated. +## Example + +```ts +const unsubscribe = mutationCache.subscribe((event) => { + console.log(event.type, event.mutation) +}) +``` + ## Extends - `Subscribable`\<`MutationCacheListener`\> @@ -23,7 +31,7 @@ safe/known updates to the cache, such as mutations being added, removed, or upda new MutationCache(config): MutationCache; ``` -Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) +Defined in: [packages/query-core/src/mutationCache.ts:129](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L129) #### Parameters @@ -49,7 +57,7 @@ Subscribable.constructor config: MutationCacheConfig = {}; ``` -Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) +Defined in: [packages/query-core/src/mutationCache.ts:129](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L129) *** @@ -75,7 +83,7 @@ Subscribable.listeners clear(): void; ``` -Defined in: [packages/query-core/src/mutationCache.ts:229](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L229) +Defined in: [packages/query-core/src/mutationCache.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L236) Removes all mutations from the cache. @@ -101,7 +109,7 @@ find(filters): | undefined; ``` -Defined in: [packages/query-core/src/mutationCache.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L271) +Defined in: [packages/query-core/src/mutationCache.ts:278](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L278) A slightly more advanced method that can be used to get an existing mutation instance from the cache. If the mutation does not exist, `undefined` is returned. @@ -158,7 +166,7 @@ const mutation = mutationCache.find({ mutationKey: ['addPost'] }) findAll(filters): Mutation[]; ``` -Defined in: [packages/query-core/src/mutationCache.ts:301](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L301) +Defined in: [packages/query-core/src/mutationCache.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L308) An even more advanced method that can be used to get existing mutation instances from the cache that match the given filters. If no mutations match, an empty array is returned. @@ -196,7 +204,7 @@ const mutations = mutationCache.findAll({ mutationKey: ['addPost'] }) getAll(): Mutation[]; ``` -Defined in: [packages/query-core/src/mutationCache.ts:252](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L252) +Defined in: [packages/query-core/src/mutationCache.ts:259](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L259) Returns all mutations within the cache. diff --git a/docs/framework/solid/reference/classes/QueryCache.md b/docs/framework/solid/reference/classes/QueryCache.md index 5582a9a2560..0a9f44f0efc 100644 --- a/docs/framework/solid/reference/classes/QueryCache.md +++ b/docs/framework/solid/reference/classes/QueryCache.md @@ -3,14 +3,24 @@ id: QueryCache title: QueryCache --- -Defined in: [packages/query-core/src/queryCache.ts:113](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L113) +Defined in: [packages/query-core/src/queryCache.ts:123](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L123) The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta information, and state of the queries it contains. Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient` for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of -safe/known updates to the cache, such as queries being added, removed, or updated. +safe/known updates to the cache, such as queries being added, removed, or updated — updates made +outside of the cache's own tracked mechanisms (e.g. mutating a query's state object directly) do +not notify subscribers. + +## Example + +```ts +const unsubscribe = queryCache.subscribe((event) => { + console.log(event.type, event.query) +}) +``` ## Extends @@ -24,7 +34,7 @@ safe/known updates to the cache, such as queries being added, removed, or update new QueryCache(config): QueryCache; ``` -Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) +Defined in: [packages/query-core/src/queryCache.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L126) #### Parameters @@ -50,7 +60,7 @@ Subscribable.constructor config: QueryCacheConfig = {}; ``` -Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) +Defined in: [packages/query-core/src/queryCache.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L126) *** @@ -79,7 +89,7 @@ build( state?): Query; ``` -Defined in: [packages/query-core/src/queryCache.ts:137](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L137) +Defined in: [packages/query-core/src/queryCache.ts:147](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L147) Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or builds and adds a new one to the cache if none exists yet. Used by framework adapters and @@ -141,7 +151,7 @@ const query = queryCache.build(queryClient, { clear(): void; ``` -Defined in: [packages/query-core/src/queryCache.ts:222](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L222) +Defined in: [packages/query-core/src/queryCache.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L232) Removes all queries from the cache. @@ -167,7 +177,7 @@ find(filters): | undefined; ``` -Defined in: [packages/query-core/src/queryCache.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L289) +Defined in: [packages/query-core/src/queryCache.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L299) A slightly more advanced method that can be used to get an existing query instance from the cache. This instance not only contains all the state for the query, but all of the instances, @@ -223,7 +233,7 @@ const query = queryCache.find({ queryKey: ['posts'] }) findAll(filters): Query[]; ``` -Defined in: [packages/query-core/src/queryCache.ts:314](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L314) +Defined in: [packages/query-core/src/queryCache.ts:324](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L324) An even more advanced method that can be used to get existing query instances from the cache that partially match a query key. If no queries match, an empty array is returned. @@ -263,7 +273,7 @@ get(queryHash): | undefined; ``` -Defined in: [packages/query-core/src/queryCache.ts:244](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L244) +Defined in: [packages/query-core/src/queryCache.ts:254](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L254) Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none exists. Unlike [QueryCache#find](#find), this looks up by the already-computed hash rather @@ -316,7 +326,7 @@ const query = queryCache.get(queryHash) getAll(): Query[]; ``` -Defined in: [packages/query-core/src/queryCache.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L267) +Defined in: [packages/query-core/src/queryCache.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L277) Returns all queries within the cache. @@ -400,7 +410,7 @@ Subscribable.onUnsubscribe remove(query): void; ``` -Defined in: [packages/query-core/src/queryCache.ts:198](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L198) +Defined in: [packages/query-core/src/queryCache.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L208) Destroys the given `Query` and removes it from the cache, notifying subscribers with a `'removed'` event. A no-op if the query is no longer the one currently stored under its hash diff --git a/docs/framework/solid/reference/classes/QueryClient.md b/docs/framework/solid/reference/classes/QueryClient.md index 4565b72ccc6..0b7fdf05b86 100644 --- a/docs/framework/solid/reference/classes/QueryClient.md +++ b/docs/framework/solid/reference/classes/QueryClient.md @@ -46,7 +46,7 @@ QueryCoreClient.constructor cancelQueries(filters?, cancelOptions?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L425) +Defined in: [packages/query-core/src/queryClient.ts:432](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L432) Cancels outgoing fetches for queries matching the given filters. Most useful when performing optimistic updates, since any outgoing refetch that resolves afterwards would otherwise @@ -95,7 +95,7 @@ QueryCoreClient.cancelQueries clear(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1073) +Defined in: [packages/query-core/src/queryClient.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1083) Clears both the query cache and the mutation cache this client is connected to. @@ -126,7 +126,7 @@ QueryCoreClient.clear defaultMutationOptions(options?): T; ``` -Defined in: [packages/query-core/src/queryClient.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1047) +Defined in: [packages/query-core/src/queryClient.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1057) The mutation counterpart of [QueryClient#defaultQueryOptions](#defaultqueryoptions). Called by framework adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the @@ -163,7 +163,7 @@ QueryCoreClient.defaultMutationOptions defaultQueryOptions(options): DefaultedQueryObserverOptions; ``` -Defined in: [packages/query-core/src/queryClient.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L960) +Defined in: [packages/query-core/src/queryClient.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L970) Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the @@ -220,7 +220,7 @@ QueryCoreClient.defaultQueryOptions ensureInfiniteQueryData(options): Promise>; ``` -Defined in: [packages/query-core/src/queryClient.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L725) +Defined in: [packages/query-core/src/queryClient.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L735) #### Type Parameters @@ -272,7 +272,7 @@ QueryCoreClient.ensureInfiniteQueryData ensureQueryData(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L196) +Defined in: [packages/query-core/src/queryClient.ts:197](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L197) #### Type Parameters @@ -320,7 +320,7 @@ QueryCoreClient.ensureQueryData fetchInfiniteQuery(options): Promise>; ``` -Defined in: [packages/query-core/src/queryClient.ts:682](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L682) +Defined in: [packages/query-core/src/queryClient.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L692) #### Type Parameters @@ -372,7 +372,7 @@ QueryCoreClient.fetchInfiniteQuery fetchQuery(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L590) +Defined in: [packages/query-core/src/queryClient.ts:600](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L600) #### Type Parameters @@ -424,7 +424,7 @@ QueryCoreClient.fetchQuery getDefaultOptions(): DefaultOptions; ``` -Defined in: [packages/query-core/src/queryClient.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L808) +Defined in: [packages/query-core/src/queryClient.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L818) Returns the default options that were set when creating the client, or via [QueryClient#setDefaultOptions](#setdefaultoptions). @@ -456,7 +456,7 @@ QueryCoreClient.getDefaultOptions getMutationCache(): MutationCache; ``` -Defined in: [packages/query-core/src/queryClient.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L792) +Defined in: [packages/query-core/src/queryClient.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L802) Returns the mutation cache this client is connected to. @@ -488,7 +488,7 @@ QueryCoreClient.getMutationCache getMutationDefaults(mutationKey): OmitKeyof, "mutationKey">; ``` -Defined in: [packages/query-core/src/queryClient.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L935) +Defined in: [packages/query-core/src/queryClient.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L945) Returns the default options registered for mutations whose mutation key partially matches the given `mutationKey`, via [QueryClient#setMutationDefaults](#setmutationdefaults). If multiple registered @@ -524,12 +524,18 @@ QueryCoreClient.getMutationDefaults getQueriesData(filters): [readonly unknown[], TQueryFnData | undefined][]; ``` -Defined in: [packages/query-core/src/queryClient.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L233) +Defined in: [packages/query-core/src/queryClient.ts:240](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L240) Imperative (non-reactive) way to retrieve the cached data of multiple queries at once. Only queries matching the given filters are returned; if none match, an empty array is returned. +Because the matched queries can hold data of different shapes (e.g. a broad filter can match +queries with unrelated data types), the `TQueryFnData` generic defaults to `unknown` rather +than being inferred. Passing a more specific type is a convenience for call sites that know +every matched query holds the same shape — it is not checked against the actual cache +contents. + #### Type Parameters ##### TQueryFnData @@ -574,7 +580,7 @@ QueryCoreClient.getQueriesData getQueryCache(): QueryCache; ``` -Defined in: [packages/query-core/src/queryClient.ts:776](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L776) +Defined in: [packages/query-core/src/queryClient.ts:786](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L786) Returns the query cache this client is connected to. @@ -606,7 +612,7 @@ QueryCoreClient.getQueryCache getQueryData(queryKey): TInferredQueryFnData | undefined; ``` -Defined in: [packages/query-core/src/queryClient.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L182) +Defined in: [packages/query-core/src/queryClient.ts:183](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L183) Imperative (non-reactive) way to retrieve data for a QueryKey. Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. @@ -656,7 +662,7 @@ QueryCoreClient.getQueryData getQueryDefaults(queryKey): OmitKeyof, "queryKey">; ``` -Defined in: [packages/query-core/src/queryClient.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L878) +Defined in: [packages/query-core/src/queryClient.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L888) Returns the default options registered for queries whose query key partially matches the given `queryKey`, via [QueryClient#setQueryDefaults](#setquerydefaults). If multiple registered defaults @@ -694,7 +700,7 @@ getQueryState(options): Promise[] ? InfiniteData : TData>; ``` -Defined in: [packages/query-core/src/queryClient.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L656) +Defined in: [packages/query-core/src/queryClient.ts:666](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L666) Asynchronous method to fetch and cache an infinite query, resolving with an [InfiniteData](../interfaces/InfiniteData.md) object or throwing with the error. @@ -822,7 +828,7 @@ QueryCoreClient.infiniteQuery invalidateQueries(filters?, options?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:453](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L453) +Defined in: [packages/query-core/src/queryClient.ts:460](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L460) Marks queries matching the given filters as invalidated. Unlike [QueryClient#removeQueries](#removequeries), invalidated queries stay in the cache. @@ -871,7 +877,7 @@ QueryCoreClient.invalidateQueries isFetching(filters?): number; ``` -Defined in: [packages/query-core/src/queryClient.ts:149](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L149) +Defined in: [packages/query-core/src/queryClient.ts:150](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L150) Returns the number of queries in the cache that are currently fetching, optionally matching a set of filters. This includes background-fetching, loading new pages, and @@ -915,7 +921,7 @@ QueryCoreClient.isFetching isMutating(filters?): number; ``` -Defined in: [packages/query-core/src/queryClient.ts:167](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L167) +Defined in: [packages/query-core/src/queryClient.ts:168](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L168) Returns the number of mutations in the cache that are currently pending, optionally matching a set of filters. @@ -958,7 +964,7 @@ QueryCoreClient.isMutating mount(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L103) +Defined in: [packages/query-core/src/queryClient.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L104) Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start listening for focus/online events and resume paused mutations. Ref-counted via an internal @@ -983,7 +989,7 @@ QueryCoreClient.mount prefetchInfiniteQuery(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L704) +Defined in: [packages/query-core/src/queryClient.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L714) #### Type Parameters @@ -1035,7 +1041,7 @@ QueryCoreClient.prefetchInfiniteQuery prefetchQuery(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:624](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L624) +Defined in: [packages/query-core/src/queryClient.ts:634](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L634) #### Type Parameters @@ -1083,7 +1089,7 @@ QueryCoreClient.prefetchQuery query(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:544](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L544) +Defined in: [packages/query-core/src/queryClient.ts:554](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L554) Asynchronous method to fetch and cache a query, resolving with the data or throwing with the error. @@ -1093,12 +1099,15 @@ If the query already exists in the cache and its data is not stale (per the give and the promise resolves once the fetch settles. If a `select` function is provided, it is applied to the data in both cases (cached or freshly fetched) before it is returned. -Unlike `useQuery`, retries are disabled by default here (`retry: false`) unless explicitly -configured, since there is no component to catch a thrown error and retry through re-render. +Unlike a reactive observer, retries are disabled by default here (`retry: false`) unless +explicitly configured, since there is no component to catch a thrown error and retry through +re-render. -The accepted options are a subset of `useQuery`'s options: fields that only make sense for a -reactive observer (e.g. `enabled`, `refetchInterval`, `refetchOnWindowFocus`, `notifyOnChangeProps`, -`throwOnError`, `suspense`, `placeholderData`) are not part of this method's options. +The accepted options are `QueryObserverOptions` minus the fields that only make sense for a +reactive observer — `enabled`, `refetchInterval`, `refetchIntervalInBackground`, +`refetchOnWindowFocus`, `refetchOnReconnect`, `refetchOnMount`, `retryOnMount`, +`notifyOnChangeProps`, `throwOnError`, `suspense`, and `placeholderData` are not part of this +method's options. This method replaces the deprecated `fetchQuery`, and — combined with `{ staleTime: 'static' }` — the deprecated `ensureQueryData`. @@ -1163,7 +1172,7 @@ QueryCoreClient.query refetchQueries(filters?, options?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:490](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L490) +Defined in: [packages/query-core/src/queryClient.ts:497](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L497) Refetches queries matching the given filters, regardless of whether they are stale. Without filters, every query in the cache is refetched. Queries that are disabled, or static (only @@ -1214,7 +1223,7 @@ QueryCoreClient.refetchQueries removeQueries(filters?): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:369](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L369) +Defined in: [packages/query-core/src/queryClient.ts:376](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L376) Removes queries from the cache that match the given filters. Unlike [QueryClient#invalidateQueries](#invalidatequeries) or [QueryClient#refetchQueries](#refetchqueries), this removes @@ -1257,7 +1266,7 @@ QueryCoreClient.removeQueries resetQueries(filters?, options?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L390) +Defined in: [packages/query-core/src/queryClient.ts:397](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L397) Resets queries matching the given filters back to their initial state (e.g. any `initialData`), notifying subscribers rather than removing them. Active queries among the @@ -1303,7 +1312,7 @@ QueryCoreClient.resetQueries resumePausedMutations(): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:757](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L757) +Defined in: [packages/query-core/src/queryClient.ts:767](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L767) Resumes mutations that were paused because there was no network connection. Does nothing (resolving immediately) if the client is currently offline. @@ -1335,7 +1344,7 @@ QueryCoreClient.resumePausedMutations setDefaultOptions(options): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L829) +Defined in: [packages/query-core/src/queryClient.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L839) Dynamically sets the default options for this client, overwriting any previously defined default options. @@ -1381,7 +1390,7 @@ QueryCoreClient.setDefaultOptions setMutationDefaults(mutationKey, options): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L907) +Defined in: [packages/query-core/src/queryClient.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L917) Sets default options for mutations whose mutation key partially matches the given `mutationKey`. As with [QueryClient#setQueryDefaults](#setquerydefaults), the order of registration @@ -1446,7 +1455,7 @@ setQueriesData( options?): [readonly unknown[], TQueryFnData | undefined][]; ``` -Defined in: [packages/query-core/src/queryClient.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L312) +Defined in: [packages/query-core/src/queryClient.ts:319](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L319) Synchronous way to immediately update the cached data of multiple queries at once, using filters or partial query key matching. Only queries that already exist and match the given @@ -1506,7 +1515,7 @@ setQueryData( options?): NoInfer | undefined; ``` -Defined in: [packages/query-core/src/queryClient.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L264) +Defined in: [packages/query-core/src/queryClient.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L271) Synchronous way to immediately update a query's cached data. If the updater (or the value passed) resolves to `undefined`, the cache is left untouched and no query is created; @@ -1576,7 +1585,7 @@ QueryCoreClient.setQueryData setQueryDefaults(queryKey, options): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L848) +Defined in: [packages/query-core/src/queryClient.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L858) Sets default options for queries whose query key partially matches the given `queryKey`. @@ -1639,7 +1648,7 @@ QueryCoreClient.setQueryDefaults unmount(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L126) +Defined in: [packages/query-core/src/queryClient.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L127) The inverse of [QueryClient#mount](#mount) — called by a framework adapter's `QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online diff --git a/docs/framework/solid/reference/functions/experimental_streamedQuery.md b/docs/framework/solid/reference/functions/experimental_streamedQuery.md index afd44df7c5f..4c490322d60 100644 --- a/docs/framework/solid/reference/functions/experimental_streamedQuery.md +++ b/docs/framework/solid/reference/functions/experimental_streamedQuery.md @@ -4,10 +4,10 @@ title: experimental_streamedQuery --- ```ts -function experimental_streamedQuery(queryFn): QueryFunction; +function experimental_streamedQuery(streamFn): QueryFunction; ``` -Defined in: [packages/query-core/src/streamedQuery.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L60) +Defined in: [packages/query-core/src/streamedQuery.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L75) This is a helper function to create a query function that streams data from an AsyncIterable. Data will be an Array of all the chunks received. @@ -30,7 +30,7 @@ The query will stay in fetchStatus 'fetching' until the stream ends. ## Parameters -### queryFn +### streamFn `StreamedQueryParams`\<`TQueryFnData`, `TData`, `TQueryKey`\> diff --git a/docs/framework/solid/reference/interfaces/CancelOptions.md b/docs/framework/solid/reference/interfaces/CancelOptions.md index 2b9293712d2..14394c18533 100644 --- a/docs/framework/solid/reference/interfaces/CancelOptions.md +++ b/docs/framework/solid/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) +Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1466) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1444) +Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1467) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1445](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1445) +Defined in: [packages/query-core/src/types.ts:1468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1468) diff --git a/docs/framework/solid/reference/interfaces/DefaultOptions.md b/docs/framework/solid/reference/interfaces/DefaultOptions.md index cfd8f46c3e9..277707f674c 100644 --- a/docs/framework/solid/reference/interfaces/DefaultOptions.md +++ b/docs/framework/solid/reference/interfaces/DefaultOptions.md @@ -28,7 +28,9 @@ The default type of errors thrown by queries and mutations using this `QueryClie optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) + +Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). #### Inherited from @@ -44,7 +46,9 @@ CoreDefaultOptions.dehydrate optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) + +Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). #### deserializeData? @@ -84,7 +88,9 @@ CoreDefaultOptions.hydrate optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) + +Default options applied to every mutation, unless overridden per-mutation. #### Inherited from @@ -102,6 +108,8 @@ optional queries: OmitKeyof Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) +Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) +Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) +Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) +Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 3e0d3a79fa1..7c55201c028 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) +Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult.md index f6400f44b52..f9541ebd73b 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) +Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult.md index 53d910f545d..1bab3233ec9 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1009) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1013](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1013) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1027](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1027) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1017](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1017) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1016](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1016) +Defined in: [packages/query-core/src/types.ts:1029](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1029) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1021](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1021) +Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1023](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1023) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index 5949179bc6f..58310e1af49 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) +Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) +Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) +Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index e299e60ddc3..22ed760c153 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) +Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) +Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) +Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 7b550e0a90b..732c882f86f 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) +Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) +Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InvalidateOptions.md b/docs/framework/solid/reference/interfaces/InvalidateOptions.md index 494afe1c465..1cd96c88165 100644 --- a/docs/framework/solid/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/solid/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L700) +Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L713) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/solid/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/solid/reference/interfaces/InvalidateQueryFilters.md index 4824d80d910..35fd04b9378 100644 --- a/docs/framework/solid/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/solid/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:690](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L690) +Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -100,7 +100,14 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:693](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L693) +Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) + +Controls which of the matched (now-invalidated) queries are refetched in the background. +Defaults to `'active'`. +- `'active'`: only queries with at least one active observer are refetched. +- `'inactive'`: only queries with no active observer are refetched. +- `'all'`: every matched query is refetched, active or not. +- `'none'`: no query is refetched; matched queries are only marked as invalidated. *** diff --git a/docs/framework/solid/reference/interfaces/MutateOptions.md b/docs/framework/solid/reference/interfaces/MutateOptions.md index a0af091a997..6e27e4e6d29 100644 --- a/docs/framework/solid/reference/interfaces/MutateOptions.md +++ b/docs/framework/solid/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1228) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1234) +Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1247) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1222](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1222) +Defined in: [packages/query-core/src/types.ts:1235](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1235) #### Parameters diff --git a/docs/framework/solid/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/solid/reference/interfaces/MutationObserverBaseResult.md index 98810323966..190d4d4d3b6 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) +Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) +Defined in: [packages/query-core/src/types.ts:1289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1289) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1285) +Defined in: [packages/query-core/src/types.ts:1298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1298) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) +Defined in: [packages/query-core/src/types.ts:1303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1303) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1295) +Defined in: [packages/query-core/src/types.ts:1308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1308) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1300](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1300) +Defined in: [packages/query-core/src/types.ts:1313](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1313) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1305](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1305) +Defined in: [packages/query-core/src/types.ts:1318](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1318) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1314](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1314) +Defined in: [packages/query-core/src/types.ts:1327](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1327) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) +Defined in: [packages/query-core/src/types.ts:1293](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1293) The variables object passed to the `mutationFn`. diff --git a/docs/framework/solid/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/solid/reference/interfaces/MutationObserverErrorResult.md index d61f244ced4..03af3a33d12 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1374](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1374) +Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1385](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1385) +Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1386](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1386) +Defined in: [packages/query-core/src/types.ts:1399](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1399) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1388](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1388) +Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1389](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1389) +Defined in: [packages/query-core/src/types.ts:1402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1402) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1390) +Defined in: [packages/query-core/src/types.ts:1403](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1403) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) +Defined in: [packages/query-core/src/types.ts:1404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1404) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) +Defined in: [packages/query-core/src/types.ts:1405](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1405) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) +Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) The variables object passed to the `mutationFn`. diff --git a/docs/framework/solid/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/solid/reference/interfaces/MutationObserverIdleResult.md index 93655da0aa5..833db327a04 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1332](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1332) +Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) +Defined in: [packages/query-core/src/types.ts:1356](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1356) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) +Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1346](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1346) +Defined in: [packages/query-core/src/types.ts:1359](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1359) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1347) +Defined in: [packages/query-core/src/types.ts:1360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1360) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) +Defined in: [packages/query-core/src/types.ts:1361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1361) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1349) +Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1350](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1350) +Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) +Defined in: [packages/query-core/src/types.ts:1357](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1357) The variables object passed to the `mutationFn`. diff --git a/docs/framework/solid/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/solid/reference/interfaces/MutationObserverLoadingResult.md index de146c45f5c..6732628f444 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) +Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1364](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1364) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) +Defined in: [packages/query-core/src/types.ts:1379](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1379) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1367](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1367) +Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) +Defined in: [packages/query-core/src/types.ts:1381](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1381) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1369](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1369) +Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1370](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1370) +Defined in: [packages/query-core/src/types.ts:1383](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1383) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1371](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1371) +Defined in: [packages/query-core/src/types.ts:1384](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1384) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1365) +Defined in: [packages/query-core/src/types.ts:1378](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1378) The variables object passed to the `mutationFn`. diff --git a/docs/framework/solid/reference/interfaces/MutationObserverOptions.md b/docs/framework/solid/reference/interfaces/MutationObserverOptions.md index f1f16d6931b..6723cfd8f25 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) +Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1220) ## Extends @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) #### Inherited from @@ -51,7 +51,7 @@ MutationOptions.gcTime optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) #### Inherited from @@ -67,7 +67,7 @@ MutationOptions.meta optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) #### Inherited from @@ -83,7 +83,7 @@ MutationOptions.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) +Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) #### Inherited from @@ -99,7 +99,7 @@ MutationOptions.mutationKey optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Inherited from @@ -115,7 +115,7 @@ MutationOptions.networkMode optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Parameters @@ -153,7 +153,7 @@ MutationOptions.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) #### Parameters @@ -183,7 +183,7 @@ MutationOptions.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) #### Parameters @@ -225,7 +225,7 @@ MutationOptions.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) #### Parameters @@ -263,7 +263,7 @@ MutationOptions.onSuccess optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) #### Inherited from @@ -279,7 +279,7 @@ MutationOptions.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) #### Inherited from @@ -295,7 +295,7 @@ MutationOptions.retryDelay optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) +Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) #### Inherited from @@ -311,4 +311,4 @@ MutationOptions.scope optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) diff --git a/docs/framework/solid/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/solid/reference/interfaces/MutationObserverSuccessResult.md index b50ec4ab6f1..89e8c2739cc 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) +Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1406](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1406) +Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1407) +Defined in: [packages/query-core/src/types.ts:1420](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1420) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1409) +Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1410](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1410) +Defined in: [packages/query-core/src/types.ts:1423](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1423) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) +Defined in: [packages/query-core/src/types.ts:1424](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1424) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) +Defined in: [packages/query-core/src/types.ts:1425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1425) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) +Defined in: [packages/query-core/src/types.ts:1426](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1426) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) +Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) The variables object passed to the `mutationFn`. diff --git a/docs/framework/solid/reference/interfaces/MutationOptions.md b/docs/framework/solid/reference/interfaces/MutationOptions.md index a7c20b5ae10..e6a95221aec 100644 --- a/docs/framework/solid/reference/interfaces/MutationOptions.md +++ b/docs/framework/solid/reference/interfaces/MutationOptions.md @@ -45,7 +45,7 @@ The type returned by `onMutate`, passed on to `onSuccess`/`onError`/`onSettled`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) #### Inherited from @@ -59,7 +59,7 @@ Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) #### Inherited from @@ -73,7 +73,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) #### Inherited from @@ -89,7 +89,7 @@ OmitKeyof.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) +Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) #### Inherited from @@ -103,7 +103,7 @@ Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Inherited from @@ -117,7 +117,7 @@ Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Parameters @@ -155,7 +155,7 @@ OmitKeyof.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) #### Parameters @@ -185,7 +185,7 @@ OmitKeyof.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) #### Parameters @@ -227,7 +227,7 @@ OmitKeyof.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) #### Parameters @@ -265,7 +265,7 @@ OmitKeyof.onSuccess optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) #### Inherited from @@ -281,7 +281,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) #### Inherited from @@ -297,7 +297,7 @@ OmitKeyof.retryDelay optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) +Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) #### Inherited from @@ -311,7 +311,7 @@ Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) #### Inherited from diff --git a/docs/framework/solid/reference/interfaces/NotifyEvent.md b/docs/framework/solid/reference/interfaces/NotifyEvent.md index 1dc93464df1..17b3241654f 100644 --- a/docs/framework/solid/reference/interfaces/NotifyEvent.md +++ b/docs/framework/solid/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1462) +Defined in: [packages/query-core/src/types.ts:1485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1485) diff --git a/docs/framework/solid/reference/interfaces/QueryCacheConfig.md b/docs/framework/solid/reference/interfaces/QueryCacheConfig.md index 69ea600366c..3c6aebe496f 100644 --- a/docs/framework/solid/reference/interfaces/QueryCacheConfig.md +++ b/docs/framework/solid/reference/interfaces/QueryCacheConfig.md @@ -3,11 +3,12 @@ id: QueryCacheConfig title: QueryCacheConfig --- -Defined in: [packages/query-core/src/queryCache.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L24) +Defined in: [packages/query-core/src/queryCache.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L25) Global callbacks that fire for every query handled by a `QueryCache`, regardless of which component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can -override, these callbacks are always called. +override, these callbacks are always called. Unlike `MutationCacheConfig`'s callbacks, these +are fire-and-forget: their return value is not awaited before the query settles. ## Properties @@ -17,7 +18,7 @@ override, these callbacks are always called. optional onError: (error, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L26) +Defined in: [packages/query-core/src/queryCache.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L27) Called when any query in the cache encounters an error. @@ -43,7 +44,7 @@ Called when any query in the cache encounters an error. optional onSettled: (data, error, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L33) +Defined in: [packages/query-core/src/queryCache.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L34) Called when any query in the cache is settled, either successfully or with an error. @@ -73,7 +74,7 @@ Called when any query in the cache is settled, either successfully or with an er optional onSuccess: (data, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L31) +Defined in: [packages/query-core/src/queryCache.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L32) Called when any query in the cache is successful. diff --git a/docs/framework/solid/reference/interfaces/QueryClientConfig.md b/docs/framework/solid/reference/interfaces/QueryClientConfig.md index f326a6fb128..3f56d75ffdd 100644 --- a/docs/framework/solid/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/solid/reference/interfaces/QueryClientConfig.md @@ -21,6 +21,8 @@ optional defaultOptions: DefaultOptions; Defined in: [packages/solid-query/src/QueryClient.ts:106](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClient.ts#L106) +Default options for all queries and mutations created through this client. + #### Overrides ```ts @@ -35,7 +37,10 @@ QueryCoreClientConfig.defaultOptions optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) +Defined in: [packages/query-core/src/types.ts:1447](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1447) + +The mutation cache this client is connected to. A new `MutationCache` is created if not +provided. #### Inherited from @@ -51,7 +56,9 @@ QueryCoreClientConfig.mutationCache optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1428) +Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) + +The query cache this client is connected to. A new `QueryCache` is created if not provided. #### Inherited from diff --git a/docs/framework/solid/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/solid/reference/interfaces/QueryObserverBaseResult.md index 2840be27e27..4689d9d661a 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) +Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L743) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) +Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) +Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) +Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) +Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/solid/reference/interfaces/QueryObserverLoadingErrorResult.md index 97d5d5125a7..86ae34b80ab 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) +Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/solid/reference/interfaces/QueryObserverLoadingResult.md index 1f442f18130..a0024077883 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L873) +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) +Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) +Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:885](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L885) +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:884](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L884) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/solid/reference/interfaces/QueryObserverPendingResult.md index ad040ff9cc5..21fab248a7c 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:862](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L862) +Defined in: [packages/query-core/src/types.ts:875](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L875) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) +Defined in: [packages/query-core/src/types.ts:876](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L876) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:864](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L864) +Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:866](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L866) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:865](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L865) +Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:869](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L869) +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) +Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:870](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L870) +Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/solid/reference/interfaces/QueryObserverPlaceholderResult.md index 8a1ae61dee9..89af2502c11 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) +Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) +Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) +Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) +Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/solid/reference/interfaces/QueryObserverRefetchErrorResult.md index c8d5274697a..dab5586fdc1 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) +Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/solid/reference/interfaces/QueryObserverSuccessResult.md index e3c834e6c3a..b180b89ca62 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) +Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/RefetchOptions.md b/docs/framework/solid/reference/interfaces/RefetchOptions.md index a3db94b1674..b502dcd3492 100644 --- a/docs/framework/solid/reference/interfaces/RefetchOptions.md +++ b/docs/framework/solid/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L679) +Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L684) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,7 +38,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/solid/reference/interfaces/RefetchQueryFilters.md b/docs/framework/solid/reference/interfaces/RefetchQueryFilters.md index f2b6b287875..84f917c6201 100644 --- a/docs/framework/solid/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/solid/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:696](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L696) +Defined in: [packages/query-core/src/types.ts:709](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L709) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. diff --git a/docs/framework/solid/reference/interfaces/ResetOptions.md b/docs/framework/solid/reference/interfaces/ResetOptions.md index bfa931717f8..1855fef3064 100644 --- a/docs/framework/solid/reference/interfaces/ResetOptions.md +++ b/docs/framework/solid/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) +Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L714) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/solid/reference/interfaces/ResultOptions.md b/docs/framework/solid/reference/interfaces/ResultOptions.md index dbf00d6c67e..9766c56d1a6 100644 --- a/docs/framework/solid/reference/interfaces/ResultOptions.md +++ b/docs/framework/solid/reference/interfaces/ResultOptions.md @@ -19,4 +19,8 @@ Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. diff --git a/docs/framework/solid/reference/interfaces/SetDataOptions.md b/docs/framework/solid/reference/interfaces/SetDataOptions.md index 5fcbcfdf7cd..4262e781b05 100644 --- a/docs/framework/solid/reference/interfaces/SetDataOptions.md +++ b/docs/framework/solid/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1448) +Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1471) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) +Defined in: [packages/query-core/src/types.ts:1472](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1472) diff --git a/docs/framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index ced8e568299..d82cfa37d51 100644 --- a/docs/framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/solid/reference/type-aliases/DefinedQueryObserverResult.md index 7afdbfd38bc..97fcae175a9 100644 --- a/docs/framework/solid/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/solid/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/FetchStatus.md b/docs/framework/solid/reference/type-aliases/FetchStatus.md index 4dae9444af6..7b71e54eacd 100644 --- a/docs/framework/solid/reference/type-aliases/FetchStatus.md +++ b/docs/framework/solid/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) diff --git a/docs/framework/solid/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/solid/reference/type-aliases/InfiniteQueryObserverResult.md index 95fda780d1d..7a646bc1c38 100644 --- a/docs/framework/solid/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/solid/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/MutateFunction.md b/docs/framework/solid/reference/type-aliases/MutateFunction.md index f574ca7f8ca..284bd0fc270 100644 --- a/docs/framework/solid/reference/type-aliases/MutateFunction.md +++ b/docs/framework/solid/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1258) +Defined in: [packages/query-core/src/types.ts:1271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1271) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/MutateFunctionRest.md b/docs/framework/solid/reference/type-aliases/MutateFunctionRest.md index aef21572aeb..a2f16ea5302 100644 --- a/docs/framework/solid/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/solid/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1243](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1243) +Defined in: [packages/query-core/src/types.ts:1256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1256) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/MutationFunction.md b/docs/framework/solid/reference/type-aliases/MutationFunction.md index e306a5f1a48..4c8c7aed384 100644 --- a/docs/framework/solid/reference/type-aliases/MutationFunction.md +++ b/docs/framework/solid/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1161](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1161) +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/MutationFunctionContext.md b/docs/framework/solid/reference/type-aliases/MutationFunctionContext.md index b29a54df298..ef228cc53d3 100644 --- a/docs/framework/solid/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/solid/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) +Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) +Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1169) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) +Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1170) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1158](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1158) +Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) diff --git a/docs/framework/solid/reference/type-aliases/MutationKey.md b/docs/framework/solid/reference/type-aliases/MutationKey.md index f89c6959883..7157d6052fd 100644 --- a/docs/framework/solid/reference/type-aliases/MutationKey.md +++ b/docs/framework/solid/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) diff --git a/docs/framework/solid/reference/type-aliases/MutationMeta.md b/docs/framework/solid/reference/type-aliases/MutationMeta.md index e1d481cdcf1..f3bf9984fab 100644 --- a/docs/framework/solid/reference/type-aliases/MutationMeta.md +++ b/docs/framework/solid/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1147](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1147) +Defined in: [packages/query-core/src/types.ts:1160](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1160) diff --git a/docs/framework/solid/reference/type-aliases/MutationObserverResult.md b/docs/framework/solid/reference/type-aliases/MutationObserverResult.md index cbd07f40537..3390192e071 100644 --- a/docs/framework/solid/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/solid/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) +Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/MutationScope.md b/docs/framework/solid/reference/type-aliases/MutationScope.md index 6ec14643477..a2511c903d9 100644 --- a/docs/framework/solid/reference/type-aliases/MutationScope.md +++ b/docs/framework/solid/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) +Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) +Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) diff --git a/docs/framework/solid/reference/type-aliases/MutationStatus.md b/docs/framework/solid/reference/type-aliases/MutationStatus.md index eedf0fb979a..d9b58cdd26f 100644 --- a/docs/framework/solid/reference/type-aliases/MutationStatus.md +++ b/docs/framework/solid/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) +Defined in: [packages/query-core/src/types.ts:1154](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1154) diff --git a/docs/framework/solid/reference/type-aliases/NotifyEventType.md b/docs/framework/solid/reference/type-aliases/NotifyEventType.md index 7b788ced7af..94912df6c6b 100644 --- a/docs/framework/solid/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/solid/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) diff --git a/docs/framework/solid/reference/type-aliases/QueryCacheNotifyEvent.md b/docs/framework/solid/reference/type-aliases/QueryCacheNotifyEvent.md index 8e52da9e279..b92c76fb826 100644 --- a/docs/framework/solid/reference/type-aliases/QueryCacheNotifyEvent.md +++ b/docs/framework/solid/reference/type-aliases/QueryCacheNotifyEvent.md @@ -14,7 +14,7 @@ type QueryCacheNotifyEvent = | NotifyEventQueryObserverOptionsUpdated; ``` -Defined in: [packages/query-core/src/queryCache.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L84) +Defined in: [packages/query-core/src/queryCache.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L85) The event passed to a `QueryCache` subscriber. Fired whenever a query is added or removed from the cache, its state is updated (e.g. via `query.setState` or `queryClient.removeQueries`), or diff --git a/docs/framework/solid/reference/type-aliases/QueryObserverResult.md b/docs/framework/solid/reference/type-aliases/QueryObserverResult.md index f6c4118a978..f5c6c95d5f2 100644 --- a/docs/framework/solid/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/solid/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) +Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/QueryStatus.md b/docs/framework/solid/reference/type-aliases/QueryStatus.md index ed6059e03ec..3fc872e604b 100644 --- a/docs/framework/solid/reference/type-aliases/QueryStatus.md +++ b/docs/framework/solid/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) +Defined in: [packages/query-core/src/types.ts:740](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L740) diff --git a/docs/framework/solid/reference/type-aliases/TimeoutProvider.md b/docs/framework/solid/reference/type-aliases/TimeoutProvider.md index 6416fe4c557..3509105bcd1 100644 --- a/docs/framework/solid/reference/type-aliases/TimeoutProvider.md +++ b/docs/framework/solid/reference/type-aliases/TimeoutProvider.md @@ -7,10 +7,16 @@ title: TimeoutProvider type TimeoutProvider = object; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:22](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L22) +Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) Backend for timer functions. +Timers are performance-sensitive: short-lived timers (delays under a few seconds) tend to be +latency-sensitive, while long-lived ones may benefit more from coalescing — batching timers +with similar deadlines together — which the default provider (backed by the platform's global +`setTimeout`/`setInterval`) does not do. A custom provider can implement coalescing, and can +also support delays longer than the ~24-day maximum of the global `setTimeout`. + ## Type Parameters ### TTimerId @@ -25,7 +31,7 @@ Backend for timer functions. readonly clearInterval: (intervalId) => void; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) +Defined in: [packages/query-core/src/timeoutManager.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L34) #### Parameters @@ -45,7 +51,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/Ta readonly clearTimeout: (timeoutId) => void; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L25) +Defined in: [packages/query-core/src/timeoutManager.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L31) #### Parameters @@ -65,7 +71,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/Ta readonly setInterval: (callback, delay) => TTimerId; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L27) +Defined in: [packages/query-core/src/timeoutManager.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L33) #### Parameters @@ -89,7 +95,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/Ta readonly setTimeout: (callback, delay) => TTimerId; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L24) +Defined in: [packages/query-core/src/timeoutManager.ts:30](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L30) #### Parameters diff --git a/docs/framework/solid/reference/variables/environmentManager.md b/docs/framework/solid/reference/variables/environmentManager.md index caa1d70b2b6..e207cfd2484 100644 --- a/docs/framework/solid/reference/variables/environmentManager.md +++ b/docs/framework/solid/reference/variables/environmentManager.md @@ -7,9 +7,13 @@ title: environmentManager const environmentManager: object; ``` -Defined in: [packages/query-core/src/environmentManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L15) +Defined in: [packages/query-core/src/environmentManager.ts:29](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L29) -Manages environment detection used by TanStack Query internals. +Manages how TanStack Query detects whether the current runtime should be treated as +server-side. By default, this uses the same detection as the exported `isServer` utility. + +Override this for runtimes that are not traditional browser/server environments (e.g. +extension workers), where the default detection would give the wrong answer. ## Type Declaration @@ -42,3 +46,14 @@ Overrides the server check globally. #### Returns `void` + +## Example + +```ts +import { environmentManager, isServer } from '@tanstack/query-core' + +environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis)) + +// Restore the default behavior: +environmentManager.setIsServer(() => isServer) +``` diff --git a/docs/framework/solid/reference/variables/notifyManager.md b/docs/framework/solid/reference/variables/notifyManager.md index e5ecca8df60..4bdf3478be0 100644 --- a/docs/framework/solid/reference/variables/notifyManager.md +++ b/docs/framework/solid/reference/variables/notifyManager.md @@ -7,7 +7,7 @@ title: notifyManager const notifyManager: object; ``` -Defined in: [packages/query-core/src/notifyManager.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L135) +Defined in: [packages/query-core/src/notifyManager.ts:144](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L144) Handles scheduling and batching callbacks in TanStack Query. @@ -90,7 +90,8 @@ readonly setBatchNotifyFunction: (fn) => void; ``` Use this method to set a custom function to batch notifications together into a single tick. -By default React Query will use the batch function provided by ReactDOM or React Native. +Framework adapters use this to plug in their own batching primitive, so that a single query +update only triggers one re-render instead of one per subscriber. #### Parameters @@ -102,6 +103,15 @@ By default React Query will use the batch function provided by ReactDOM or React `void` +#### Example + +```ts +import { notifyManager } from '@tanstack/query-core' +import { batch } from 'solid-js' + +notifyManager.setBatchNotifyFunction(batch) +``` + ### setNotifyFunction() ```ts diff --git a/docs/framework/solid/reference/variables/timeoutManager.md b/docs/framework/solid/reference/variables/timeoutManager.md index 2dcfa29b55a..ef9cca969e9 100644 --- a/docs/framework/solid/reference/variables/timeoutManager.md +++ b/docs/framework/solid/reference/variables/timeoutManager.md @@ -7,6 +7,6 @@ title: timeoutManager const timeoutManager: TimeoutManager; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:226](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L226) +Defined in: [packages/query-core/src/timeoutManager.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L232) Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/svelte/reference/classes/Mutation.md b/docs/framework/svelte/reference/classes/Mutation.md index 4e85a5b2d4c..e038a9cd394 100644 --- a/docs/framework/svelte/reference/classes/Mutation.md +++ b/docs/framework/svelte/reference/classes/Mutation.md @@ -219,7 +219,7 @@ Removable.destroy execute(variables): Promise; ``` -Defined in: [packages/query-core/src/mutation.ts:283](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L283) +Defined in: [packages/query-core/src/mutation.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L284) Runs the mutation function for the given variables through a retryer, and drives the mutation's state and lifecycle callbacks through to settlement. @@ -254,7 +254,8 @@ the original error is re-thrown. #### Example ```ts -// typically invoked by MutationObserver.mutate, not called directly +// Called internally by `MutationObserver.mutate` and `Mutation.continue` — +// applications normally trigger mutations through those, not this method. const data = await mutation.execute(variables) ``` diff --git a/docs/framework/svelte/reference/classes/MutationCache.md b/docs/framework/svelte/reference/classes/MutationCache.md index f79919b1c4b..5a172b4cb9b 100644 --- a/docs/framework/svelte/reference/classes/MutationCache.md +++ b/docs/framework/svelte/reference/classes/MutationCache.md @@ -3,7 +3,7 @@ id: MutationCache title: MutationCache --- -Defined in: [packages/query-core/src/mutationCache.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L117) +Defined in: [packages/query-core/src/mutationCache.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L124) The `MutationCache` is the storage for mutations. @@ -11,6 +11,14 @@ Normally, you will not interact with the `MutationCache` directly and instead us `QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of safe/known updates to the cache, such as mutations being added, removed, or updated. +## Example + +```ts +const unsubscribe = mutationCache.subscribe((event) => { + console.log(event.type, event.mutation) +}) +``` + ## Extends - `Subscribable`\<`MutationCacheListener`\> @@ -23,7 +31,7 @@ safe/known updates to the cache, such as mutations being added, removed, or upda new MutationCache(config): MutationCache; ``` -Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) +Defined in: [packages/query-core/src/mutationCache.ts:129](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L129) #### Parameters @@ -49,7 +57,7 @@ Subscribable.constructor config: MutationCacheConfig = {}; ``` -Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) +Defined in: [packages/query-core/src/mutationCache.ts:129](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L129) *** @@ -75,7 +83,7 @@ Subscribable.listeners clear(): void; ``` -Defined in: [packages/query-core/src/mutationCache.ts:229](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L229) +Defined in: [packages/query-core/src/mutationCache.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L236) Removes all mutations from the cache. @@ -101,7 +109,7 @@ find(filters): | undefined; ``` -Defined in: [packages/query-core/src/mutationCache.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L271) +Defined in: [packages/query-core/src/mutationCache.ts:278](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L278) A slightly more advanced method that can be used to get an existing mutation instance from the cache. If the mutation does not exist, `undefined` is returned. @@ -158,7 +166,7 @@ const mutation = mutationCache.find({ mutationKey: ['addPost'] }) findAll(filters): Mutation[]; ``` -Defined in: [packages/query-core/src/mutationCache.ts:301](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L301) +Defined in: [packages/query-core/src/mutationCache.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L308) An even more advanced method that can be used to get existing mutation instances from the cache that match the given filters. If no mutations match, an empty array is returned. @@ -196,7 +204,7 @@ const mutations = mutationCache.findAll({ mutationKey: ['addPost'] }) getAll(): Mutation[]; ``` -Defined in: [packages/query-core/src/mutationCache.ts:252](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L252) +Defined in: [packages/query-core/src/mutationCache.ts:259](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L259) Returns all mutations within the cache. diff --git a/docs/framework/svelte/reference/classes/QueryCache.md b/docs/framework/svelte/reference/classes/QueryCache.md index 8e435445b2c..b7a577b5e54 100644 --- a/docs/framework/svelte/reference/classes/QueryCache.md +++ b/docs/framework/svelte/reference/classes/QueryCache.md @@ -3,14 +3,24 @@ id: QueryCache title: QueryCache --- -Defined in: [packages/query-core/src/queryCache.ts:113](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L113) +Defined in: [packages/query-core/src/queryCache.ts:123](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L123) The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta information, and state of the queries it contains. Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient` for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of -safe/known updates to the cache, such as queries being added, removed, or updated. +safe/known updates to the cache, such as queries being added, removed, or updated — updates made +outside of the cache's own tracked mechanisms (e.g. mutating a query's state object directly) do +not notify subscribers. + +## Example + +```ts +const unsubscribe = queryCache.subscribe((event) => { + console.log(event.type, event.query) +}) +``` ## Extends @@ -24,7 +34,7 @@ safe/known updates to the cache, such as queries being added, removed, or update new QueryCache(config): QueryCache; ``` -Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) +Defined in: [packages/query-core/src/queryCache.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L126) #### Parameters @@ -50,7 +60,7 @@ Subscribable.constructor config: QueryCacheConfig = {}; ``` -Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) +Defined in: [packages/query-core/src/queryCache.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L126) *** @@ -79,7 +89,7 @@ build( state?): Query; ``` -Defined in: [packages/query-core/src/queryCache.ts:137](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L137) +Defined in: [packages/query-core/src/queryCache.ts:147](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L147) Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or builds and adds a new one to the cache if none exists yet. Used by framework adapters and @@ -141,7 +151,7 @@ const query = queryCache.build(queryClient, { clear(): void; ``` -Defined in: [packages/query-core/src/queryCache.ts:222](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L222) +Defined in: [packages/query-core/src/queryCache.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L232) Removes all queries from the cache. @@ -167,7 +177,7 @@ find(filters): | undefined; ``` -Defined in: [packages/query-core/src/queryCache.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L289) +Defined in: [packages/query-core/src/queryCache.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L299) A slightly more advanced method that can be used to get an existing query instance from the cache. This instance not only contains all the state for the query, but all of the instances, @@ -223,7 +233,7 @@ const query = queryCache.find({ queryKey: ['posts'] }) findAll(filters): Query[]; ``` -Defined in: [packages/query-core/src/queryCache.ts:314](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L314) +Defined in: [packages/query-core/src/queryCache.ts:324](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L324) An even more advanced method that can be used to get existing query instances from the cache that partially match a query key. If no queries match, an empty array is returned. @@ -263,7 +273,7 @@ get(queryHash): | undefined; ``` -Defined in: [packages/query-core/src/queryCache.ts:244](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L244) +Defined in: [packages/query-core/src/queryCache.ts:254](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L254) Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none exists. Unlike [QueryCache#find](#find), this looks up by the already-computed hash rather @@ -316,7 +326,7 @@ const query = queryCache.get(queryHash) getAll(): Query[]; ``` -Defined in: [packages/query-core/src/queryCache.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L267) +Defined in: [packages/query-core/src/queryCache.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L277) Returns all queries within the cache. @@ -400,7 +410,7 @@ Subscribable.onUnsubscribe remove(query): void; ``` -Defined in: [packages/query-core/src/queryCache.ts:198](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L198) +Defined in: [packages/query-core/src/queryCache.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L208) Destroys the given `Query` and removes it from the cache, notifying subscribers with a `'removed'` event. A no-op if the query is no longer the one currently stored under its hash diff --git a/docs/framework/svelte/reference/classes/QueryClient.md b/docs/framework/svelte/reference/classes/QueryClient.md index 03250c00243..c7d1a034545 100644 --- a/docs/framework/svelte/reference/classes/QueryClient.md +++ b/docs/framework/svelte/reference/classes/QueryClient.md @@ -3,12 +3,14 @@ id: QueryClient title: QueryClient --- -Defined in: [packages/query-core/src/queryClient.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L78) +Defined in: [packages/query-core/src/queryClient.ts:79](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L79) `QueryClient` is used to interact with a cache of queries and mutations. It owns a `QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds the default options that are applied to queries and mutations created through it. +## Example + ```ts const queryClient = new QueryClient({ defaultOptions: { @@ -29,7 +31,7 @@ await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts }) new QueryClient(config): QueryClient; ``` -Defined in: [packages/query-core/src/queryClient.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L88) +Defined in: [packages/query-core/src/queryClient.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L89) #### Parameters @@ -49,7 +51,7 @@ Defined in: [packages/query-core/src/queryClient.ts:88](https://github.com/TanSt cancelQueries(filters?, cancelOptions?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L425) +Defined in: [packages/query-core/src/queryClient.ts:432](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L432) Cancels outgoing fetches for queries matching the given filters. Most useful when performing optimistic updates, since any outgoing refetch that resolves afterwards would otherwise @@ -92,7 +94,7 @@ await queryClient.cancelQueries({ queryKey: ['posts'], exact: true }) clear(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1073) +Defined in: [packages/query-core/src/queryClient.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1083) Clears both the query cache and the mutation cache this client is connected to. @@ -117,7 +119,7 @@ queryClient.clear() defaultMutationOptions(options?): T; ``` -Defined in: [packages/query-core/src/queryClient.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1047) +Defined in: [packages/query-core/src/queryClient.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1057) The mutation counterpart of [QueryClient#defaultQueryOptions](#defaultqueryoptions). Called by framework adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the @@ -148,7 +150,7 @@ on top. A no-op if the options are already defaulted (`_defaulted: true`). defaultQueryOptions(options): DefaultedQueryObserverOptions; ``` -Defined in: [packages/query-core/src/queryClient.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L960) +Defined in: [packages/query-core/src/queryClient.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L970) Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the @@ -199,7 +201,7 @@ on top. A no-op if the options are already defaulted (`_defaulted: true`). ensureInfiniteQueryData(options): Promise>; ``` -Defined in: [packages/query-core/src/queryClient.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L725) +Defined in: [packages/query-core/src/queryClient.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L735) #### Type Parameters @@ -245,7 +247,7 @@ Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This ensureQueryData(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L196) +Defined in: [packages/query-core/src/queryClient.ts:197](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L197) #### Type Parameters @@ -287,7 +289,7 @@ Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method fetchInfiniteQuery(options): Promise>; ``` -Defined in: [packages/query-core/src/queryClient.ts:682](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L682) +Defined in: [packages/query-core/src/queryClient.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L692) #### Type Parameters @@ -333,7 +335,7 @@ Use queryClient.infiniteQuery(options) instead. This method will be removed in t fetchQuery(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L590) +Defined in: [packages/query-core/src/queryClient.ts:600](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L600) #### Type Parameters @@ -379,7 +381,7 @@ Use queryClient.query(options) instead. This method will be removed in the next getDefaultOptions(): DefaultOptions; ``` -Defined in: [packages/query-core/src/queryClient.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L808) +Defined in: [packages/query-core/src/queryClient.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L818) Returns the default options that were set when creating the client, or via [QueryClient#setDefaultOptions](#setdefaultoptions). @@ -405,7 +407,7 @@ const defaultOptions = queryClient.getDefaultOptions() getMutationCache(): MutationCache; ``` -Defined in: [packages/query-core/src/queryClient.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L792) +Defined in: [packages/query-core/src/queryClient.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L802) Returns the mutation cache this client is connected to. @@ -431,7 +433,7 @@ const mutations = mutationCache.findAll({ status: 'pending' }) getMutationDefaults(mutationKey): OmitKeyof, "mutationKey">; ``` -Defined in: [packages/query-core/src/queryClient.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L935) +Defined in: [packages/query-core/src/queryClient.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L945) Returns the default options registered for mutations whose mutation key partially matches the given `mutationKey`, via [QueryClient#setMutationDefaults](#setmutationdefaults). If multiple registered @@ -461,12 +463,18 @@ const defaultOptions = queryClient.getMutationDefaults(['addPost']) getQueriesData(filters): [readonly unknown[], TQueryFnData | undefined][]; ``` -Defined in: [packages/query-core/src/queryClient.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L233) +Defined in: [packages/query-core/src/queryClient.ts:240](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L240) Imperative (non-reactive) way to retrieve the cached data of multiple queries at once. Only queries matching the given filters are returned; if none match, an empty array is returned. +Because the matched queries can hold data of different shapes (e.g. a broad filter can match +queries with unrelated data types), the `TQueryFnData` generic defaults to `unknown` rather +than being inferred. Passing a more specific type is a convenience for call sites that know +every matched query holds the same shape — it is not checked against the actual cache +contents. + #### Type Parameters ##### TQueryFnData @@ -505,7 +513,7 @@ const data = queryClient.getQueriesData({ queryKey: ['posts'] }) getQueryCache(): QueryCache; ``` -Defined in: [packages/query-core/src/queryClient.ts:776](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L776) +Defined in: [packages/query-core/src/queryClient.ts:786](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L786) Returns the query cache this client is connected to. @@ -531,7 +539,7 @@ const queries = queryCache.findAll({ queryKey: ['posts'] }) getQueryData(queryKey): TInferredQueryFnData | undefined; ``` -Defined in: [packages/query-core/src/queryClient.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L182) +Defined in: [packages/query-core/src/queryClient.ts:183](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L183) Imperative (non-reactive) way to retrieve data for a QueryKey. Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. @@ -575,7 +583,7 @@ Use `useQuery` to create a `QueryObserver` that subscribes to changes. getQueryDefaults(queryKey): OmitKeyof, "queryKey">; ``` -Defined in: [packages/query-core/src/queryClient.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L878) +Defined in: [packages/query-core/src/queryClient.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L888) Returns the default options registered for queries whose query key partially matches the given `queryKey`, via [QueryClient#setQueryDefaults](#setquerydefaults). If multiple registered defaults @@ -607,7 +615,7 @@ getQueryState(options): Promise[] ? InfiniteData : TData>; ``` -Defined in: [packages/query-core/src/queryClient.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L656) +Defined in: [packages/query-core/src/queryClient.ts:666](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L666) Asynchronous method to fetch and cache an infinite query, resolving with an [InfiniteData](../interfaces/InfiniteData.md) object or throwing with the error. @@ -723,7 +731,7 @@ try { invalidateQueries(filters?, options?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:453](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L453) +Defined in: [packages/query-core/src/queryClient.ts:460](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L460) Marks queries matching the given filters as invalidated. Unlike [QueryClient#removeQueries](#removequeries), invalidated queries stay in the cache. @@ -766,7 +774,7 @@ await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' isFetching(filters?): number; ``` -Defined in: [packages/query-core/src/queryClient.ts:149](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L149) +Defined in: [packages/query-core/src/queryClient.ts:150](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L150) Returns the number of queries in the cache that are currently fetching, optionally matching a set of filters. This includes background-fetching, loading new pages, and @@ -804,7 +812,7 @@ if (queryClient.isFetching()) { isMutating(filters?): number; ``` -Defined in: [packages/query-core/src/queryClient.ts:167](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L167) +Defined in: [packages/query-core/src/queryClient.ts:168](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L168) Returns the number of mutations in the cache that are currently pending, optionally matching a set of filters. @@ -841,7 +849,7 @@ if (queryClient.isMutating()) { mount(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L103) +Defined in: [packages/query-core/src/queryClient.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L104) Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start listening for focus/online events and resume paused mutations. Ref-counted via an internal @@ -860,7 +868,7 @@ the shared listeners until the last one unmounts. prefetchInfiniteQuery(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L704) +Defined in: [packages/query-core/src/queryClient.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L714) #### Type Parameters @@ -906,7 +914,7 @@ Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.ca prefetchQuery(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:624](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L624) +Defined in: [packages/query-core/src/queryClient.ts:634](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L634) #### Type Parameters @@ -948,7 +956,7 @@ Use queryClient.query(options) instead. You can swallow errors with `.catch(noop query(options): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:544](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L544) +Defined in: [packages/query-core/src/queryClient.ts:554](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L554) Asynchronous method to fetch and cache a query, resolving with the data or throwing with the error. @@ -958,12 +966,15 @@ If the query already exists in the cache and its data is not stale (per the give and the promise resolves once the fetch settles. If a `select` function is provided, it is applied to the data in both cases (cached or freshly fetched) before it is returned. -Unlike `useQuery`, retries are disabled by default here (`retry: false`) unless explicitly -configured, since there is no component to catch a thrown error and retry through re-render. +Unlike a reactive observer, retries are disabled by default here (`retry: false`) unless +explicitly configured, since there is no component to catch a thrown error and retry through +re-render. -The accepted options are a subset of `useQuery`'s options: fields that only make sense for a -reactive observer (e.g. `enabled`, `refetchInterval`, `refetchOnWindowFocus`, `notifyOnChangeProps`, -`throwOnError`, `suspense`, `placeholderData`) are not part of this method's options. +The accepted options are `QueryObserverOptions` minus the fields that only make sense for a +reactive observer — `enabled`, `refetchInterval`, `refetchIntervalInBackground`, +`refetchOnWindowFocus`, `refetchOnReconnect`, `refetchOnMount`, `retryOnMount`, +`notifyOnChangeProps`, `throwOnError`, `suspense`, and `placeholderData` are not part of this +method's options. This method replaces the deprecated `fetchQuery`, and — combined with `{ staleTime: 'static' }` — the deprecated `ensureQueryData`. @@ -1022,7 +1033,7 @@ try { refetchQueries(filters?, options?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:490](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L490) +Defined in: [packages/query-core/src/queryClient.ts:497](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L497) Refetches queries matching the given filters, regardless of whether they are stale. Without filters, every query in the cache is refetched. Queries that are disabled, or static (only @@ -1067,7 +1078,7 @@ await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' }) removeQueries(filters?): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:369](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L369) +Defined in: [packages/query-core/src/queryClient.ts:376](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L376) Removes queries from the cache that match the given filters. Unlike [QueryClient#invalidateQueries](#invalidatequeries) or [QueryClient#refetchQueries](#refetchqueries), this removes @@ -1104,7 +1115,7 @@ queryClient.removeQueries({ queryKey: ['posts'], exact: true }) resetQueries(filters?, options?): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L390) +Defined in: [packages/query-core/src/queryClient.ts:397](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L397) Resets queries matching the given filters back to their initial state (e.g. any `initialData`), notifying subscribers rather than removing them. Active queries among the @@ -1144,7 +1155,7 @@ await queryClient.resetQueries({ queryKey: ['posts'], exact: true }) resumePausedMutations(): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:757](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L757) +Defined in: [packages/query-core/src/queryClient.ts:767](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L767) Resumes mutations that were paused because there was no network connection. Does nothing (resolving immediately) if the client is currently offline. @@ -1170,7 +1181,7 @@ await queryClient.resumePausedMutations() setDefaultOptions(options): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L829) +Defined in: [packages/query-core/src/queryClient.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L839) Dynamically sets the default options for this client, overwriting any previously defined default options. @@ -1210,7 +1221,7 @@ queryClient.setDefaultOptions({ setMutationDefaults(mutationKey, options): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L907) +Defined in: [packages/query-core/src/queryClient.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L917) Sets default options for mutations whose mutation key partially matches the given `mutationKey`. As with [QueryClient#setQueryDefaults](#setquerydefaults), the order of registration @@ -1269,7 +1280,7 @@ setQueriesData( options?): [readonly unknown[], TQueryFnData | undefined][]; ``` -Defined in: [packages/query-core/src/queryClient.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L312) +Defined in: [packages/query-core/src/queryClient.ts:319](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L319) Synchronous way to immediately update the cached data of multiple queries at once, using filters or partial query key matching. Only queries that already exist and match the given @@ -1323,7 +1334,7 @@ setQueryData( options?): NoInfer | undefined; ``` -Defined in: [packages/query-core/src/queryClient.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L264) +Defined in: [packages/query-core/src/queryClient.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L271) Synchronous way to immediately update a query's cached data. If the updater (or the value passed) resolves to `undefined`, the cache is left untouched and no query is created; @@ -1387,7 +1398,7 @@ queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost]) setQueryDefaults(queryKey, options): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L848) +Defined in: [packages/query-core/src/queryClient.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L858) Sets default options for queries whose query key partially matches the given `queryKey`. @@ -1444,7 +1455,7 @@ await queryClient.query({ queryKey: ['posts'] }) unmount(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L126) +Defined in: [packages/query-core/src/queryClient.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L127) The inverse of [QueryClient#mount](#mount) — called by a framework adapter's `QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online diff --git a/docs/framework/svelte/reference/functions/experimental_streamedQuery.md b/docs/framework/svelte/reference/functions/experimental_streamedQuery.md index afd44df7c5f..4c490322d60 100644 --- a/docs/framework/svelte/reference/functions/experimental_streamedQuery.md +++ b/docs/framework/svelte/reference/functions/experimental_streamedQuery.md @@ -4,10 +4,10 @@ title: experimental_streamedQuery --- ```ts -function experimental_streamedQuery(queryFn): QueryFunction; +function experimental_streamedQuery(streamFn): QueryFunction; ``` -Defined in: [packages/query-core/src/streamedQuery.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L60) +Defined in: [packages/query-core/src/streamedQuery.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L75) This is a helper function to create a query function that streams data from an AsyncIterable. Data will be an Array of all the chunks received. @@ -30,7 +30,7 @@ The query will stay in fetchStatus 'fetching' until the stream ends. ## Parameters -### queryFn +### streamFn `StreamedQueryParams`\<`TQueryFnData`, `TData`, `TQueryKey`\> diff --git a/docs/framework/svelte/reference/interfaces/CancelOptions.md b/docs/framework/svelte/reference/interfaces/CancelOptions.md index 2b9293712d2..14394c18533 100644 --- a/docs/framework/svelte/reference/interfaces/CancelOptions.md +++ b/docs/framework/svelte/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) +Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1466) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1444) +Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1467) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1445](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1445) +Defined in: [packages/query-core/src/types.ts:1468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1468) diff --git a/docs/framework/svelte/reference/interfaces/DefaultOptions.md b/docs/framework/svelte/reference/interfaces/DefaultOptions.md index 149ef5b3444..026116d11db 100644 --- a/docs/framework/svelte/reference/interfaces/DefaultOptions.md +++ b/docs/framework/svelte/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) +Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) ## Type Parameters @@ -19,7 +19,9 @@ Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/ optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) + +Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). *** @@ -29,7 +31,9 @@ Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/ optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) + +Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). #### deserializeData? @@ -63,7 +67,9 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) + +Default options applied to every mutation, unless overridden per-mutation. *** @@ -73,4 +79,6 @@ Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/ optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) + +Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/svelte/reference/interfaces/FetchNextPageOptions.md b/docs/framework/svelte/reference/interfaces/FetchNextPageOptions.md index fefe7f30c13..d12afe35fe1 100644 --- a/docs/framework/svelte/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/svelte/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L716) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) +Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/svelte/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/svelte/reference/interfaces/FetchPreviousPageOptions.md index ad3c3c736c9..93ca92088f1 100644 --- a/docs/framework/svelte/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/svelte/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) +Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult.md index 94347ea2e40..f1443c39625 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) +Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) +Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) +Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) +Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) +Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 3e0d3a79fa1..7c55201c028 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) +Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult.md index f6400f44b52..f9541ebd73b 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) +Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult.md index 53d910f545d..1bab3233ec9 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1009) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1013](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1013) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1027](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1027) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1017](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1017) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1016](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1016) +Defined in: [packages/query-core/src/types.ts:1029](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1029) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1021](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1021) +Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1023](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1023) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index 5949179bc6f..58310e1af49 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) +Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) +Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) +Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index e299e60ddc3..22ed760c153 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) +Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) +Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) +Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 7b550e0a90b..732c882f86f 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) +Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) +Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InvalidateOptions.md b/docs/framework/svelte/reference/interfaces/InvalidateOptions.md index 494afe1c465..1cd96c88165 100644 --- a/docs/framework/svelte/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/svelte/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L700) +Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L713) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/svelte/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/svelte/reference/interfaces/InvalidateQueryFilters.md index 4824d80d910..35fd04b9378 100644 --- a/docs/framework/svelte/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/svelte/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:690](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L690) +Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -100,7 +100,14 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:693](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L693) +Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) + +Controls which of the matched (now-invalidated) queries are refetched in the background. +Defaults to `'active'`. +- `'active'`: only queries with at least one active observer are refetched. +- `'inactive'`: only queries with no active observer are refetched. +- `'all'`: every matched query is refetched, active or not. +- `'none'`: no query is refetched; matched queries are only marked as invalidated. *** diff --git a/docs/framework/svelte/reference/interfaces/MutateOptions.md b/docs/framework/svelte/reference/interfaces/MutateOptions.md index a0af091a997..6e27e4e6d29 100644 --- a/docs/framework/svelte/reference/interfaces/MutateOptions.md +++ b/docs/framework/svelte/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1228) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1234) +Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1247) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1222](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1222) +Defined in: [packages/query-core/src/types.ts:1235](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1235) #### Parameters diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverBaseResult.md index 98810323966..190d4d4d3b6 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) +Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) +Defined in: [packages/query-core/src/types.ts:1289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1289) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1285) +Defined in: [packages/query-core/src/types.ts:1298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1298) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) +Defined in: [packages/query-core/src/types.ts:1303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1303) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1295) +Defined in: [packages/query-core/src/types.ts:1308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1308) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1300](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1300) +Defined in: [packages/query-core/src/types.ts:1313](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1313) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1305](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1305) +Defined in: [packages/query-core/src/types.ts:1318](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1318) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1314](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1314) +Defined in: [packages/query-core/src/types.ts:1327](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1327) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) +Defined in: [packages/query-core/src/types.ts:1293](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1293) The variables object passed to the `mutationFn`. diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverErrorResult.md index d61f244ced4..03af3a33d12 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1374](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1374) +Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1385](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1385) +Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1386](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1386) +Defined in: [packages/query-core/src/types.ts:1399](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1399) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1388](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1388) +Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1389](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1389) +Defined in: [packages/query-core/src/types.ts:1402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1402) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1390) +Defined in: [packages/query-core/src/types.ts:1403](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1403) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) +Defined in: [packages/query-core/src/types.ts:1404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1404) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) +Defined in: [packages/query-core/src/types.ts:1405](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1405) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) +Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) The variables object passed to the `mutationFn`. diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverIdleResult.md index 93655da0aa5..833db327a04 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1332](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1332) +Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) +Defined in: [packages/query-core/src/types.ts:1356](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1356) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) +Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1346](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1346) +Defined in: [packages/query-core/src/types.ts:1359](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1359) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1347) +Defined in: [packages/query-core/src/types.ts:1360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1360) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) +Defined in: [packages/query-core/src/types.ts:1361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1361) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1349) +Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1350](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1350) +Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) +Defined in: [packages/query-core/src/types.ts:1357](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1357) The variables object passed to the `mutationFn`. diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverLoadingResult.md index de146c45f5c..6732628f444 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) +Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1364](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1364) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) +Defined in: [packages/query-core/src/types.ts:1379](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1379) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1367](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1367) +Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) +Defined in: [packages/query-core/src/types.ts:1381](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1381) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1369](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1369) +Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1370](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1370) +Defined in: [packages/query-core/src/types.ts:1383](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1383) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1371](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1371) +Defined in: [packages/query-core/src/types.ts:1384](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1384) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1365) +Defined in: [packages/query-core/src/types.ts:1378](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1378) The variables object passed to the `mutationFn`. diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverOptions.md b/docs/framework/svelte/reference/interfaces/MutationObserverOptions.md index fe59cc7444d..be502d19332 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) +Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1220) ## Extends @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) #### Inherited from @@ -49,7 +49,7 @@ Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) #### Inherited from @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) #### Inherited from @@ -77,7 +77,7 @@ Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) +Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) #### Inherited from @@ -91,7 +91,7 @@ Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Inherited from @@ -105,7 +105,7 @@ Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Parameters @@ -141,7 +141,7 @@ Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) #### Parameters @@ -169,7 +169,7 @@ Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) #### Parameters @@ -209,7 +209,7 @@ Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) #### Parameters @@ -245,7 +245,7 @@ Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) #### Inherited from @@ -259,7 +259,7 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) #### Inherited from @@ -273,7 +273,7 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) +Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) #### Inherited from @@ -287,4 +287,4 @@ Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverSuccessResult.md index b50ec4ab6f1..89e8c2739cc 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) +Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1406](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1406) +Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1407) +Defined in: [packages/query-core/src/types.ts:1420](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1420) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1409) +Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1410](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1410) +Defined in: [packages/query-core/src/types.ts:1423](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1423) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) +Defined in: [packages/query-core/src/types.ts:1424](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1424) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) +Defined in: [packages/query-core/src/types.ts:1425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1425) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) +Defined in: [packages/query-core/src/types.ts:1426](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1426) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) +Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) The variables object passed to the `mutationFn`. diff --git a/docs/framework/svelte/reference/interfaces/MutationOptions.md b/docs/framework/svelte/reference/interfaces/MutationOptions.md index f641d241142..8721b62d099 100644 --- a/docs/framework/svelte/reference/interfaces/MutationOptions.md +++ b/docs/framework/svelte/reference/interfaces/MutationOptions.md @@ -3,7 +3,7 @@ id: MutationOptions title: MutationOptions --- -Defined in: [packages/query-core/src/types.ts:1166](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1166) +Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) ## Extended by @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1166](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) *** @@ -45,7 +45,7 @@ Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) *** @@ -55,7 +55,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) *** @@ -65,7 +65,7 @@ Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) +Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) *** @@ -75,7 +75,7 @@ Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) *** @@ -85,7 +85,7 @@ Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Parameters @@ -117,7 +117,7 @@ Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) #### Parameters @@ -141,7 +141,7 @@ Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) #### Parameters @@ -177,7 +177,7 @@ Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) #### Parameters @@ -209,7 +209,7 @@ Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) *** @@ -219,7 +219,7 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) *** @@ -229,4 +229,4 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) +Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) diff --git a/docs/framework/svelte/reference/interfaces/NotifyEvent.md b/docs/framework/svelte/reference/interfaces/NotifyEvent.md index 1dc93464df1..17b3241654f 100644 --- a/docs/framework/svelte/reference/interfaces/NotifyEvent.md +++ b/docs/framework/svelte/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1462) +Defined in: [packages/query-core/src/types.ts:1485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1485) diff --git a/docs/framework/svelte/reference/interfaces/QueryCacheConfig.md b/docs/framework/svelte/reference/interfaces/QueryCacheConfig.md index 69ea600366c..3c6aebe496f 100644 --- a/docs/framework/svelte/reference/interfaces/QueryCacheConfig.md +++ b/docs/framework/svelte/reference/interfaces/QueryCacheConfig.md @@ -3,11 +3,12 @@ id: QueryCacheConfig title: QueryCacheConfig --- -Defined in: [packages/query-core/src/queryCache.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L24) +Defined in: [packages/query-core/src/queryCache.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L25) Global callbacks that fire for every query handled by a `QueryCache`, regardless of which component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can -override, these callbacks are always called. +override, these callbacks are always called. Unlike `MutationCacheConfig`'s callbacks, these +are fire-and-forget: their return value is not awaited before the query settles. ## Properties @@ -17,7 +18,7 @@ override, these callbacks are always called. optional onError: (error, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L26) +Defined in: [packages/query-core/src/queryCache.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L27) Called when any query in the cache encounters an error. @@ -43,7 +44,7 @@ Called when any query in the cache encounters an error. optional onSettled: (data, error, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L33) +Defined in: [packages/query-core/src/queryCache.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L34) Called when any query in the cache is settled, either successfully or with an error. @@ -73,7 +74,7 @@ Called when any query in the cache is settled, either successfully or with an er optional onSuccess: (data, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L31) +Defined in: [packages/query-core/src/queryCache.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L32) Called when any query in the cache is successful. diff --git a/docs/framework/svelte/reference/interfaces/QueryClientConfig.md b/docs/framework/svelte/reference/interfaces/QueryClientConfig.md index 7c9bc255b35..b04dadba88c 100644 --- a/docs/framework/svelte/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/svelte/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [packages/query-core/src/types.ts:1427](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1427) +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) ## Properties @@ -13,7 +13,9 @@ Defined in: [packages/query-core/src/types.ts:1427](https://github.com/TanStack/ optional defaultOptions: DefaultOptions; ``` -Defined in: [packages/query-core/src/types.ts:1430](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1430) +Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) + +Default options for all queries and mutations created through this client. *** @@ -23,7 +25,10 @@ Defined in: [packages/query-core/src/types.ts:1430](https://github.com/TanStack/ optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) +Defined in: [packages/query-core/src/types.ts:1447](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1447) + +The mutation cache this client is connected to. A new `MutationCache` is created if not +provided. *** @@ -33,4 +38,6 @@ Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/ optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1428) +Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) + +The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverBaseResult.md index 2840be27e27..4689d9d661a 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) +Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L743) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) +Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) +Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) +Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) +Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult.md index 97d5d5125a7..86ae34b80ab 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) +Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverLoadingResult.md index 1f442f18130..a0024077883 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L873) +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) +Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) +Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:885](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L885) +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:884](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L884) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverPendingResult.md index ad040ff9cc5..21fab248a7c 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:862](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L862) +Defined in: [packages/query-core/src/types.ts:875](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L875) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) +Defined in: [packages/query-core/src/types.ts:876](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L876) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:864](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L864) +Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:866](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L866) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:865](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L865) +Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:869](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L869) +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) +Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:870](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L870) +Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverPlaceholderResult.md index 8a1ae61dee9..89af2502c11 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) +Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) +Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) +Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) +Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult.md index c8d5274697a..dab5586fdc1 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) +Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverSuccessResult.md index e3c834e6c3a..b180b89ca62 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) +Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/RefetchOptions.md b/docs/framework/svelte/reference/interfaces/RefetchOptions.md index a3db94b1674..b502dcd3492 100644 --- a/docs/framework/svelte/reference/interfaces/RefetchOptions.md +++ b/docs/framework/svelte/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L679) +Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L684) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,7 +38,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/svelte/reference/interfaces/RefetchQueryFilters.md b/docs/framework/svelte/reference/interfaces/RefetchQueryFilters.md index f2b6b287875..84f917c6201 100644 --- a/docs/framework/svelte/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/svelte/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:696](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L696) +Defined in: [packages/query-core/src/types.ts:709](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L709) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. diff --git a/docs/framework/svelte/reference/interfaces/ResetOptions.md b/docs/framework/svelte/reference/interfaces/ResetOptions.md index bfa931717f8..1855fef3064 100644 --- a/docs/framework/svelte/reference/interfaces/ResetOptions.md +++ b/docs/framework/svelte/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) +Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L714) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/svelte/reference/interfaces/ResultOptions.md b/docs/framework/svelte/reference/interfaces/ResultOptions.md index dbf00d6c67e..9766c56d1a6 100644 --- a/docs/framework/svelte/reference/interfaces/ResultOptions.md +++ b/docs/framework/svelte/reference/interfaces/ResultOptions.md @@ -19,4 +19,8 @@ Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. diff --git a/docs/framework/svelte/reference/interfaces/SetDataOptions.md b/docs/framework/svelte/reference/interfaces/SetDataOptions.md index 5fcbcfdf7cd..4262e781b05 100644 --- a/docs/framework/svelte/reference/interfaces/SetDataOptions.md +++ b/docs/framework/svelte/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1448) +Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1471) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) +Defined in: [packages/query-core/src/types.ts:1472](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1472) diff --git a/docs/framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index ced8e568299..d82cfa37d51 100644 --- a/docs/framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/svelte/reference/type-aliases/DefinedQueryObserverResult.md index 7afdbfd38bc..97fcae175a9 100644 --- a/docs/framework/svelte/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/svelte/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/FetchStatus.md b/docs/framework/svelte/reference/type-aliases/FetchStatus.md index 4dae9444af6..7b71e54eacd 100644 --- a/docs/framework/svelte/reference/type-aliases/FetchStatus.md +++ b/docs/framework/svelte/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) diff --git a/docs/framework/svelte/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/svelte/reference/type-aliases/InfiniteQueryObserverResult.md index 95fda780d1d..7a646bc1c38 100644 --- a/docs/framework/svelte/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/svelte/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/MutateFunction.md b/docs/framework/svelte/reference/type-aliases/MutateFunction.md index f574ca7f8ca..284bd0fc270 100644 --- a/docs/framework/svelte/reference/type-aliases/MutateFunction.md +++ b/docs/framework/svelte/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1258) +Defined in: [packages/query-core/src/types.ts:1271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1271) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/MutateFunctionRest.md b/docs/framework/svelte/reference/type-aliases/MutateFunctionRest.md index aef21572aeb..a2f16ea5302 100644 --- a/docs/framework/svelte/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/svelte/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1243](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1243) +Defined in: [packages/query-core/src/types.ts:1256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1256) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/MutationFunction.md b/docs/framework/svelte/reference/type-aliases/MutationFunction.md index e306a5f1a48..4c8c7aed384 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationFunction.md +++ b/docs/framework/svelte/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1161](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1161) +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/MutationFunctionContext.md b/docs/framework/svelte/reference/type-aliases/MutationFunctionContext.md index b29a54df298..ef228cc53d3 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/svelte/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) +Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) +Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1169) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) +Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1170) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1158](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1158) +Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) diff --git a/docs/framework/svelte/reference/type-aliases/MutationKey.md b/docs/framework/svelte/reference/type-aliases/MutationKey.md index f89c6959883..7157d6052fd 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationKey.md +++ b/docs/framework/svelte/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) diff --git a/docs/framework/svelte/reference/type-aliases/MutationMeta.md b/docs/framework/svelte/reference/type-aliases/MutationMeta.md index e1d481cdcf1..f3bf9984fab 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationMeta.md +++ b/docs/framework/svelte/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1147](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1147) +Defined in: [packages/query-core/src/types.ts:1160](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1160) diff --git a/docs/framework/svelte/reference/type-aliases/MutationObserverResult.md b/docs/framework/svelte/reference/type-aliases/MutationObserverResult.md index cbd07f40537..3390192e071 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/svelte/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) +Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/MutationScope.md b/docs/framework/svelte/reference/type-aliases/MutationScope.md index 6ec14643477..a2511c903d9 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationScope.md +++ b/docs/framework/svelte/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) +Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) +Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) diff --git a/docs/framework/svelte/reference/type-aliases/MutationStatus.md b/docs/framework/svelte/reference/type-aliases/MutationStatus.md index eedf0fb979a..d9b58cdd26f 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationStatus.md +++ b/docs/framework/svelte/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) +Defined in: [packages/query-core/src/types.ts:1154](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1154) diff --git a/docs/framework/svelte/reference/type-aliases/NotifyEventType.md b/docs/framework/svelte/reference/type-aliases/NotifyEventType.md index 7b788ced7af..94912df6c6b 100644 --- a/docs/framework/svelte/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/svelte/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) diff --git a/docs/framework/svelte/reference/type-aliases/QueryCacheNotifyEvent.md b/docs/framework/svelte/reference/type-aliases/QueryCacheNotifyEvent.md index 8e52da9e279..b92c76fb826 100644 --- a/docs/framework/svelte/reference/type-aliases/QueryCacheNotifyEvent.md +++ b/docs/framework/svelte/reference/type-aliases/QueryCacheNotifyEvent.md @@ -14,7 +14,7 @@ type QueryCacheNotifyEvent = | NotifyEventQueryObserverOptionsUpdated; ``` -Defined in: [packages/query-core/src/queryCache.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L84) +Defined in: [packages/query-core/src/queryCache.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L85) The event passed to a `QueryCache` subscriber. Fired whenever a query is added or removed from the cache, its state is updated (e.g. via `query.setState` or `queryClient.removeQueries`), or diff --git a/docs/framework/svelte/reference/type-aliases/QueryObserverResult.md b/docs/framework/svelte/reference/type-aliases/QueryObserverResult.md index f6c4118a978..f5c6c95d5f2 100644 --- a/docs/framework/svelte/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/svelte/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) +Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/QueryStatus.md b/docs/framework/svelte/reference/type-aliases/QueryStatus.md index ed6059e03ec..3fc872e604b 100644 --- a/docs/framework/svelte/reference/type-aliases/QueryStatus.md +++ b/docs/framework/svelte/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) +Defined in: [packages/query-core/src/types.ts:740](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L740) diff --git a/docs/framework/svelte/reference/type-aliases/TimeoutProvider.md b/docs/framework/svelte/reference/type-aliases/TimeoutProvider.md index 6416fe4c557..3509105bcd1 100644 --- a/docs/framework/svelte/reference/type-aliases/TimeoutProvider.md +++ b/docs/framework/svelte/reference/type-aliases/TimeoutProvider.md @@ -7,10 +7,16 @@ title: TimeoutProvider type TimeoutProvider = object; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:22](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L22) +Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) Backend for timer functions. +Timers are performance-sensitive: short-lived timers (delays under a few seconds) tend to be +latency-sensitive, while long-lived ones may benefit more from coalescing — batching timers +with similar deadlines together — which the default provider (backed by the platform's global +`setTimeout`/`setInterval`) does not do. A custom provider can implement coalescing, and can +also support delays longer than the ~24-day maximum of the global `setTimeout`. + ## Type Parameters ### TTimerId @@ -25,7 +31,7 @@ Backend for timer functions. readonly clearInterval: (intervalId) => void; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) +Defined in: [packages/query-core/src/timeoutManager.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L34) #### Parameters @@ -45,7 +51,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/Ta readonly clearTimeout: (timeoutId) => void; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L25) +Defined in: [packages/query-core/src/timeoutManager.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L31) #### Parameters @@ -65,7 +71,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/Ta readonly setInterval: (callback, delay) => TTimerId; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L27) +Defined in: [packages/query-core/src/timeoutManager.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L33) #### Parameters @@ -89,7 +95,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/Ta readonly setTimeout: (callback, delay) => TTimerId; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L24) +Defined in: [packages/query-core/src/timeoutManager.ts:30](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L30) #### Parameters diff --git a/docs/framework/svelte/reference/variables/environmentManager.md b/docs/framework/svelte/reference/variables/environmentManager.md index caa1d70b2b6..e207cfd2484 100644 --- a/docs/framework/svelte/reference/variables/environmentManager.md +++ b/docs/framework/svelte/reference/variables/environmentManager.md @@ -7,9 +7,13 @@ title: environmentManager const environmentManager: object; ``` -Defined in: [packages/query-core/src/environmentManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L15) +Defined in: [packages/query-core/src/environmentManager.ts:29](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L29) -Manages environment detection used by TanStack Query internals. +Manages how TanStack Query detects whether the current runtime should be treated as +server-side. By default, this uses the same detection as the exported `isServer` utility. + +Override this for runtimes that are not traditional browser/server environments (e.g. +extension workers), where the default detection would give the wrong answer. ## Type Declaration @@ -42,3 +46,14 @@ Overrides the server check globally. #### Returns `void` + +## Example + +```ts +import { environmentManager, isServer } from '@tanstack/query-core' + +environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis)) + +// Restore the default behavior: +environmentManager.setIsServer(() => isServer) +``` diff --git a/docs/framework/svelte/reference/variables/notifyManager.md b/docs/framework/svelte/reference/variables/notifyManager.md index e5ecca8df60..4bdf3478be0 100644 --- a/docs/framework/svelte/reference/variables/notifyManager.md +++ b/docs/framework/svelte/reference/variables/notifyManager.md @@ -7,7 +7,7 @@ title: notifyManager const notifyManager: object; ``` -Defined in: [packages/query-core/src/notifyManager.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L135) +Defined in: [packages/query-core/src/notifyManager.ts:144](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L144) Handles scheduling and batching callbacks in TanStack Query. @@ -90,7 +90,8 @@ readonly setBatchNotifyFunction: (fn) => void; ``` Use this method to set a custom function to batch notifications together into a single tick. -By default React Query will use the batch function provided by ReactDOM or React Native. +Framework adapters use this to plug in their own batching primitive, so that a single query +update only triggers one re-render instead of one per subscriber. #### Parameters @@ -102,6 +103,15 @@ By default React Query will use the batch function provided by ReactDOM or React `void` +#### Example + +```ts +import { notifyManager } from '@tanstack/query-core' +import { batch } from 'solid-js' + +notifyManager.setBatchNotifyFunction(batch) +``` + ### setNotifyFunction() ```ts diff --git a/docs/framework/svelte/reference/variables/timeoutManager.md b/docs/framework/svelte/reference/variables/timeoutManager.md index 2dcfa29b55a..ef9cca969e9 100644 --- a/docs/framework/svelte/reference/variables/timeoutManager.md +++ b/docs/framework/svelte/reference/variables/timeoutManager.md @@ -7,6 +7,6 @@ title: timeoutManager const timeoutManager: TimeoutManager; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:226](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L226) +Defined in: [packages/query-core/src/timeoutManager.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L232) Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/vue/reference/classes/Mutation.md b/docs/framework/vue/reference/classes/Mutation.md index 4e85a5b2d4c..e038a9cd394 100644 --- a/docs/framework/vue/reference/classes/Mutation.md +++ b/docs/framework/vue/reference/classes/Mutation.md @@ -219,7 +219,7 @@ Removable.destroy execute(variables): Promise; ``` -Defined in: [packages/query-core/src/mutation.ts:283](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L283) +Defined in: [packages/query-core/src/mutation.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L284) Runs the mutation function for the given variables through a retryer, and drives the mutation's state and lifecycle callbacks through to settlement. @@ -254,7 +254,8 @@ the original error is re-thrown. #### Example ```ts -// typically invoked by MutationObserver.mutate, not called directly +// Called internally by `MutationObserver.mutate` and `Mutation.continue` — +// applications normally trigger mutations through those, not this method. const data = await mutation.execute(variables) ``` diff --git a/docs/framework/vue/reference/classes/MutationCache.md b/docs/framework/vue/reference/classes/MutationCache.md index 838d911dbbd..e7ad90f7368 100644 --- a/docs/framework/vue/reference/classes/MutationCache.md +++ b/docs/framework/vue/reference/classes/MutationCache.md @@ -21,7 +21,7 @@ MaybeRefDeep filters object, so `ref`s can be passed directly without unwrapping new MutationCache(config): MutationCache; ``` -Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) +Defined in: [packages/query-core/src/mutationCache.ts:129](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L129) #### Parameters @@ -47,7 +47,7 @@ MC.constructor config: MutationCacheConfig = {}; ``` -Defined in: [packages/query-core/src/mutationCache.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L122) +Defined in: [packages/query-core/src/mutationCache.ts:129](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L129) #### Inherited from @@ -79,7 +79,7 @@ MC.listeners clear(): void; ``` -Defined in: [packages/query-core/src/mutationCache.ts:229](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L229) +Defined in: [packages/query-core/src/mutationCache.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L236) Removes all mutations from the cache. @@ -218,7 +218,7 @@ MC.findAll getAll(): Mutation[]; ``` -Defined in: [packages/query-core/src/mutationCache.ts:252](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L252) +Defined in: [packages/query-core/src/mutationCache.ts:259](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L259) Returns all mutations within the cache. diff --git a/docs/framework/vue/reference/classes/QueryCache.md b/docs/framework/vue/reference/classes/QueryCache.md index 6b97f2c0c50..f67625fe8af 100644 --- a/docs/framework/vue/reference/classes/QueryCache.md +++ b/docs/framework/vue/reference/classes/QueryCache.md @@ -21,7 +21,7 @@ MaybeRefDeep filters object, so `ref`s can be passed directly without unwrapping new QueryCache(config): QueryCache; ``` -Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) +Defined in: [packages/query-core/src/queryCache.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L126) #### Parameters @@ -47,7 +47,7 @@ QC.constructor config: QueryCacheConfig = {}; ``` -Defined in: [packages/query-core/src/queryCache.ts:116](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L116) +Defined in: [packages/query-core/src/queryCache.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L126) #### Inherited from @@ -82,7 +82,7 @@ build( state?): Query; ``` -Defined in: [packages/query-core/src/queryCache.ts:137](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L137) +Defined in: [packages/query-core/src/queryCache.ts:147](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L147) Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or builds and adds a new one to the cache if none exists yet. Used by framework adapters and @@ -150,7 +150,7 @@ QC.build clear(): void; ``` -Defined in: [packages/query-core/src/queryCache.ts:222](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L222) +Defined in: [packages/query-core/src/queryCache.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L232) Removes all queries from the cache. @@ -290,7 +290,7 @@ get(queryHash): | undefined; ``` -Defined in: [packages/query-core/src/queryCache.ts:244](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L244) +Defined in: [packages/query-core/src/queryCache.ts:254](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L254) Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none exists. Unlike [QueryCache#find](#find), this looks up by the already-computed hash rather @@ -349,7 +349,7 @@ QC.get getAll(): Query[]; ``` -Defined in: [packages/query-core/src/queryCache.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L267) +Defined in: [packages/query-core/src/queryCache.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L277) Returns all queries within the cache. @@ -439,7 +439,7 @@ QC.onUnsubscribe remove(query): void; ``` -Defined in: [packages/query-core/src/queryCache.ts:198](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L198) +Defined in: [packages/query-core/src/queryCache.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L208) Destroys the given `Query` and removes it from the cache, notifying subscribers with a `'removed'` event. A no-op if the query is no longer the one currently stored under its hash diff --git a/docs/framework/vue/reference/classes/QueryClient.md b/docs/framework/vue/reference/classes/QueryClient.md index ebc209a89b4..810249f0ef6 100644 --- a/docs/framework/vue/reference/classes/QueryClient.md +++ b/docs/framework/vue/reference/classes/QueryClient.md @@ -111,7 +111,7 @@ QC.cancelQueries clear(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1073) +Defined in: [packages/query-core/src/queryClient.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1083) Clears both the query cache and the mutation cache this client is connected to. @@ -142,7 +142,7 @@ QC.clear defaultMutationOptions(options?): T; ``` -Defined in: [packages/query-core/src/queryClient.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1047) +Defined in: [packages/query-core/src/queryClient.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1057) The mutation counterpart of [QueryClient#defaultQueryOptions](#defaultqueryoptions). Called by framework adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the @@ -179,7 +179,7 @@ QC.defaultMutationOptions defaultQueryOptions(options): DefaultedQueryObserverOptions; ``` -Defined in: [packages/query-core/src/queryClient.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L960) +Defined in: [packages/query-core/src/queryClient.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L970) Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the @@ -236,7 +236,7 @@ QC.defaultQueryOptions ensureInfiniteQueryData(options): Promise>; ``` -Defined in: [packages/query-core/src/queryClient.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L725) +Defined in: [packages/query-core/src/queryClient.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L735) #### Type Parameters @@ -592,7 +592,7 @@ QC.fetchQuery getDefaultOptions(): DefaultOptions; ``` -Defined in: [packages/query-core/src/queryClient.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L808) +Defined in: [packages/query-core/src/queryClient.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L818) Returns the default options that were set when creating the client, or via [QueryClient#setDefaultOptions](#setdefaultoptions). @@ -624,7 +624,7 @@ QC.getDefaultOptions getMutationCache(): MutationCache; ``` -Defined in: [packages/query-core/src/queryClient.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L792) +Defined in: [packages/query-core/src/queryClient.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L802) Returns the mutation cache this client is connected to. @@ -698,6 +698,12 @@ Imperative (non-reactive) way to retrieve the cached data of multiple queries at Only queries matching the given filters are returned; if none match, an empty array is returned. +Because the matched queries can hold data of different shapes (e.g. a broad filter can match +queries with unrelated data types), the `TQueryFnData` generic defaults to `unknown` rather +than being inferred. Passing a more specific type is a convenience for call sites that know +every matched query holds the same shape — it is not checked against the actual cache +contents. + #### Type Parameters ##### TData @@ -738,7 +744,7 @@ QC.getQueriesData getQueryCache(): QueryCache; ``` -Defined in: [packages/query-core/src/queryClient.ts:776](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L776) +Defined in: [packages/query-core/src/queryClient.ts:786](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L786) Returns the query cache this client is connected to. @@ -1177,7 +1183,7 @@ QC.isMutating mount(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L103) +Defined in: [packages/query-core/src/queryClient.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L104) Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start listening for focus/online events and resume paused mutations. Ref-counted via an internal @@ -1414,12 +1420,15 @@ If the query already exists in the cache and its data is not stale (per the give and the promise resolves once the fetch settles. If a `select` function is provided, it is applied to the data in both cases (cached or freshly fetched) before it is returned. -Unlike `useQuery`, retries are disabled by default here (`retry: false`) unless explicitly -configured, since there is no component to catch a thrown error and retry through re-render. +Unlike a reactive observer, retries are disabled by default here (`retry: false`) unless +explicitly configured, since there is no component to catch a thrown error and retry through +re-render. -The accepted options are a subset of `useQuery`'s options: fields that only make sense for a -reactive observer (e.g. `enabled`, `refetchInterval`, `refetchOnWindowFocus`, `notifyOnChangeProps`, -`throwOnError`, `suspense`, `placeholderData`) are not part of this method's options. +The accepted options are `QueryObserverOptions` minus the fields that only make sense for a +reactive observer — `enabled`, `refetchInterval`, `refetchIntervalInBackground`, +`refetchOnWindowFocus`, `refetchOnReconnect`, `refetchOnMount`, `retryOnMount`, +`notifyOnChangeProps`, `throwOnError`, `suspense`, and `placeholderData` are not part of this +method's options. This method replaces the deprecated `fetchQuery`, and — combined with `{ staleTime: 'static' }` — the deprecated `ensureQueryData`. @@ -1674,7 +1683,7 @@ QC.resetQueries resumePausedMutations(): Promise; ``` -Defined in: [packages/query-core/src/queryClient.ts:757](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L757) +Defined in: [packages/query-core/src/queryClient.ts:767](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L767) Resumes mutations that were paused because there was no network connection. Does nothing (resolving immediately) if the client is currently offline. @@ -2053,7 +2062,7 @@ QC.setQueryDefaults unmount(): void; ``` -Defined in: [packages/query-core/src/queryClient.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L126) +Defined in: [packages/query-core/src/queryClient.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L127) The inverse of [QueryClient#mount](#mount) — called by a framework adapter's `QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online diff --git a/docs/framework/vue/reference/functions/experimental_streamedQuery.md b/docs/framework/vue/reference/functions/experimental_streamedQuery.md index afd44df7c5f..4c490322d60 100644 --- a/docs/framework/vue/reference/functions/experimental_streamedQuery.md +++ b/docs/framework/vue/reference/functions/experimental_streamedQuery.md @@ -4,10 +4,10 @@ title: experimental_streamedQuery --- ```ts -function experimental_streamedQuery(queryFn): QueryFunction; +function experimental_streamedQuery(streamFn): QueryFunction; ``` -Defined in: [packages/query-core/src/streamedQuery.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L60) +Defined in: [packages/query-core/src/streamedQuery.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L75) This is a helper function to create a query function that streams data from an AsyncIterable. Data will be an Array of all the chunks received. @@ -30,7 +30,7 @@ The query will stay in fetchStatus 'fetching' until the stream ends. ## Parameters -### queryFn +### streamFn `StreamedQueryParams`\<`TQueryFnData`, `TData`, `TQueryKey`\> diff --git a/docs/framework/vue/reference/interfaces/CancelOptions.md b/docs/framework/vue/reference/interfaces/CancelOptions.md index 2b9293712d2..14394c18533 100644 --- a/docs/framework/vue/reference/interfaces/CancelOptions.md +++ b/docs/framework/vue/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) +Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1466) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1444) +Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1467) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1444](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1445](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1445) +Defined in: [packages/query-core/src/types.ts:1468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1468) diff --git a/docs/framework/vue/reference/interfaces/DefaultOptions.md b/docs/framework/vue/reference/interfaces/DefaultOptions.md index 149ef5b3444..026116d11db 100644 --- a/docs/framework/vue/reference/interfaces/DefaultOptions.md +++ b/docs/framework/vue/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) +Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) ## Type Parameters @@ -19,7 +19,9 @@ Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/ optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) + +Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). *** @@ -29,7 +31,9 @@ Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/ optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) + +Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). #### deserializeData? @@ -63,7 +67,9 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) + +Default options applied to every mutation, unless overridden per-mutation. *** @@ -73,4 +79,6 @@ Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/ optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) + +Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/vue/reference/interfaces/FetchNextPageOptions.md b/docs/framework/vue/reference/interfaces/FetchNextPageOptions.md index fefe7f30c13..d12afe35fe1 100644 --- a/docs/framework/vue/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/vue/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L716) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) +Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/vue/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/vue/reference/interfaces/FetchPreviousPageOptions.md index ad3c3c736c9..93ca92088f1 100644 --- a/docs/framework/vue/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/vue/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) +Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult.md index 94347ea2e40..f1443c39625 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) +Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) +Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) +Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) +Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) +Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 3e0d3a79fa1..7c55201c028 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) +Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult.md index f6400f44b52..f9541ebd73b 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) +Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult.md index 53d910f545d..1bab3233ec9 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1009) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1009](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1013](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1013) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1027](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1027) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1017](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1017) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1016](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1016) +Defined in: [packages/query-core/src/types.ts:1029](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1029) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1021](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1021) +Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1023](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1023) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index 5949179bc6f..58310e1af49 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) +Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) +Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) +Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index e299e60ddc3..22ed760c153 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) +Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) +Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) +Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1002](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1002) +Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 7b550e0a90b..732c882f86f 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:986](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L986) +Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:990](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L990) +Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) +Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1006](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1006) +Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) +Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InvalidateOptions.md b/docs/framework/vue/reference/interfaces/InvalidateOptions.md index 494afe1c465..1cd96c88165 100644 --- a/docs/framework/vue/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/vue/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L700) +Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L713) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:700](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/vue/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/vue/reference/interfaces/InvalidateQueryFilters.md index 63720ea4ef3..8bb1a830e94 100644 --- a/docs/framework/vue/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/vue/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:690](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L690) +Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) ## Extends @@ -105,7 +105,14 @@ QueryFilters.queryKey optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:693](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L693) +Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) + +Controls which of the matched (now-invalidated) queries are refetched in the background. +Defaults to `'active'`. +- `'active'`: only queries with at least one active observer are refetched. +- `'inactive'`: only queries with no active observer are refetched. +- `'all'`: every matched query is refetched, active or not. +- `'none'`: no query is refetched; matched queries are only marked as invalidated. *** diff --git a/docs/framework/vue/reference/interfaces/MutateOptions.md b/docs/framework/vue/reference/interfaces/MutateOptions.md index a0af091a997..6e27e4e6d29 100644 --- a/docs/framework/vue/reference/interfaces/MutateOptions.md +++ b/docs/framework/vue/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1228) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1228](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1234) +Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1247) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1234](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1222](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1222) +Defined in: [packages/query-core/src/types.ts:1235](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1235) #### Parameters diff --git a/docs/framework/vue/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/vue/reference/interfaces/MutationObserverBaseResult.md index 98810323966..190d4d4d3b6 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) +Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) +Defined in: [packages/query-core/src/types.ts:1289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1289) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1285) +Defined in: [packages/query-core/src/types.ts:1298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1298) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) +Defined in: [packages/query-core/src/types.ts:1303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1303) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1295) +Defined in: [packages/query-core/src/types.ts:1308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1308) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1300](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1300) +Defined in: [packages/query-core/src/types.ts:1313](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1313) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1305](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1305) +Defined in: [packages/query-core/src/types.ts:1318](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1318) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1314](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1314) +Defined in: [packages/query-core/src/types.ts:1327](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1327) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) +Defined in: [packages/query-core/src/types.ts:1293](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1293) The variables object passed to the `mutationFn`. diff --git a/docs/framework/vue/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/vue/reference/interfaces/MutationObserverErrorResult.md index d61f244ced4..03af3a33d12 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1374](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1374) +Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1385](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1385) +Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1386](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1386) +Defined in: [packages/query-core/src/types.ts:1399](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1399) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1388](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1388) +Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1389](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1389) +Defined in: [packages/query-core/src/types.ts:1402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1402) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1390) +Defined in: [packages/query-core/src/types.ts:1403](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1403) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) +Defined in: [packages/query-core/src/types.ts:1404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1404) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) +Defined in: [packages/query-core/src/types.ts:1405](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1405) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) +Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) The variables object passed to the `mutationFn`. diff --git a/docs/framework/vue/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/vue/reference/interfaces/MutationObserverIdleResult.md index 93655da0aa5..833db327a04 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1332](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1332) +Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) +Defined in: [packages/query-core/src/types.ts:1356](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1356) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) +Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1346](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1346) +Defined in: [packages/query-core/src/types.ts:1359](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1359) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1347) +Defined in: [packages/query-core/src/types.ts:1360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1360) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) +Defined in: [packages/query-core/src/types.ts:1361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1361) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1349) +Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1350](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1350) +Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) +Defined in: [packages/query-core/src/types.ts:1357](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1357) The variables object passed to the `mutationFn`. diff --git a/docs/framework/vue/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/vue/reference/interfaces/MutationObserverLoadingResult.md index de146c45f5c..6732628f444 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) +Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1364](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1364) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) +Defined in: [packages/query-core/src/types.ts:1379](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1379) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1367](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1367) +Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) +Defined in: [packages/query-core/src/types.ts:1381](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1381) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1369](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1369) +Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1370](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1370) +Defined in: [packages/query-core/src/types.ts:1383](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1383) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1371](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1371) +Defined in: [packages/query-core/src/types.ts:1384](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1384) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1365) +Defined in: [packages/query-core/src/types.ts:1378](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1378) The variables object passed to the `mutationFn`. diff --git a/docs/framework/vue/reference/interfaces/MutationObserverOptions.md b/docs/framework/vue/reference/interfaces/MutationObserverOptions.md index f1f16d6931b..6723cfd8f25 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) +Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1220) ## Extends @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) +Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) #### Inherited from @@ -51,7 +51,7 @@ MutationOptions.gcTime optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) #### Inherited from @@ -67,7 +67,7 @@ MutationOptions.meta optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1172) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) #### Inherited from @@ -83,7 +83,7 @@ MutationOptions.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1173) +Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) #### Inherited from @@ -99,7 +99,7 @@ MutationOptions.mutationKey optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1199](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1199) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Inherited from @@ -115,7 +115,7 @@ MutationOptions.networkMode optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1184](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1184) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Parameters @@ -153,7 +153,7 @@ MutationOptions.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) #### Parameters @@ -183,7 +183,7 @@ MutationOptions.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) #### Parameters @@ -225,7 +225,7 @@ MutationOptions.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) #### Parameters @@ -263,7 +263,7 @@ MutationOptions.onSuccess optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) #### Inherited from @@ -279,7 +279,7 @@ MutationOptions.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) #### Inherited from @@ -295,7 +295,7 @@ MutationOptions.retryDelay optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1204](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1204) +Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) #### Inherited from @@ -311,4 +311,4 @@ MutationOptions.scope optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) diff --git a/docs/framework/vue/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/vue/reference/interfaces/MutationObserverSuccessResult.md index b50ec4ab6f1..89e8c2739cc 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) +Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1406](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1406) +Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1407) +Defined in: [packages/query-core/src/types.ts:1420](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1420) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1409) +Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1410](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1410) +Defined in: [packages/query-core/src/types.ts:1423](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1423) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) +Defined in: [packages/query-core/src/types.ts:1424](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1424) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) +Defined in: [packages/query-core/src/types.ts:1425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1425) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1325) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1329](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1329) +Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) +Defined in: [packages/query-core/src/types.ts:1426](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1426) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) +Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) The variables object passed to the `mutationFn`. diff --git a/docs/framework/vue/reference/interfaces/NotifyEvent.md b/docs/framework/vue/reference/interfaces/NotifyEvent.md index 1dc93464df1..17b3241654f 100644 --- a/docs/framework/vue/reference/interfaces/NotifyEvent.md +++ b/docs/framework/vue/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1462) +Defined in: [packages/query-core/src/types.ts:1485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1485) diff --git a/docs/framework/vue/reference/interfaces/QueryCacheConfig.md b/docs/framework/vue/reference/interfaces/QueryCacheConfig.md index 69ea600366c..3c6aebe496f 100644 --- a/docs/framework/vue/reference/interfaces/QueryCacheConfig.md +++ b/docs/framework/vue/reference/interfaces/QueryCacheConfig.md @@ -3,11 +3,12 @@ id: QueryCacheConfig title: QueryCacheConfig --- -Defined in: [packages/query-core/src/queryCache.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L24) +Defined in: [packages/query-core/src/queryCache.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L25) Global callbacks that fire for every query handled by a `QueryCache`, regardless of which component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can -override, these callbacks are always called. +override, these callbacks are always called. Unlike `MutationCacheConfig`'s callbacks, these +are fire-and-forget: their return value is not awaited before the query settles. ## Properties @@ -17,7 +18,7 @@ override, these callbacks are always called. optional onError: (error, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L26) +Defined in: [packages/query-core/src/queryCache.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L27) Called when any query in the cache encounters an error. @@ -43,7 +44,7 @@ Called when any query in the cache encounters an error. optional onSettled: (data, error, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L33) +Defined in: [packages/query-core/src/queryCache.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L34) Called when any query in the cache is settled, either successfully or with an error. @@ -73,7 +74,7 @@ Called when any query in the cache is settled, either successfully or with an er optional onSuccess: (data, query) => void; ``` -Defined in: [packages/query-core/src/queryCache.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L31) +Defined in: [packages/query-core/src/queryCache.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L32) Called when any query in the cache is successful. diff --git a/docs/framework/vue/reference/interfaces/QueryClientConfig.md b/docs/framework/vue/reference/interfaces/QueryClientConfig.md index 7c9bc255b35..b04dadba88c 100644 --- a/docs/framework/vue/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/vue/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [packages/query-core/src/types.ts:1427](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1427) +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) ## Properties @@ -13,7 +13,9 @@ Defined in: [packages/query-core/src/types.ts:1427](https://github.com/TanStack/ optional defaultOptions: DefaultOptions; ``` -Defined in: [packages/query-core/src/types.ts:1430](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1430) +Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) + +Default options for all queries and mutations created through this client. *** @@ -23,7 +25,10 @@ Defined in: [packages/query-core/src/types.ts:1430](https://github.com/TanStack/ optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) +Defined in: [packages/query-core/src/types.ts:1447](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1447) + +The mutation cache this client is connected to. A new `MutationCache` is created if not +provided. *** @@ -33,4 +38,6 @@ Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/ optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1428) +Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) + +The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/vue/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/vue/reference/interfaces/QueryObserverBaseResult.md index 2840be27e27..4689d9d661a 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) +Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L743) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) +Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:793](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L793) +Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:811](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L811) +Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:829](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L829) +Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:847](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L847) +Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/vue/reference/interfaces/QueryObserverLoadingErrorResult.md index 97d5d5125a7..86ae34b80ab 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) +Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/vue/reference/interfaces/QueryObserverLoadingResult.md index 1f442f18130..a0024077883 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L873) +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:873](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) +Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) +Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:885](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L885) +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:884](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L884) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/vue/reference/interfaces/QueryObserverPendingResult.md index ad040ff9cc5..21fab248a7c 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:862](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L862) +Defined in: [packages/query-core/src/types.ts:875](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L875) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) +Defined in: [packages/query-core/src/types.ts:876](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L876) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:864](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L864) +Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:866](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L866) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:865](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L865) +Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:869](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L869) +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) +Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:870](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L870) +Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/vue/reference/interfaces/QueryObserverPlaceholderResult.md index 8a1ae61dee9..89af2502c11 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) +Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) +Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) +Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) +Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/vue/reference/interfaces/QueryObserverRefetchErrorResult.md index c8d5274697a..dab5586fdc1 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) +Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/vue/reference/interfaces/QueryObserverSuccessResult.md index e3c834e6c3a..b180b89ca62 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:756](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L756) +Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:855](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L855) +Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) +Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:779](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L779) +Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) +Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:807](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L807) +Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/RefetchOptions.md b/docs/framework/vue/reference/interfaces/RefetchOptions.md index a3db94b1674..b502dcd3492 100644 --- a/docs/framework/vue/reference/interfaces/RefetchOptions.md +++ b/docs/framework/vue/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L679) +Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L684) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:679](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,7 +38,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/vue/reference/interfaces/RefetchQueryFilters.md b/docs/framework/vue/reference/interfaces/RefetchQueryFilters.md index 05896110edc..57abef774c4 100644 --- a/docs/framework/vue/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/vue/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:696](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L696) +Defined in: [packages/query-core/src/types.ts:709](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L709) ## Extends diff --git a/docs/framework/vue/reference/interfaces/ResetOptions.md b/docs/framework/vue/reference/interfaces/ResetOptions.md index bfa931717f8..1855fef3064 100644 --- a/docs/framework/vue/reference/interfaces/ResetOptions.md +++ b/docs/framework/vue/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) +Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L714) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:687](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L687) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,11 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. #### Inherited from diff --git a/docs/framework/vue/reference/interfaces/ResultOptions.md b/docs/framework/vue/reference/interfaces/ResultOptions.md index dbf00d6c67e..9766c56d1a6 100644 --- a/docs/framework/vue/reference/interfaces/ResultOptions.md +++ b/docs/framework/vue/reference/interfaces/ResultOptions.md @@ -19,4 +19,8 @@ Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:676](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L676) +Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) + +If set to `true`, the method throws if any of the underlying query refetch tasks fail. +Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the +caller. diff --git a/docs/framework/vue/reference/interfaces/SetDataOptions.md b/docs/framework/vue/reference/interfaces/SetDataOptions.md index 5fcbcfdf7cd..4262e781b05 100644 --- a/docs/framework/vue/reference/interfaces/SetDataOptions.md +++ b/docs/framework/vue/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1448) +Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1471) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1448](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) +Defined in: [packages/query-core/src/types.ts:1472](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1472) diff --git a/docs/framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index ced8e568299..d82cfa37d51 100644 --- a/docs/framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/vue/reference/type-aliases/DefinedQueryObserverResult.md index 7afdbfd38bc..97fcae175a9 100644 --- a/docs/framework/vue/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/vue/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/FetchStatus.md b/docs/framework/vue/reference/type-aliases/FetchStatus.md index 4dae9444af6..7b71e54eacd 100644 --- a/docs/framework/vue/reference/type-aliases/FetchStatus.md +++ b/docs/framework/vue/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) +Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) diff --git a/docs/framework/vue/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/vue/reference/type-aliases/InfiniteQueryObserverResult.md index 95fda780d1d..7a646bc1c38 100644 --- a/docs/framework/vue/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/vue/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/MutateFunction.md b/docs/framework/vue/reference/type-aliases/MutateFunction.md index f574ca7f8ca..284bd0fc270 100644 --- a/docs/framework/vue/reference/type-aliases/MutateFunction.md +++ b/docs/framework/vue/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1258) +Defined in: [packages/query-core/src/types.ts:1271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1271) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/MutateFunctionRest.md b/docs/framework/vue/reference/type-aliases/MutateFunctionRest.md index aef21572aeb..a2f16ea5302 100644 --- a/docs/framework/vue/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/vue/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1243](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1243) +Defined in: [packages/query-core/src/types.ts:1256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1256) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/MutationFunction.md b/docs/framework/vue/reference/type-aliases/MutationFunction.md index e306a5f1a48..4c8c7aed384 100644 --- a/docs/framework/vue/reference/type-aliases/MutationFunction.md +++ b/docs/framework/vue/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1161](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1161) +Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/MutationFunctionContext.md b/docs/framework/vue/reference/type-aliases/MutationFunctionContext.md index b29a54df298..ef228cc53d3 100644 --- a/docs/framework/vue/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/vue/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) +Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) +Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1169) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) +Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1170) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1158](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1158) +Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) diff --git a/docs/framework/vue/reference/type-aliases/MutationKey.md b/docs/framework/vue/reference/type-aliases/MutationKey.md index f89c6959883..7157d6052fd 100644 --- a/docs/framework/vue/reference/type-aliases/MutationKey.md +++ b/docs/framework/vue/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) diff --git a/docs/framework/vue/reference/type-aliases/MutationMeta.md b/docs/framework/vue/reference/type-aliases/MutationMeta.md index e1d481cdcf1..f3bf9984fab 100644 --- a/docs/framework/vue/reference/type-aliases/MutationMeta.md +++ b/docs/framework/vue/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1147](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1147) +Defined in: [packages/query-core/src/types.ts:1160](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1160) diff --git a/docs/framework/vue/reference/type-aliases/MutationObserverResult.md b/docs/framework/vue/reference/type-aliases/MutationObserverResult.md index cbd07f40537..3390192e071 100644 --- a/docs/framework/vue/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/vue/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) +Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/MutationScope.md b/docs/framework/vue/reference/type-aliases/MutationScope.md index 6ec14643477..a2511c903d9 100644 --- a/docs/framework/vue/reference/type-aliases/MutationScope.md +++ b/docs/framework/vue/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) +Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) +Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) diff --git a/docs/framework/vue/reference/type-aliases/MutationStatus.md b/docs/framework/vue/reference/type-aliases/MutationStatus.md index eedf0fb979a..d9b58cdd26f 100644 --- a/docs/framework/vue/reference/type-aliases/MutationStatus.md +++ b/docs/framework/vue/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) +Defined in: [packages/query-core/src/types.ts:1154](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1154) diff --git a/docs/framework/vue/reference/type-aliases/NotifyEventType.md b/docs/framework/vue/reference/type-aliases/NotifyEventType.md index 7b788ced7af..94912df6c6b 100644 --- a/docs/framework/vue/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/vue/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) diff --git a/docs/framework/vue/reference/type-aliases/QueryCacheNotifyEvent.md b/docs/framework/vue/reference/type-aliases/QueryCacheNotifyEvent.md index 8e52da9e279..b92c76fb826 100644 --- a/docs/framework/vue/reference/type-aliases/QueryCacheNotifyEvent.md +++ b/docs/framework/vue/reference/type-aliases/QueryCacheNotifyEvent.md @@ -14,7 +14,7 @@ type QueryCacheNotifyEvent = | NotifyEventQueryObserverOptionsUpdated; ``` -Defined in: [packages/query-core/src/queryCache.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L84) +Defined in: [packages/query-core/src/queryCache.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L85) The event passed to a `QueryCache` subscriber. Fired whenever a query is added or removed from the cache, its state is updated (e.g. via `query.setState` or `queryClient.removeQueries`), or diff --git a/docs/framework/vue/reference/type-aliases/QueryObserverResult.md b/docs/framework/vue/reference/type-aliases/QueryObserverResult.md index f6c4118a978..f5c6c95d5f2 100644 --- a/docs/framework/vue/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/vue/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) +Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/QueryStatus.md b/docs/framework/vue/reference/type-aliases/QueryStatus.md index ed6059e03ec..3fc872e604b 100644 --- a/docs/framework/vue/reference/type-aliases/QueryStatus.md +++ b/docs/framework/vue/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) +Defined in: [packages/query-core/src/types.ts:740](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L740) diff --git a/docs/framework/vue/reference/type-aliases/TimeoutProvider.md b/docs/framework/vue/reference/type-aliases/TimeoutProvider.md index 6416fe4c557..3509105bcd1 100644 --- a/docs/framework/vue/reference/type-aliases/TimeoutProvider.md +++ b/docs/framework/vue/reference/type-aliases/TimeoutProvider.md @@ -7,10 +7,16 @@ title: TimeoutProvider type TimeoutProvider = object; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:22](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L22) +Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) Backend for timer functions. +Timers are performance-sensitive: short-lived timers (delays under a few seconds) tend to be +latency-sensitive, while long-lived ones may benefit more from coalescing — batching timers +with similar deadlines together — which the default provider (backed by the platform's global +`setTimeout`/`setInterval`) does not do. A custom provider can implement coalescing, and can +also support delays longer than the ~24-day maximum of the global `setTimeout`. + ## Type Parameters ### TTimerId @@ -25,7 +31,7 @@ Backend for timer functions. readonly clearInterval: (intervalId) => void; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) +Defined in: [packages/query-core/src/timeoutManager.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L34) #### Parameters @@ -45,7 +51,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/Ta readonly clearTimeout: (timeoutId) => void; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L25) +Defined in: [packages/query-core/src/timeoutManager.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L31) #### Parameters @@ -65,7 +71,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:25](https://github.com/Ta readonly setInterval: (callback, delay) => TTimerId; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L27) +Defined in: [packages/query-core/src/timeoutManager.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L33) #### Parameters @@ -89,7 +95,7 @@ Defined in: [packages/query-core/src/timeoutManager.ts:27](https://github.com/Ta readonly setTimeout: (callback, delay) => TTimerId; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L24) +Defined in: [packages/query-core/src/timeoutManager.ts:30](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L30) #### Parameters diff --git a/docs/framework/vue/reference/variables/environmentManager.md b/docs/framework/vue/reference/variables/environmentManager.md index caa1d70b2b6..e207cfd2484 100644 --- a/docs/framework/vue/reference/variables/environmentManager.md +++ b/docs/framework/vue/reference/variables/environmentManager.md @@ -7,9 +7,13 @@ title: environmentManager const environmentManager: object; ``` -Defined in: [packages/query-core/src/environmentManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L15) +Defined in: [packages/query-core/src/environmentManager.ts:29](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L29) -Manages environment detection used by TanStack Query internals. +Manages how TanStack Query detects whether the current runtime should be treated as +server-side. By default, this uses the same detection as the exported `isServer` utility. + +Override this for runtimes that are not traditional browser/server environments (e.g. +extension workers), where the default detection would give the wrong answer. ## Type Declaration @@ -42,3 +46,14 @@ Overrides the server check globally. #### Returns `void` + +## Example + +```ts +import { environmentManager, isServer } from '@tanstack/query-core' + +environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis)) + +// Restore the default behavior: +environmentManager.setIsServer(() => isServer) +``` diff --git a/docs/framework/vue/reference/variables/notifyManager.md b/docs/framework/vue/reference/variables/notifyManager.md index e5ecca8df60..4bdf3478be0 100644 --- a/docs/framework/vue/reference/variables/notifyManager.md +++ b/docs/framework/vue/reference/variables/notifyManager.md @@ -7,7 +7,7 @@ title: notifyManager const notifyManager: object; ``` -Defined in: [packages/query-core/src/notifyManager.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L135) +Defined in: [packages/query-core/src/notifyManager.ts:144](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L144) Handles scheduling and batching callbacks in TanStack Query. @@ -90,7 +90,8 @@ readonly setBatchNotifyFunction: (fn) => void; ``` Use this method to set a custom function to batch notifications together into a single tick. -By default React Query will use the batch function provided by ReactDOM or React Native. +Framework adapters use this to plug in their own batching primitive, so that a single query +update only triggers one re-render instead of one per subscriber. #### Parameters @@ -102,6 +103,15 @@ By default React Query will use the batch function provided by ReactDOM or React `void` +#### Example + +```ts +import { notifyManager } from '@tanstack/query-core' +import { batch } from 'solid-js' + +notifyManager.setBatchNotifyFunction(batch) +``` + ### setNotifyFunction() ```ts diff --git a/docs/framework/vue/reference/variables/timeoutManager.md b/docs/framework/vue/reference/variables/timeoutManager.md index 2dcfa29b55a..ef9cca969e9 100644 --- a/docs/framework/vue/reference/variables/timeoutManager.md +++ b/docs/framework/vue/reference/variables/timeoutManager.md @@ -7,6 +7,6 @@ title: timeoutManager const timeoutManager: TimeoutManager; ``` -Defined in: [packages/query-core/src/timeoutManager.ts:226](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L226) +Defined in: [packages/query-core/src/timeoutManager.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L232) Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. diff --git a/packages/query-core/src/environmentManager.ts b/packages/query-core/src/environmentManager.ts index 91ef6797230..6a5d8ec20b5 100644 --- a/packages/query-core/src/environmentManager.ts +++ b/packages/query-core/src/environmentManager.ts @@ -10,7 +10,21 @@ let isServerFn: IsServerValue = () => defaultIsServer export const isServer = (): boolean => isServerFn() /** - * Manages environment detection used by TanStack Query internals. + * Manages how TanStack Query detects whether the current runtime should be treated as + * server-side. By default, this uses the same detection as the exported `isServer` utility. + * + * Override this for runtimes that are not traditional browser/server environments (e.g. + * extension workers), where the default detection would give the wrong answer. + * + * @example + * ```ts + * import { environmentManager, isServer } from '@tanstack/query-core' + * + * environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis)) + * + * // Restore the default behavior: + * environmentManager.setIsServer(() => isServer) + * ``` */ export const environmentManager = { isServer, diff --git a/packages/query-core/src/mutationCache.ts b/packages/query-core/src/mutationCache.ts index 761fd579cf8..106e50fe033 100644 --- a/packages/query-core/src/mutationCache.ts +++ b/packages/query-core/src/mutationCache.ts @@ -113,6 +113,13 @@ type MutationCacheListener = (event: MutationCacheNotifyEvent) => void * Normally, you will not interact with the `MutationCache` directly and instead use a * `QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of * safe/known updates to the cache, such as mutations being added, removed, or updated. + * + * @example + * ```ts + * const unsubscribe = mutationCache.subscribe((event) => { + * console.log(event.type, event.mutation) + * }) + * ``` */ export class MutationCache extends Subscribable { #mutations: Set> diff --git a/packages/query-core/src/notifyManager.ts b/packages/query-core/src/notifyManager.ts index f9db1160847..38c2b10f570 100644 --- a/packages/query-core/src/notifyManager.ts +++ b/packages/query-core/src/notifyManager.ts @@ -98,7 +98,16 @@ export function createNotifyManager() { }, /** * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. + * Framework adapters use this to plug in their own batching primitive, so that a single query + * update only triggers one re-render instead of one per subscriber. + * + * @example + * ```ts + * import { notifyManager } from '@tanstack/query-core' + * import { batch } from 'solid-js' + * + * notifyManager.setBatchNotifyFunction(batch) + * ``` */ setBatchNotifyFunction: (fn: BatchNotifyFunction) => { batchNotifyFn = fn diff --git a/packages/query-core/src/queryCache.ts b/packages/query-core/src/queryCache.ts index 2c38c62957d..84de5fa8259 100644 --- a/packages/query-core/src/queryCache.ts +++ b/packages/query-core/src/queryCache.ts @@ -19,7 +19,8 @@ import type { QueryObserver } from './queryObserver' /** * Global callbacks that fire for every query handled by a `QueryCache`, regardless of which * component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can - * override, these callbacks are always called. + * override, these callbacks are always called. Unlike `MutationCacheConfig`'s callbacks, these + * are fire-and-forget: their return value is not awaited before the query settles. */ export interface QueryCacheConfig { /** Called when any query in the cache encounters an error. */ @@ -108,7 +109,16 @@ export interface QueryStore { * * Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient` * for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of - * safe/known updates to the cache, such as queries being added, removed, or updated. + * safe/known updates to the cache, such as queries being added, removed, or updated — updates made + * outside of the cache's own tracked mechanisms (e.g. mutating a query's state object directly) do + * not notify subscribers. + * + * @example + * ```ts + * const unsubscribe = queryCache.subscribe((event) => { + * console.log(event.type, event.query) + * }) + * ``` */ export class QueryCache extends Subscribable { #queries: QueryStore diff --git a/packages/query-core/src/queryClient.ts b/packages/query-core/src/queryClient.ts index 064918c77f3..32867984209 100644 --- a/packages/query-core/src/queryClient.ts +++ b/packages/query-core/src/queryClient.ts @@ -63,6 +63,7 @@ interface MutationDefaults { * `QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds * the default options that are applied to queries and mutations created through it. * + * @example * ```ts * const queryClient = new QueryClient({ * defaultOptions: { @@ -224,6 +225,12 @@ export class QueryClient { * Only queries matching the given filters are returned; if none match, an empty array is * returned. * + * Because the matched queries can hold data of different shapes (e.g. a broad filter can match + * queries with unrelated data types), the `TQueryFnData` generic defaults to `unknown` rather + * than being inferred. Passing a more specific type is a convenience for call sites that know + * every matched query holds the same shape — it is not checked against the actual cache + * contents. + * * @see {@link QueryClient#getQueryData} * @example * ```ts @@ -522,12 +529,15 @@ export class QueryClient { * and the promise resolves once the fetch settles. If a `select` function is provided, it is * applied to the data in both cases (cached or freshly fetched) before it is returned. * - * Unlike `useQuery`, retries are disabled by default here (`retry: false`) unless explicitly - * configured, since there is no component to catch a thrown error and retry through re-render. + * Unlike a reactive observer, retries are disabled by default here (`retry: false`) unless + * explicitly configured, since there is no component to catch a thrown error and retry through + * re-render. * - * The accepted options are a subset of `useQuery`'s options: fields that only make sense for a - * reactive observer (e.g. `enabled`, `refetchInterval`, `refetchOnWindowFocus`, `notifyOnChangeProps`, - * `throwOnError`, `suspense`, `placeholderData`) are not part of this method's options. + * The accepted options are `QueryObserverOptions` minus the fields that only make sense for a + * reactive observer — `enabled`, `refetchInterval`, `refetchIntervalInBackground`, + * `refetchOnWindowFocus`, `refetchOnReconnect`, `refetchOnMount`, `retryOnMount`, + * `notifyOnChangeProps`, `throwOnError`, `suspense`, and `placeholderData` are not part of this + * method's options. * * This method replaces the deprecated `fetchQuery`, and — combined with * `{ staleTime: 'static' }` — the deprecated `ensureQueryData`. diff --git a/packages/query-core/src/streamedQuery.ts b/packages/query-core/src/streamedQuery.ts index 9b1ff3ac042..6680747a153 100644 --- a/packages/query-core/src/streamedQuery.ts +++ b/packages/query-core/src/streamedQuery.ts @@ -7,9 +7,16 @@ import type { } from './types' type BaseStreamedQueryParams = { + /** The function that returns an `AsyncIterable` to stream data from. */ streamFn: ( context: QueryFunctionContext, ) => AsyncIterable | Promise> + /** + * Defines how refetches are handled. + * - `'reset'` (default): erases all data and puts the query back into `pending` state. + * - `'append'`: appends new data to the existing data. + * - `'replace'`: writes all data to the cache once the stream ends. + */ refetchMode?: 'append' | 'reset' | 'replace' } @@ -26,7 +33,15 @@ type ReducibleStreamedQueryParams< TData, TQueryKey extends QueryKey, > = BaseStreamedQueryParams & { + /** + * Reduces streamed chunks into the final data shape. Required whenever `TData` is not an + * array, since there is no default way to accumulate non-array chunks. + */ reducer: (acc: TData, chunk: TQueryFnData) => TData + /** + * The value used while the first chunk is being fetched, and returned if the stream yields no + * values. Required together with a custom `reducer`. + */ initialValue: TData } @@ -39,7 +54,7 @@ type StreamedQueryParams = * Data will be an Array of all the chunks received. * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. * The query will stay in fetchStatus 'fetching' until the stream ends. - * @param queryFn - The function that returns an AsyncIterable to stream data from. + * @param streamFn - The function that returns an AsyncIterable to stream data from. * @param refetchMode - Defines how re-fetches are handled. * Defaults to `'reset'`, erases all data and puts the query back into `pending` state. * Set to `'append'` to append new data to the existing data. diff --git a/packages/query-core/src/timeoutManager.ts b/packages/query-core/src/timeoutManager.ts index c4d424d600b..acccbaa4d60 100644 --- a/packages/query-core/src/timeoutManager.ts +++ b/packages/query-core/src/timeoutManager.ts @@ -18,6 +18,12 @@ export type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number } /** * Backend for timer functions. + * + * Timers are performance-sensitive: short-lived timers (delays under a few seconds) tend to be + * latency-sensitive, while long-lived ones may benefit more from coalescing — batching timers + * with similar deadlines together — which the default provider (backed by the platform's global + * `setTimeout`/`setInterval`) does not do. A custom provider can implement coalescing, and can + * also support delays longer than the ~24-day maximum of the global `setTimeout`. */ export type TimeoutProvider = { diff --git a/packages/query-core/src/types.ts b/packages/query-core/src/types.ts index 073d89dd775..e1514a92993 100644 --- a/packages/query-core/src/types.ts +++ b/packages/query-core/src/types.ts @@ -673,6 +673,11 @@ export type FetchInfiniteQueryOptions< InfiniteQueryPages export interface ResultOptions { + /** + * If set to `true`, the method throws if any of the underlying query refetch tasks fail. + * Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the + * caller. + */ throwOnError?: boolean } @@ -690,6 +695,14 @@ export interface RefetchOptions extends ResultOptions { export interface InvalidateQueryFilters< TQueryKey extends QueryKey = QueryKey, > extends QueryFilters { + /** + * Controls which of the matched (now-invalidated) queries are refetched in the background. + * Defaults to `'active'`. + * - `'active'`: only queries with at least one active observer are refetched. + * - `'inactive'`: only queries with no active observer are refetched. + * - `'all'`: every matched query is refetched, active or not. + * - `'none'`: no query is refetched; matched queries are only marked as invalidated. + */ refetchType?: QueryTypeFilter | 'none' } @@ -1425,18 +1438,28 @@ export type MutationObserverResult< | MutationObserverSuccessResult export interface QueryClientConfig { + /** The query cache this client is connected to. A new `QueryCache` is created if not provided. */ queryCache?: QueryCache + /** + * The mutation cache this client is connected to. A new `MutationCache` is created if not + * provided. + */ mutationCache?: MutationCache + /** Default options for all queries and mutations created through this client. */ defaultOptions?: DefaultOptions } export interface DefaultOptions { + /** Default options applied to every query, unless overridden per-query. */ queries?: OmitKeyof< QueryObserverOptions, 'suspense' | 'queryKey' > + /** Default options applied to every mutation, unless overridden per-mutation. */ mutations?: MutationObserverOptions + /** Default options used when hydrating queries; see {@link HydrateOptions}. */ hydrate?: HydrateOptions['defaultOptions'] + /** Default options used when dehydrating the client's caches; see {@link DehydrateOptions}. */ dehydrate?: DehydrateOptions } From 4a387380cb43cbf487ecc6fbdc15fa9c42e7f1d0 Mon Sep 17 00:00:00 2001 From: Wonsuk Choi Date: Mon, 7 Sep 2026 03:37:29 +0900 Subject: [PATCH 4/9] docs(query-core): remove legacy 'docs/reference' pages superseded by the generated reference --- .changeset/export-manager-class-types.md | 5 + docs/config.json | 135 +++-- docs/framework/angular/reference/index.md | 3 + .../reference/interfaces/FocusManager.md | 237 ++++++++ .../reference/interfaces/OnlineManager.md | 214 +++++++ .../reference/interfaces/TimeoutManager.md | 246 +++++++++ .../reference/type-aliases/TimeoutCallback.md | 2 +- .../reference/variables/environmentManager.md | 8 +- .../reference/variables/focusManager.md | 2 +- .../reference/variables/onlineManager.md | 2 +- .../reference/variables/timeoutManager.md | 2 +- docs/framework/lit/reference/index.md | 3 + .../lit/reference/interfaces/FocusManager.md | 237 ++++++++ .../lit/reference/interfaces/OnlineManager.md | 214 +++++++ .../reference/interfaces/TimeoutManager.md | 246 +++++++++ .../reference/type-aliases/TimeoutCallback.md | 2 +- .../lit/reference/variables/focusManager.md | 2 +- .../lit/reference/variables/onlineManager.md | 2 +- .../lit/reference/variables/timeoutManager.md | 2 +- docs/framework/preact/guides/ssr.md | 2 +- docs/framework/preact/reference/index.md | 3 + .../reference/interfaces/FocusManager.md | 237 ++++++++ .../reference/interfaces/OnlineManager.md | 214 +++++++ .../reference/interfaces/TimeoutManager.md | 246 +++++++++ .../reference/type-aliases/TimeoutCallback.md | 2 +- .../reference/variables/focusManager.md | 2 +- .../reference/variables/onlineManager.md | 2 +- .../reference/variables/timeoutManager.md | 2 +- .../guides/migrating-to-react-query-4.md | 4 +- docs/framework/react/guides/mutations.md | 2 +- docs/framework/react/guides/network-mode.md | 2 +- docs/framework/react/guides/prefetching.md | 2 +- .../framework/react/guides/query-functions.md | 2 +- docs/framework/react/guides/ssr.md | 2 +- .../guides/updates-from-mutation-responses.md | 2 +- .../react/plugins/persistQueryClient.md | 4 +- .../classes/InfiniteQueryObserver.md | 3 + .../react/reference/classes/MutationCache.md | 3 + .../reference/classes/QueriesObserver.md | 3 + .../react/reference/classes/QueryCache.md | 3 + .../react/reference/classes/QueryClient.md | 3 + .../react/reference/classes/QueryObserver.md | 3 + .../functions/experimental_streamedQuery.md | 2 + docs/framework/react/reference/index.md | 3 + .../reference/interfaces/FocusManager.md | 240 ++++++++ .../reference/interfaces/OnlineManager.md | 217 ++++++++ .../reference/interfaces/TimeoutManager.md | 248 +++++++++ .../reference/type-aliases/TimeoutCallback.md | 2 +- .../reference/variables/environmentManager.md | 2 + .../react/reference/variables/focusManager.md | 2 +- .../reference/variables/notifyManager.md | 3 + .../reference/variables/onlineManager.md | 2 +- .../reference/variables/timeoutManager.md | 2 +- docs/framework/solid/reference/index.md | 3 + .../reference/interfaces/FocusManager.md | 237 ++++++++ .../reference/interfaces/OnlineManager.md | 214 +++++++ .../reference/interfaces/TimeoutManager.md | 246 +++++++++ .../reference/type-aliases/TimeoutCallback.md | 2 +- .../solid/reference/variables/focusManager.md | 2 +- .../reference/variables/onlineManager.md | 2 +- .../reference/variables/timeoutManager.md | 2 +- docs/framework/svelte/reference/index.md | 3 + .../reference/interfaces/FocusManager.md | 237 ++++++++ .../reference/interfaces/OnlineManager.md | 214 +++++++ .../reference/interfaces/TimeoutManager.md | 246 +++++++++ .../reference/type-aliases/TimeoutCallback.md | 2 +- .../reference/variables/focusManager.md | 2 +- .../reference/variables/onlineManager.md | 2 +- .../reference/variables/timeoutManager.md | 2 +- docs/framework/vue/guides/ssr.md | 2 +- docs/framework/vue/reference/index.md | 3 + .../vue/reference/interfaces/FocusManager.md | 237 ++++++++ .../vue/reference/interfaces/OnlineManager.md | 214 +++++++ .../reference/interfaces/TimeoutManager.md | 246 +++++++++ .../reference/type-aliases/TimeoutCallback.md | 2 +- .../vue/reference/variables/focusManager.md | 2 +- .../vue/reference/variables/onlineManager.md | 2 +- .../vue/reference/variables/timeoutManager.md | 2 +- docs/reference/InfiniteQueryObserver.md | 26 - docs/reference/MutationCache.md | 100 ---- docs/reference/QueriesObserver.md | 24 - docs/reference/QueryCache.md | 125 ----- docs/reference/QueryClient.md | 521 ------------------ docs/reference/QueryObserver.md | 21 - docs/reference/environmentManager.md | 50 -- docs/reference/focusManager.md | 78 --- docs/reference/notifyManager.md | 95 ---- docs/reference/onlineManager.md | 76 --- docs/reference/streamedQuery.md | 45 -- docs/reference/timeoutManager.md | 119 ---- packages/query-core/src/index.ts | 3 + scripts/generate-docs.ts | 44 ++ 92 files changed, 5116 insertions(+), 1372 deletions(-) create mode 100644 .changeset/export-manager-class-types.md create mode 100644 docs/framework/angular/reference/interfaces/FocusManager.md create mode 100644 docs/framework/angular/reference/interfaces/OnlineManager.md create mode 100644 docs/framework/angular/reference/interfaces/TimeoutManager.md create mode 100644 docs/framework/lit/reference/interfaces/FocusManager.md create mode 100644 docs/framework/lit/reference/interfaces/OnlineManager.md create mode 100644 docs/framework/lit/reference/interfaces/TimeoutManager.md create mode 100644 docs/framework/preact/reference/interfaces/FocusManager.md create mode 100644 docs/framework/preact/reference/interfaces/OnlineManager.md create mode 100644 docs/framework/preact/reference/interfaces/TimeoutManager.md create mode 100644 docs/framework/react/reference/interfaces/FocusManager.md create mode 100644 docs/framework/react/reference/interfaces/OnlineManager.md create mode 100644 docs/framework/react/reference/interfaces/TimeoutManager.md create mode 100644 docs/framework/solid/reference/interfaces/FocusManager.md create mode 100644 docs/framework/solid/reference/interfaces/OnlineManager.md create mode 100644 docs/framework/solid/reference/interfaces/TimeoutManager.md create mode 100644 docs/framework/svelte/reference/interfaces/FocusManager.md create mode 100644 docs/framework/svelte/reference/interfaces/OnlineManager.md create mode 100644 docs/framework/svelte/reference/interfaces/TimeoutManager.md create mode 100644 docs/framework/vue/reference/interfaces/FocusManager.md create mode 100644 docs/framework/vue/reference/interfaces/OnlineManager.md create mode 100644 docs/framework/vue/reference/interfaces/TimeoutManager.md delete mode 100644 docs/reference/InfiniteQueryObserver.md delete mode 100644 docs/reference/MutationCache.md delete mode 100644 docs/reference/QueriesObserver.md delete mode 100644 docs/reference/QueryCache.md delete mode 100644 docs/reference/QueryClient.md delete mode 100644 docs/reference/QueryObserver.md delete mode 100644 docs/reference/environmentManager.md delete mode 100644 docs/reference/focusManager.md delete mode 100644 docs/reference/notifyManager.md delete mode 100644 docs/reference/onlineManager.md delete mode 100644 docs/reference/streamedQuery.md delete mode 100644 docs/reference/timeoutManager.md diff --git a/.changeset/export-manager-class-types.md b/.changeset/export-manager-class-types.md new file mode 100644 index 00000000000..42f84f3b9d1 --- /dev/null +++ b/.changeset/export-manager-class-types.md @@ -0,0 +1,5 @@ +--- +'@tanstack/query-core': minor +--- + +Export the `FocusManager`, `OnlineManager`, and `TimeoutManager` types so their methods appear in the generated reference docs. diff --git a/docs/config.json b/docs/config.json index e9ce7b0cc68..9bbeb14325c 100644 --- a/docs/config.json +++ b/docs/config.json @@ -970,56 +970,7 @@ }, { "label": "API Reference", - "children": [ - { - "label": "QueryClient", - "to": "reference/QueryClient" - }, - { - "label": "QueryCache", - "to": "reference/QueryCache" - }, - { - "label": "MutationCache", - "to": "reference/MutationCache" - }, - { - "label": "QueryObserver", - "to": "reference/QueryObserver" - }, - { - "label": "InfiniteQueryObserver", - "to": "reference/InfiniteQueryObserver" - }, - { - "label": "QueriesObserver", - "to": "reference/QueriesObserver" - }, - { - "label": "streamedQuery", - "to": "reference/streamedQuery" - }, - { - "label": "focusManager", - "to": "reference/focusManager" - }, - { - "label": "onlineManager", - "to": "reference/onlineManager" - }, - { - "label": "environmentManager", - "to": "reference/environmentManager" - }, - { - "label": "notifyManager", - "to": "reference/notifyManager" - }, - { - "label": "timeoutManager", - "to": "reference/timeoutManager" - } - ], + "children": [], "frameworks": [ { "label": "react", @@ -1244,6 +1195,10 @@ "label": "Interfaces / FetchQueryOptions", "to": "framework/react/reference/interfaces/FetchQueryOptions" }, + { + "label": "Interfaces / FocusManager", + "to": "framework/react/reference/interfaces/FocusManager" + }, { "label": "Interfaces / HydrateOptions", "to": "framework/react/reference/interfaces/HydrateOptions" @@ -1352,6 +1307,10 @@ "label": "Interfaces / NotifyEvent", "to": "framework/react/reference/interfaces/NotifyEvent" }, + { + "label": "Interfaces / OnlineManager", + "to": "framework/react/reference/interfaces/OnlineManager" + }, { "label": "Interfaces / QueriesObserverOptions", "to": "framework/react/reference/interfaces/QueriesObserverOptions" @@ -1440,6 +1399,10 @@ "label": "Interfaces / SetDataOptions", "to": "framework/react/reference/interfaces/SetDataOptions" }, + { + "label": "Interfaces / TimeoutManager", + "to": "framework/react/reference/interfaces/TimeoutManager" + }, { "label": "Interfaces / UseBaseQueryOptions", "to": "framework/react/reference/interfaces/UseBaseQueryOptions" @@ -2081,6 +2044,10 @@ "label": "Interfaces / FetchQueryOptions", "to": "framework/vue/reference/interfaces/FetchQueryOptions" }, + { + "label": "Interfaces / FocusManager", + "to": "framework/vue/reference/interfaces/FocusManager" + }, { "label": "Interfaces / HydrateOptions", "to": "framework/vue/reference/interfaces/HydrateOptions" @@ -2177,6 +2144,10 @@ "label": "Interfaces / NotifyEvent", "to": "framework/vue/reference/interfaces/NotifyEvent" }, + { + "label": "Interfaces / OnlineManager", + "to": "framework/vue/reference/interfaces/OnlineManager" + }, { "label": "Interfaces / QueriesObserverOptions", "to": "framework/vue/reference/interfaces/QueriesObserverOptions" @@ -2253,6 +2224,10 @@ "label": "Interfaces / SetDataOptions", "to": "framework/vue/reference/interfaces/SetDataOptions" }, + { + "label": "Interfaces / TimeoutManager", + "to": "framework/vue/reference/interfaces/TimeoutManager" + }, { "label": "Types / AnyDataTag", "to": "framework/vue/reference/type-aliases/AnyDataTag" @@ -2822,6 +2797,10 @@ "label": "Interfaces / FetchQueryOptions", "to": "framework/solid/reference/interfaces/FetchQueryOptions" }, + { + "label": "Interfaces / FocusManager", + "to": "framework/solid/reference/interfaces/FocusManager" + }, { "label": "Interfaces / HydrateOptions", "to": "framework/solid/reference/interfaces/HydrateOptions" @@ -2930,6 +2909,10 @@ "label": "Interfaces / NotifyEvent", "to": "framework/solid/reference/interfaces/NotifyEvent" }, + { + "label": "Interfaces / OnlineManager", + "to": "framework/solid/reference/interfaces/OnlineManager" + }, { "label": "Interfaces / QueriesObserverOptions", "to": "framework/solid/reference/interfaces/QueriesObserverOptions" @@ -3014,6 +2997,10 @@ "label": "Interfaces / SetDataOptions", "to": "framework/solid/reference/interfaces/SetDataOptions" }, + { + "label": "Interfaces / TimeoutManager", + "to": "framework/solid/reference/interfaces/TimeoutManager" + }, { "label": "Interfaces / UseBaseQueryOptions", "to": "framework/solid/reference/interfaces/UseBaseQueryOptions" @@ -3603,6 +3590,10 @@ "label": "Interfaces / FetchQueryOptions", "to": "framework/svelte/reference/interfaces/FetchQueryOptions" }, + { + "label": "Interfaces / FocusManager", + "to": "framework/svelte/reference/interfaces/FocusManager" + }, { "label": "Interfaces / HydrateOptions", "to": "framework/svelte/reference/interfaces/HydrateOptions" @@ -3707,6 +3698,10 @@ "label": "Interfaces / NotifyEvent", "to": "framework/svelte/reference/interfaces/NotifyEvent" }, + { + "label": "Interfaces / OnlineManager", + "to": "framework/svelte/reference/interfaces/OnlineManager" + }, { "label": "Interfaces / QueriesObserverOptions", "to": "framework/svelte/reference/interfaces/QueriesObserverOptions" @@ -3791,6 +3786,10 @@ "label": "Interfaces / SetDataOptions", "to": "framework/svelte/reference/interfaces/SetDataOptions" }, + { + "label": "Interfaces / TimeoutManager", + "to": "framework/svelte/reference/interfaces/TimeoutManager" + }, { "label": "Types / Accessor", "to": "framework/svelte/reference/type-aliases/Accessor" @@ -4372,6 +4371,10 @@ "label": "Interfaces / FetchQueryOptions", "to": "framework/lit/reference/interfaces/FetchQueryOptions" }, + { + "label": "Interfaces / FocusManager", + "to": "framework/lit/reference/interfaces/FocusManager" + }, { "label": "Interfaces / HydrateOptions", "to": "framework/lit/reference/interfaces/HydrateOptions" @@ -4476,6 +4479,10 @@ "label": "Interfaces / NotifyEvent", "to": "framework/lit/reference/interfaces/NotifyEvent" }, + { + "label": "Interfaces / OnlineManager", + "to": "framework/lit/reference/interfaces/OnlineManager" + }, { "label": "Interfaces / QueriesObserverOptions", "to": "framework/lit/reference/interfaces/QueriesObserverOptions" @@ -4560,6 +4567,10 @@ "label": "Interfaces / SetDataOptions", "to": "framework/lit/reference/interfaces/SetDataOptions" }, + { + "label": "Interfaces / TimeoutManager", + "to": "framework/lit/reference/interfaces/TimeoutManager" + }, { "label": "Types / Accessor", "to": "framework/lit/reference/type-aliases/Accessor" @@ -5165,6 +5176,10 @@ "label": "Interfaces / FetchQueryOptions", "to": "framework/angular/reference/interfaces/FetchQueryOptions" }, + { + "label": "Interfaces / FocusManager", + "to": "framework/angular/reference/interfaces/FocusManager" + }, { "label": "Interfaces / HydrateOptions", "to": "framework/angular/reference/interfaces/HydrateOptions" @@ -5293,6 +5308,10 @@ "label": "Interfaces / NotifyEvent", "to": "framework/angular/reference/interfaces/NotifyEvent" }, + { + "label": "Interfaces / OnlineManager", + "to": "framework/angular/reference/interfaces/OnlineManager" + }, { "label": "Interfaces / QueriesObserverOptions", "to": "framework/angular/reference/interfaces/QueriesObserverOptions" @@ -5381,6 +5400,10 @@ "label": "Interfaces / SetDataOptions", "to": "framework/angular/reference/interfaces/SetDataOptions" }, + { + "label": "Interfaces / TimeoutManager", + "to": "framework/angular/reference/interfaces/TimeoutManager" + }, { "label": "Types / AnyDataTag", "to": "framework/angular/reference/type-aliases/AnyDataTag" @@ -5966,6 +5989,10 @@ "label": "Interfaces / FetchQueryOptions", "to": "framework/preact/reference/interfaces/FetchQueryOptions" }, + { + "label": "Interfaces / FocusManager", + "to": "framework/preact/reference/interfaces/FocusManager" + }, { "label": "Interfaces / HydrateOptions", "to": "framework/preact/reference/interfaces/HydrateOptions" @@ -6074,6 +6101,10 @@ "label": "Interfaces / NotifyEvent", "to": "framework/preact/reference/interfaces/NotifyEvent" }, + { + "label": "Interfaces / OnlineManager", + "to": "framework/preact/reference/interfaces/OnlineManager" + }, { "label": "Interfaces / QueriesObserverOptions", "to": "framework/preact/reference/interfaces/QueriesObserverOptions" @@ -6162,6 +6193,10 @@ "label": "Interfaces / SetDataOptions", "to": "framework/preact/reference/interfaces/SetDataOptions" }, + { + "label": "Interfaces / TimeoutManager", + "to": "framework/preact/reference/interfaces/TimeoutManager" + }, { "label": "Interfaces / UseBaseQueryOptions", "to": "framework/preact/reference/interfaces/UseBaseQueryOptions" diff --git a/docs/framework/angular/reference/index.md b/docs/framework/angular/reference/index.md index bfeef0065bb..4b10910da24 100644 --- a/docs/framework/angular/reference/index.md +++ b/docs/framework/angular/reference/index.md @@ -32,6 +32,7 @@ title: "@tanstack/angular-query-experimental" - [FetchNextPageOptions](interfaces/FetchNextPageOptions.md) - [FetchPreviousPageOptions](interfaces/FetchPreviousPageOptions.md) - [~~FetchQueryOptions~~](interfaces/FetchQueryOptions.md) +- [FocusManager](interfaces/FocusManager.md) - [HydrateOptions](interfaces/HydrateOptions.md) - [InfiniteData](interfaces/InfiniteData.md) - [InfiniteQueryObserverBaseResult](interfaces/InfiniteQueryObserverBaseResult.md) @@ -64,6 +65,7 @@ title: "@tanstack/angular-query-experimental" - [MutationOptions](interfaces/MutationOptions.md) - [MutationState](interfaces/MutationState.md) - [NotifyEvent](interfaces/NotifyEvent.md) +- [OnlineManager](interfaces/OnlineManager.md) - [QueriesObserverOptions](interfaces/QueriesObserverOptions.md) - [QueryCacheConfig](interfaces/QueryCacheConfig.md) - [QueryClientConfig](interfaces/QueryClientConfig.md) @@ -86,6 +88,7 @@ title: "@tanstack/angular-query-experimental" - [ResetOptions](interfaces/ResetOptions.md) - [ResultOptions](interfaces/ResultOptions.md) - [SetDataOptions](interfaces/SetDataOptions.md) +- [TimeoutManager](interfaces/TimeoutManager.md) ## Type Aliases diff --git a/docs/framework/angular/reference/interfaces/FocusManager.md b/docs/framework/angular/reference/interfaces/FocusManager.md new file mode 100644 index 00000000000..8004d77a5a4 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/FocusManager.md @@ -0,0 +1,237 @@ +--- +id: FocusManager +title: FocusManager +--- + +Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:9 + +The `FocusManager` manages the focus state within TanStack Query. + +It can be used to change the default event listeners or to manually change the focus state. + +## Extends + +- `Subscribable`\<`Listener`\> + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### isFocused() + +```ts +isFocused(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:66 + +`isFocused` can be used to get the current focus state. + +#### Returns + +`boolean` + +*** + +### onFocus() + +```ts +onFocus(): void; +``` + +Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:62 + +`onFocus` notifies all subscribed listeners with the current focus state. + +#### Returns + +`void` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:12 + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:13 + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setEventListener() + +```ts +setEventListener(setup): void; +``` + +Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:39 + +`setEventListener` can be used to set a custom event listener that will +be used to determine the focus state. The provided `setup` function +receives a `setFocused` callback: call it with a `boolean` to manually +set the focus state, or with no arguments to re-evaluate the current +focus state and notify subscribers. + +#### Parameters + +##### setup + +`SetupFn` + +#### Returns + +`void` + +#### Example + +```ts +import { focusManager } from '@tanstack/query-core' + +focusManager.setEventListener((handleFocus) => { + const listener = () => handleFocus() + // Listen to visibilitychange + if (typeof window !== 'undefined' && window.addEventListener) { + window.addEventListener('visibilitychange', listener, false) + } + + return () => { + // Be sure to unsubscribe if a new handler is set + window.removeEventListener('visibilitychange', listener) + } +}) +``` + +*** + +### setFocused() + +```ts +setFocused(focused?): void; +``` + +Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:58 + +`setFocused` can be used to manually set the focus state. Set `undefined` +to fall back to the default focus check. + +#### Parameters + +##### focused? + +`boolean` + +#### Returns + +`void` + +#### Example + +```ts +import { focusManager } from '@tanstack/query-core' + +// Set focused +focusManager.setFocused(true) + +// Set unfocused +focusManager.setFocused(false) + +// Fallback to the default focus check +focusManager.setFocused(undefined) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:4 + +#### Parameters + +##### listener + +`Listener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/angular/reference/interfaces/OnlineManager.md b/docs/framework/angular/reference/interfaces/OnlineManager.md new file mode 100644 index 00000000000..d6b19b09e62 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/OnlineManager.md @@ -0,0 +1,214 @@ +--- +id: OnlineManager +title: OnlineManager +--- + +Defined in: packages/query-core/dist-ts/src/onlineManager.d.ts:13 + +The `OnlineManager` manages the online state within TanStack Query. It can +be used to change the default event listeners or to manually change the +online state. + +By default, the `onlineManager` assumes an active network connection, and +listens to the `online` and `offline` events on the `window` object to +detect changes. + +## Extends + +- `Subscribable`\<`Listener`\> + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### isOnline() + +```ts +isOnline(): boolean; +``` + +Defined in: packages/query-core/dist-ts/src/onlineManager.d.ts:55 + +`isOnline` can be used to get the current online state. + +#### Returns + +`boolean` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: packages/query-core/dist-ts/src/onlineManager.d.ts:16 + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: packages/query-core/dist-ts/src/onlineManager.d.ts:17 + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setEventListener() + +```ts +setEventListener(setup): void; +``` + +Defined in: packages/query-core/dist-ts/src/onlineManager.d.ts:36 + +`setEventListener` can be used to set a custom event listener that will +be used to determine the online state. The provided `setup` function +receives a `setOnline` callback that should be called with a `boolean` +whenever the online state changes. + +#### Parameters + +##### setup + +`SetupFn` + +#### Returns + +`void` + +#### Example + +```ts +import NetInfo from '@react-native-community/netinfo' +import { onlineManager } from '@tanstack/query-core' + +onlineManager.setEventListener((setOnline) => { + return NetInfo.addEventListener((state) => { + setOnline(!!state.isConnected) + }) +}) +``` + +*** + +### setOnline() + +```ts +setOnline(online): void; +``` + +Defined in: packages/query-core/dist-ts/src/onlineManager.d.ts:51 + +`setOnline` can be used to manually set the online state. + +#### Parameters + +##### online + +`boolean` + +#### Returns + +`void` + +#### Example + +```ts +import { onlineManager } from '@tanstack/query-core' + +// Set to online +onlineManager.setOnline(true) + +// Set to offline +onlineManager.setOnline(false) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:4 + +#### Parameters + +##### listener + +`Listener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/angular/reference/interfaces/TimeoutManager.md b/docs/framework/angular/reference/interfaces/TimeoutManager.md new file mode 100644 index 00000000000..f1cf5b869a4 --- /dev/null +++ b/docs/framework/angular/reference/interfaces/TimeoutManager.md @@ -0,0 +1,246 @@ +--- +id: TimeoutManager +title: TimeoutManager +--- + +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:46 + +Allows customization of how timeouts are created. + +@tanstack/query-core makes liberal use of timeouts to implement `staleTime` +and `gcTime`. The default TimeoutManager provider uses the platform's global +`setTimeout` implementation, which is known to have scalability issues with +thousands of timeouts on the event loop. + +If you hit this limitation, consider providing a custom TimeoutProvider that +coalesces timeouts. + +## Implements + +- `Omit`\<[`TimeoutProvider`](../type-aliases/TimeoutProvider.md), `"name"`\> + +## Methods + +### clearInterval() + +```ts +clearInterval(intervalId): void; +``` + +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:148 + +`clearInterval` can be used to cancel an interval, like the global +`clearInterval` function. It should be called with an interval ID +returned by `setInterval`. + +#### Parameters + +##### intervalId + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) | `undefined` + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const intervalId = timeoutManager.setInterval( + () => console.log('ran at:', new Date()), + 1000, +) + +timeoutManager.clearInterval(intervalId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`clearInterval`](../type-aliases/TimeoutProvider.md#clearinterval) + +*** + +### clearTimeout() + +```ts +clearTimeout(timeoutId): void; +``` + +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:112 + +`clearTimeout` cancels a timeout callback scheduled with `setTimeout`, +like the global `clearTimeout` function. It should be called with a +timer ID returned by `setTimeout`. + +#### Parameters + +##### timeoutId + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) | `undefined` + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const timeoutId = timeoutManager.setTimeout( + () => console.log('ran at:', new Date()), + 1000, +) + +timeoutManager.clearTimeout(timeoutId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`clearTimeout`](../type-aliases/TimeoutProvider.md#cleartimeout) + +*** + +### setInterval() + +```ts +setInterval(callback, delay): ManagedTimerId; +``` + +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:130 + +`setInterval` schedules a callback to be called approximately every +`delay` milliseconds, like the global `setInterval` function. + +Like `setTimeout`, it returns a timer ID, which may be a number or an +object that can be coerced to a number via `Symbol.toPrimitive`. + +#### Parameters + +##### callback + +[`TimeoutCallback`](../type-aliases/TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const intervalId = timeoutManager.setInterval( + () => console.log('ran at:', new Date()), + 1000, +) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`setInterval`](../type-aliases/TimeoutProvider.md#setinterval) + +*** + +### setTimeout() + +```ts +setTimeout(callback, delay): ManagedTimerId; +``` + +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:94 + +`setTimeout` schedules a callback to run after approximately `delay` +milliseconds, like the global `setTimeout` function. The callback can be +canceled with `clearTimeout`. + +It returns a timer ID, which may be a number or an object that can be +coerced to a number via `Symbol.toPrimitive`. + +#### Parameters + +##### callback + +[`TimeoutCallback`](../type-aliases/TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const timeoutId = timeoutManager.setTimeout( + () => console.log('ran at:', new Date()), + 1000, +) + +const timeoutIdNumber: number = Number(timeoutId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`setTimeout`](../type-aliases/TimeoutProvider.md#settimeout) + +*** + +### setTimeoutProvider() + +```ts +setTimeoutProvider(provider): void; +``` + +Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:73 + +`setTimeoutProvider` can be used to set a custom implementation of the +`setTimeout`, `clearTimeout`, `setInterval`, `clearInterval` functions, +called a `TimeoutProvider`. + +This may be useful if you notice event loop performance issues with +thousands of queries. A custom TimeoutProvider could also support timer +delays longer than the global `setTimeout` maximum delay value of about +24 days. + +It is important to call `setTimeoutProvider` before creating a +QueryClient or queries, so that the same provider is used consistently +for all timers in the application, since different TimeoutProviders +cannot cancel each others' timers. + +#### Type Parameters + +##### TTimerId + +`TTimerId` *extends* [`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Parameters + +##### provider + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md)\<`TTimerId`\> + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager, QueryClient } from '@tanstack/query-core' +import { CustomTimeoutProvider } from './CustomTimeoutProvider' + +timeoutManager.setTimeoutProvider(new CustomTimeoutProvider()) + +export const queryClient = new QueryClient() +``` diff --git a/docs/framework/angular/reference/type-aliases/TimeoutCallback.md b/docs/framework/angular/reference/type-aliases/TimeoutCallback.md index fdd610e7977..926ce927d09 100644 --- a/docs/framework/angular/reference/type-aliases/TimeoutCallback.md +++ b/docs/framework/angular/reference/type-aliases/TimeoutCallback.md @@ -9,7 +9,7 @@ type TimeoutCallback = (_) => void; Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:9 -TimeoutManager does not support passing arguments to the callback. +[TimeoutManager](../interfaces/TimeoutManager.md) does not support passing arguments to the callback. `(_: void)` is the argument type inferred by TypeScript's default typings for `setTimeout(cb, number)`. diff --git a/docs/framework/angular/reference/variables/environmentManager.md b/docs/framework/angular/reference/variables/environmentManager.md index e2975e30dec..6b5ddc28e1e 100644 --- a/docs/framework/angular/reference/variables/environmentManager.md +++ b/docs/framework/angular/reference/variables/environmentManager.md @@ -17,12 +17,16 @@ extension workers), where the default detection would give the wrong answer. ## Type Declaration -### isServer +### isServer() ```ts -isServer: typeof isServer; +isServer: () => boolean; ``` +#### Returns + +`boolean` + ### setIsServer() ```ts diff --git a/docs/framework/angular/reference/variables/focusManager.md b/docs/framework/angular/reference/variables/focusManager.md index 44cf649a6de..88f85eea879 100644 --- a/docs/framework/angular/reference/variables/focusManager.md +++ b/docs/framework/angular/reference/variables/focusManager.md @@ -9,4 +9,4 @@ const focusManager: FocusManager; Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:71 -Singleton instance of FocusManager, used to manage and observe the focus state within TanStack Query. +Singleton instance of [FocusManager](../interfaces/FocusManager.md), used to manage and observe the focus state within TanStack Query. diff --git a/docs/framework/angular/reference/variables/onlineManager.md b/docs/framework/angular/reference/variables/onlineManager.md index b3539b52b37..c62e2a55362 100644 --- a/docs/framework/angular/reference/variables/onlineManager.md +++ b/docs/framework/angular/reference/variables/onlineManager.md @@ -9,4 +9,4 @@ const onlineManager: OnlineManager; Defined in: packages/query-core/dist-ts/src/onlineManager.d.ts:60 -Singleton instance of OnlineManager, used to manage and observe the online state within TanStack Query. +Singleton instance of [OnlineManager](../interfaces/OnlineManager.md), used to manage and observe the online state within TanStack Query. diff --git a/docs/framework/angular/reference/variables/timeoutManager.md b/docs/framework/angular/reference/variables/timeoutManager.md index 4decb9720c6..f99ede3311a 100644 --- a/docs/framework/angular/reference/variables/timeoutManager.md +++ b/docs/framework/angular/reference/variables/timeoutManager.md @@ -9,4 +9,4 @@ const timeoutManager: TimeoutManager; Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:153 -Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. +Singleton instance of [TimeoutManager](../interfaces/TimeoutManager.md), used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/lit/reference/index.md b/docs/framework/lit/reference/index.md index 8cab137b1cb..cd93d99b440 100644 --- a/docs/framework/lit/reference/index.md +++ b/docs/framework/lit/reference/index.md @@ -27,6 +27,7 @@ title: "@tanstack/lit-query" - [FetchNextPageOptions](interfaces/FetchNextPageOptions.md) - [FetchPreviousPageOptions](interfaces/FetchPreviousPageOptions.md) - [~~FetchQueryOptions~~](interfaces/FetchQueryOptions.md) +- [FocusManager](interfaces/FocusManager.md) - [HydrateOptions](interfaces/HydrateOptions.md) - [InfiniteData](interfaces/InfiniteData.md) - [InfiniteQueryObserverBaseResult](interfaces/InfiniteQueryObserverBaseResult.md) @@ -53,6 +54,7 @@ title: "@tanstack/lit-query" - [MutationOptions](interfaces/MutationOptions.md) - [MutationState](interfaces/MutationState.md) - [NotifyEvent](interfaces/NotifyEvent.md) +- [OnlineManager](interfaces/OnlineManager.md) - [QueriesObserverOptions](interfaces/QueriesObserverOptions.md) - [QueryCacheConfig](interfaces/QueryCacheConfig.md) - [QueryClientConfig](interfaces/QueryClientConfig.md) @@ -74,6 +76,7 @@ title: "@tanstack/lit-query" - [ResetOptions](interfaces/ResetOptions.md) - [ResultOptions](interfaces/ResultOptions.md) - [SetDataOptions](interfaces/SetDataOptions.md) +- [TimeoutManager](interfaces/TimeoutManager.md) ## Type Aliases diff --git a/docs/framework/lit/reference/interfaces/FocusManager.md b/docs/framework/lit/reference/interfaces/FocusManager.md new file mode 100644 index 00000000000..1ab81dc6357 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/FocusManager.md @@ -0,0 +1,237 @@ +--- +id: FocusManager +title: FocusManager +--- + +Defined in: [packages/query-core/src/focusManager.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L14) + +The `FocusManager` manages the focus state within TanStack Query. + +It can be used to change the default event listeners or to manually change the focus state. + +## Extends + +- `Subscribable`\<`Listener`\> + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### isFocused() + +```ts +isFocused(): boolean; +``` + +Defined in: [packages/query-core/src/focusManager.ts:128](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L128) + +`isFocused` can be used to get the current focus state. + +#### Returns + +`boolean` + +*** + +### onFocus() + +```ts +onFocus(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L118) + +`onFocus` notifies all subscribed listeners with the current focus state. + +#### Returns + +`void` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L39) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L45) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setEventListener() + +```ts +setEventListener(setup): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L77) + +`setEventListener` can be used to set a custom event listener that will +be used to determine the focus state. The provided `setup` function +receives a `setFocused` callback: call it with a `boolean` to manually +set the focus state, or with no arguments to re-evaluate the current +focus state and notify subscribers. + +#### Parameters + +##### setup + +`SetupFn` + +#### Returns + +`void` + +#### Example + +```ts +import { focusManager } from '@tanstack/query-core' + +focusManager.setEventListener((handleFocus) => { + const listener = () => handleFocus() + // Listen to visibilitychange + if (typeof window !== 'undefined' && window.addEventListener) { + window.addEventListener('visibilitychange', listener, false) + } + + return () => { + // Be sure to unsubscribe if a new handler is set + window.removeEventListener('visibilitychange', listener) + } +}) +``` + +*** + +### setFocused() + +```ts +setFocused(focused?): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:107](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L107) + +`setFocused` can be used to manually set the focus state. Set `undefined` +to fall back to the default focus check. + +#### Parameters + +##### focused? + +`boolean` + +#### Returns + +`void` + +#### Example + +```ts +import { focusManager } from '@tanstack/query-core' + +// Set focused +focusManager.setFocused(true) + +// Set unfocused +focusManager.setFocused(false) + +// Fallback to the default focus check +focusManager.setFocused(undefined) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`Listener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/lit/reference/interfaces/OnlineManager.md b/docs/framework/lit/reference/interfaces/OnlineManager.md new file mode 100644 index 00000000000..1a936c91ed9 --- /dev/null +++ b/docs/framework/lit/reference/interfaces/OnlineManager.md @@ -0,0 +1,214 @@ +--- +id: OnlineManager +title: OnlineManager +--- + +Defined in: [packages/query-core/src/onlineManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L15) + +The `OnlineManager` manages the online state within TanStack Query. It can +be used to change the default event listeners or to manually change the +online state. + +By default, the `onlineManager` assumes an active network connection, and +listens to the `online` and `offline` events on the `window` object to +detect changes. + +## Extends + +- `Subscribable`\<`Listener`\> + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### isOnline() + +```ts +isOnline(): boolean; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:109](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L109) + +`isOnline` can be used to get the current online state. + +#### Returns + +`boolean` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L44) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:50](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L50) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setEventListener() + +```ts +setEventListener(setup): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L75) + +`setEventListener` can be used to set a custom event listener that will +be used to determine the online state. The provided `setup` function +receives a `setOnline` callback that should be called with a `boolean` +whenever the online state changes. + +#### Parameters + +##### setup + +`SetupFn` + +#### Returns + +`void` + +#### Example + +```ts +import NetInfo from '@react-native-community/netinfo' +import { onlineManager } from '@tanstack/query-core' + +onlineManager.setEventListener((setOnline) => { + return NetInfo.addEventListener((state) => { + setOnline(!!state.isConnected) + }) +}) +``` + +*** + +### setOnline() + +```ts +setOnline(online): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L95) + +`setOnline` can be used to manually set the online state. + +#### Parameters + +##### online + +`boolean` + +#### Returns + +`void` + +#### Example + +```ts +import { onlineManager } from '@tanstack/query-core' + +// Set to online +onlineManager.setOnline(true) + +// Set to offline +onlineManager.setOnline(false) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`Listener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/lit/reference/interfaces/TimeoutManager.md b/docs/framework/lit/reference/interfaces/TimeoutManager.md new file mode 100644 index 00000000000..95ff07b2ccc --- /dev/null +++ b/docs/framework/lit/reference/interfaces/TimeoutManager.md @@ -0,0 +1,246 @@ +--- +id: TimeoutManager +title: TimeoutManager +--- + +Defined in: [packages/query-core/src/timeoutManager.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L70) + +Allows customization of how timeouts are created. + +@tanstack/query-core makes liberal use of timeouts to implement `staleTime` +and `gcTime`. The default TimeoutManager provider uses the platform's global +`setTimeout` implementation, which is known to have scalability issues with +thousands of timeouts on the event loop. + +If you hit this limitation, consider providing a custom TimeoutProvider that +coalesces timeouts. + +## Implements + +- `Omit`\<[`TimeoutProvider`](../type-aliases/TimeoutProvider.md), `"name"`\> + +## Methods + +### clearInterval() + +```ts +clearInterval(intervalId): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:224](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L224) + +`clearInterval` can be used to cancel an interval, like the global +`clearInterval` function. It should be called with an interval ID +returned by `setInterval`. + +#### Parameters + +##### intervalId + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) | `undefined` + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const intervalId = timeoutManager.setInterval( + () => console.log('ran at:', new Date()), + 1000, +) + +timeoutManager.clearInterval(intervalId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`clearInterval`](../type-aliases/TimeoutProvider.md#clearinterval) + +*** + +### clearTimeout() + +```ts +clearTimeout(timeoutId): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:179](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L179) + +`clearTimeout` cancels a timeout callback scheduled with `setTimeout`, +like the global `clearTimeout` function. It should be called with a +timer ID returned by `setTimeout`. + +#### Parameters + +##### timeoutId + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) | `undefined` + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const timeoutId = timeoutManager.setTimeout( + () => console.log('ran at:', new Date()), + 1000, +) + +timeoutManager.clearTimeout(timeoutId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`clearTimeout`](../type-aliases/TimeoutProvider.md#cleartimeout) + +*** + +### setInterval() + +```ts +setInterval(callback, delay): ManagedTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:200](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L200) + +`setInterval` schedules a callback to be called approximately every +`delay` milliseconds, like the global `setInterval` function. + +Like `setTimeout`, it returns a timer ID, which may be a number or an +object that can be coerced to a number via `Symbol.toPrimitive`. + +#### Parameters + +##### callback + +[`TimeoutCallback`](../type-aliases/TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const intervalId = timeoutManager.setInterval( + () => console.log('ran at:', new Date()), + 1000, +) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`setInterval`](../type-aliases/TimeoutProvider.md#setinterval) + +*** + +### setTimeout() + +```ts +setTimeout(callback, delay): ManagedTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:155](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L155) + +`setTimeout` schedules a callback to run after approximately `delay` +milliseconds, like the global `setTimeout` function. The callback can be +canceled with `clearTimeout`. + +It returns a timer ID, which may be a number or an object that can be +coerced to a number via `Symbol.toPrimitive`. + +#### Parameters + +##### callback + +[`TimeoutCallback`](../type-aliases/TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const timeoutId = timeoutManager.setTimeout( + () => console.log('ran at:', new Date()), + 1000, +) + +const timeoutIdNumber: number = Number(timeoutId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`setTimeout`](../type-aliases/TimeoutProvider.md#settimeout) + +*** + +### setTimeoutProvider() + +```ts +setTimeoutProvider(provider): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L106) + +`setTimeoutProvider` can be used to set a custom implementation of the +`setTimeout`, `clearTimeout`, `setInterval`, `clearInterval` functions, +called a `TimeoutProvider`. + +This may be useful if you notice event loop performance issues with +thousands of queries. A custom TimeoutProvider could also support timer +delays longer than the global `setTimeout` maximum delay value of about +24 days. + +It is important to call `setTimeoutProvider` before creating a +QueryClient or queries, so that the same provider is used consistently +for all timers in the application, since different TimeoutProviders +cannot cancel each others' timers. + +#### Type Parameters + +##### TTimerId + +`TTimerId` *extends* [`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Parameters + +##### provider + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md)\<`TTimerId`\> + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager, QueryClient } from '@tanstack/query-core' +import { CustomTimeoutProvider } from './CustomTimeoutProvider' + +timeoutManager.setTimeoutProvider(new CustomTimeoutProvider()) + +export const queryClient = new QueryClient() +``` diff --git a/docs/framework/lit/reference/type-aliases/TimeoutCallback.md b/docs/framework/lit/reference/type-aliases/TimeoutCallback.md index 387fb1238f3..773b5fdaeb9 100644 --- a/docs/framework/lit/reference/type-aliases/TimeoutCallback.md +++ b/docs/framework/lit/reference/type-aliases/TimeoutCallback.md @@ -9,7 +9,7 @@ type TimeoutCallback = (_) => void; Defined in: [packages/query-core/src/timeoutManager.ts:9](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L9) -TimeoutManager does not support passing arguments to the callback. +[TimeoutManager](../interfaces/TimeoutManager.md) does not support passing arguments to the callback. `(_: void)` is the argument type inferred by TypeScript's default typings for `setTimeout(cb, number)`. diff --git a/docs/framework/lit/reference/variables/focusManager.md b/docs/framework/lit/reference/variables/focusManager.md index cbf7fcb4a17..86477849e06 100644 --- a/docs/framework/lit/reference/variables/focusManager.md +++ b/docs/framework/lit/reference/variables/focusManager.md @@ -9,4 +9,4 @@ const focusManager: FocusManager; Defined in: [packages/query-core/src/focusManager.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L142) -Singleton instance of FocusManager, used to manage and observe the focus state within TanStack Query. +Singleton instance of [FocusManager](../interfaces/FocusManager.md), used to manage and observe the focus state within TanStack Query. diff --git a/docs/framework/lit/reference/variables/onlineManager.md b/docs/framework/lit/reference/variables/onlineManager.md index 4ae083f245b..2eeec5385d8 100644 --- a/docs/framework/lit/reference/variables/onlineManager.md +++ b/docs/framework/lit/reference/variables/onlineManager.md @@ -9,4 +9,4 @@ const onlineManager: OnlineManager; Defined in: [packages/query-core/src/onlineManager.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L117) -Singleton instance of OnlineManager, used to manage and observe the online state within TanStack Query. +Singleton instance of [OnlineManager](../interfaces/OnlineManager.md), used to manage and observe the online state within TanStack Query. diff --git a/docs/framework/lit/reference/variables/timeoutManager.md b/docs/framework/lit/reference/variables/timeoutManager.md index ef9cca969e9..1eca1a5f343 100644 --- a/docs/framework/lit/reference/variables/timeoutManager.md +++ b/docs/framework/lit/reference/variables/timeoutManager.md @@ -9,4 +9,4 @@ const timeoutManager: TimeoutManager; Defined in: [packages/query-core/src/timeoutManager.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L232) -Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. +Singleton instance of [TimeoutManager](../interfaces/TimeoutManager.md), used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/preact/guides/ssr.md b/docs/framework/preact/guides/ssr.md index 2367e0c336e..b01c174b318 100644 --- a/docs/framework/preact/guides/ssr.md +++ b/docs/framework/preact/guides/ssr.md @@ -360,6 +360,6 @@ On the server, `gcTime` defaults to `Infinity` which disables manual garbage col Avoid setting `gcTime` to `0` as it may result in a hydration error. This occurs because the [Hydration Boundary](../reference/functions/HydrationBoundary.md) places necessary data into the cache for rendering, but if the garbage collector removes the data before the rendering completes, issues may arise. If you require a shorter `gcTime`, we recommend setting it to `2 * 1000` to allow sufficient time for the app to reference the data. -To clear the cache after it is not needed and to lower memory consumption, you can add a call to [`queryClient.clear()`](../../../reference/QueryClient.md#queryclientclear) after the request is handled and dehydrated state has been sent to the client. +To clear the cache after it is not needed and to lower memory consumption, you can add a call to [`queryClient.clear()`](../reference/classes/QueryClient.md#clear) after the request is handled and dehydrated state has been sent to the client. Alternatively, you can set a smaller `gcTime`. diff --git a/docs/framework/preact/reference/index.md b/docs/framework/preact/reference/index.md index 14a2820a2d3..2ca0ffb9238 100644 --- a/docs/framework/preact/reference/index.md +++ b/docs/framework/preact/reference/index.md @@ -26,6 +26,7 @@ title: "@tanstack/preact-query" - [FetchNextPageOptions](interfaces/FetchNextPageOptions.md) - [FetchPreviousPageOptions](interfaces/FetchPreviousPageOptions.md) - [~~FetchQueryOptions~~](interfaces/FetchQueryOptions.md) +- [FocusManager](interfaces/FocusManager.md) - [HydrateOptions](interfaces/HydrateOptions.md) - [HydrationBoundaryProps](interfaces/HydrationBoundaryProps.md) - [InfiniteData](interfaces/InfiniteData.md) @@ -53,6 +54,7 @@ title: "@tanstack/preact-query" - [MutationOptions](interfaces/MutationOptions.md) - [MutationState](interfaces/MutationState.md) - [NotifyEvent](interfaces/NotifyEvent.md) +- [OnlineManager](interfaces/OnlineManager.md) - [QueriesObserverOptions](interfaces/QueriesObserverOptions.md) - [QueryCacheConfig](interfaces/QueryCacheConfig.md) - [QueryClientConfig](interfaces/QueryClientConfig.md) @@ -75,6 +77,7 @@ title: "@tanstack/preact-query" - [ResetOptions](interfaces/ResetOptions.md) - [ResultOptions](interfaces/ResultOptions.md) - [SetDataOptions](interfaces/SetDataOptions.md) +- [TimeoutManager](interfaces/TimeoutManager.md) - [UseBaseQueryOptions](interfaces/UseBaseQueryOptions.md) - [UseInfiniteQueryOptions](interfaces/UseInfiniteQueryOptions.md) - [UseMutationOptions](interfaces/UseMutationOptions.md) diff --git a/docs/framework/preact/reference/interfaces/FocusManager.md b/docs/framework/preact/reference/interfaces/FocusManager.md new file mode 100644 index 00000000000..1ab81dc6357 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/FocusManager.md @@ -0,0 +1,237 @@ +--- +id: FocusManager +title: FocusManager +--- + +Defined in: [packages/query-core/src/focusManager.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L14) + +The `FocusManager` manages the focus state within TanStack Query. + +It can be used to change the default event listeners or to manually change the focus state. + +## Extends + +- `Subscribable`\<`Listener`\> + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### isFocused() + +```ts +isFocused(): boolean; +``` + +Defined in: [packages/query-core/src/focusManager.ts:128](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L128) + +`isFocused` can be used to get the current focus state. + +#### Returns + +`boolean` + +*** + +### onFocus() + +```ts +onFocus(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L118) + +`onFocus` notifies all subscribed listeners with the current focus state. + +#### Returns + +`void` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L39) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L45) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setEventListener() + +```ts +setEventListener(setup): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L77) + +`setEventListener` can be used to set a custom event listener that will +be used to determine the focus state. The provided `setup` function +receives a `setFocused` callback: call it with a `boolean` to manually +set the focus state, or with no arguments to re-evaluate the current +focus state and notify subscribers. + +#### Parameters + +##### setup + +`SetupFn` + +#### Returns + +`void` + +#### Example + +```ts +import { focusManager } from '@tanstack/query-core' + +focusManager.setEventListener((handleFocus) => { + const listener = () => handleFocus() + // Listen to visibilitychange + if (typeof window !== 'undefined' && window.addEventListener) { + window.addEventListener('visibilitychange', listener, false) + } + + return () => { + // Be sure to unsubscribe if a new handler is set + window.removeEventListener('visibilitychange', listener) + } +}) +``` + +*** + +### setFocused() + +```ts +setFocused(focused?): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:107](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L107) + +`setFocused` can be used to manually set the focus state. Set `undefined` +to fall back to the default focus check. + +#### Parameters + +##### focused? + +`boolean` + +#### Returns + +`void` + +#### Example + +```ts +import { focusManager } from '@tanstack/query-core' + +// Set focused +focusManager.setFocused(true) + +// Set unfocused +focusManager.setFocused(false) + +// Fallback to the default focus check +focusManager.setFocused(undefined) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`Listener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/preact/reference/interfaces/OnlineManager.md b/docs/framework/preact/reference/interfaces/OnlineManager.md new file mode 100644 index 00000000000..1a936c91ed9 --- /dev/null +++ b/docs/framework/preact/reference/interfaces/OnlineManager.md @@ -0,0 +1,214 @@ +--- +id: OnlineManager +title: OnlineManager +--- + +Defined in: [packages/query-core/src/onlineManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L15) + +The `OnlineManager` manages the online state within TanStack Query. It can +be used to change the default event listeners or to manually change the +online state. + +By default, the `onlineManager` assumes an active network connection, and +listens to the `online` and `offline` events on the `window` object to +detect changes. + +## Extends + +- `Subscribable`\<`Listener`\> + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### isOnline() + +```ts +isOnline(): boolean; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:109](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L109) + +`isOnline` can be used to get the current online state. + +#### Returns + +`boolean` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L44) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:50](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L50) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setEventListener() + +```ts +setEventListener(setup): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L75) + +`setEventListener` can be used to set a custom event listener that will +be used to determine the online state. The provided `setup` function +receives a `setOnline` callback that should be called with a `boolean` +whenever the online state changes. + +#### Parameters + +##### setup + +`SetupFn` + +#### Returns + +`void` + +#### Example + +```ts +import NetInfo from '@react-native-community/netinfo' +import { onlineManager } from '@tanstack/query-core' + +onlineManager.setEventListener((setOnline) => { + return NetInfo.addEventListener((state) => { + setOnline(!!state.isConnected) + }) +}) +``` + +*** + +### setOnline() + +```ts +setOnline(online): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L95) + +`setOnline` can be used to manually set the online state. + +#### Parameters + +##### online + +`boolean` + +#### Returns + +`void` + +#### Example + +```ts +import { onlineManager } from '@tanstack/query-core' + +// Set to online +onlineManager.setOnline(true) + +// Set to offline +onlineManager.setOnline(false) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`Listener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/preact/reference/interfaces/TimeoutManager.md b/docs/framework/preact/reference/interfaces/TimeoutManager.md new file mode 100644 index 00000000000..95ff07b2ccc --- /dev/null +++ b/docs/framework/preact/reference/interfaces/TimeoutManager.md @@ -0,0 +1,246 @@ +--- +id: TimeoutManager +title: TimeoutManager +--- + +Defined in: [packages/query-core/src/timeoutManager.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L70) + +Allows customization of how timeouts are created. + +@tanstack/query-core makes liberal use of timeouts to implement `staleTime` +and `gcTime`. The default TimeoutManager provider uses the platform's global +`setTimeout` implementation, which is known to have scalability issues with +thousands of timeouts on the event loop. + +If you hit this limitation, consider providing a custom TimeoutProvider that +coalesces timeouts. + +## Implements + +- `Omit`\<[`TimeoutProvider`](../type-aliases/TimeoutProvider.md), `"name"`\> + +## Methods + +### clearInterval() + +```ts +clearInterval(intervalId): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:224](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L224) + +`clearInterval` can be used to cancel an interval, like the global +`clearInterval` function. It should be called with an interval ID +returned by `setInterval`. + +#### Parameters + +##### intervalId + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) | `undefined` + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const intervalId = timeoutManager.setInterval( + () => console.log('ran at:', new Date()), + 1000, +) + +timeoutManager.clearInterval(intervalId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`clearInterval`](../type-aliases/TimeoutProvider.md#clearinterval) + +*** + +### clearTimeout() + +```ts +clearTimeout(timeoutId): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:179](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L179) + +`clearTimeout` cancels a timeout callback scheduled with `setTimeout`, +like the global `clearTimeout` function. It should be called with a +timer ID returned by `setTimeout`. + +#### Parameters + +##### timeoutId + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) | `undefined` + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const timeoutId = timeoutManager.setTimeout( + () => console.log('ran at:', new Date()), + 1000, +) + +timeoutManager.clearTimeout(timeoutId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`clearTimeout`](../type-aliases/TimeoutProvider.md#cleartimeout) + +*** + +### setInterval() + +```ts +setInterval(callback, delay): ManagedTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:200](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L200) + +`setInterval` schedules a callback to be called approximately every +`delay` milliseconds, like the global `setInterval` function. + +Like `setTimeout`, it returns a timer ID, which may be a number or an +object that can be coerced to a number via `Symbol.toPrimitive`. + +#### Parameters + +##### callback + +[`TimeoutCallback`](../type-aliases/TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const intervalId = timeoutManager.setInterval( + () => console.log('ran at:', new Date()), + 1000, +) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`setInterval`](../type-aliases/TimeoutProvider.md#setinterval) + +*** + +### setTimeout() + +```ts +setTimeout(callback, delay): ManagedTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:155](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L155) + +`setTimeout` schedules a callback to run after approximately `delay` +milliseconds, like the global `setTimeout` function. The callback can be +canceled with `clearTimeout`. + +It returns a timer ID, which may be a number or an object that can be +coerced to a number via `Symbol.toPrimitive`. + +#### Parameters + +##### callback + +[`TimeoutCallback`](../type-aliases/TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const timeoutId = timeoutManager.setTimeout( + () => console.log('ran at:', new Date()), + 1000, +) + +const timeoutIdNumber: number = Number(timeoutId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`setTimeout`](../type-aliases/TimeoutProvider.md#settimeout) + +*** + +### setTimeoutProvider() + +```ts +setTimeoutProvider(provider): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L106) + +`setTimeoutProvider` can be used to set a custom implementation of the +`setTimeout`, `clearTimeout`, `setInterval`, `clearInterval` functions, +called a `TimeoutProvider`. + +This may be useful if you notice event loop performance issues with +thousands of queries. A custom TimeoutProvider could also support timer +delays longer than the global `setTimeout` maximum delay value of about +24 days. + +It is important to call `setTimeoutProvider` before creating a +QueryClient or queries, so that the same provider is used consistently +for all timers in the application, since different TimeoutProviders +cannot cancel each others' timers. + +#### Type Parameters + +##### TTimerId + +`TTimerId` *extends* [`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Parameters + +##### provider + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md)\<`TTimerId`\> + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager, QueryClient } from '@tanstack/query-core' +import { CustomTimeoutProvider } from './CustomTimeoutProvider' + +timeoutManager.setTimeoutProvider(new CustomTimeoutProvider()) + +export const queryClient = new QueryClient() +``` diff --git a/docs/framework/preact/reference/type-aliases/TimeoutCallback.md b/docs/framework/preact/reference/type-aliases/TimeoutCallback.md index 387fb1238f3..773b5fdaeb9 100644 --- a/docs/framework/preact/reference/type-aliases/TimeoutCallback.md +++ b/docs/framework/preact/reference/type-aliases/TimeoutCallback.md @@ -9,7 +9,7 @@ type TimeoutCallback = (_) => void; Defined in: [packages/query-core/src/timeoutManager.ts:9](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L9) -TimeoutManager does not support passing arguments to the callback. +[TimeoutManager](../interfaces/TimeoutManager.md) does not support passing arguments to the callback. `(_: void)` is the argument type inferred by TypeScript's default typings for `setTimeout(cb, number)`. diff --git a/docs/framework/preact/reference/variables/focusManager.md b/docs/framework/preact/reference/variables/focusManager.md index cbf7fcb4a17..86477849e06 100644 --- a/docs/framework/preact/reference/variables/focusManager.md +++ b/docs/framework/preact/reference/variables/focusManager.md @@ -9,4 +9,4 @@ const focusManager: FocusManager; Defined in: [packages/query-core/src/focusManager.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L142) -Singleton instance of FocusManager, used to manage and observe the focus state within TanStack Query. +Singleton instance of [FocusManager](../interfaces/FocusManager.md), used to manage and observe the focus state within TanStack Query. diff --git a/docs/framework/preact/reference/variables/onlineManager.md b/docs/framework/preact/reference/variables/onlineManager.md index 4ae083f245b..2eeec5385d8 100644 --- a/docs/framework/preact/reference/variables/onlineManager.md +++ b/docs/framework/preact/reference/variables/onlineManager.md @@ -9,4 +9,4 @@ const onlineManager: OnlineManager; Defined in: [packages/query-core/src/onlineManager.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L117) -Singleton instance of OnlineManager, used to manage and observe the online state within TanStack Query. +Singleton instance of [OnlineManager](../interfaces/OnlineManager.md), used to manage and observe the online state within TanStack Query. diff --git a/docs/framework/preact/reference/variables/timeoutManager.md b/docs/framework/preact/reference/variables/timeoutManager.md index ef9cca969e9..1eca1a5f343 100644 --- a/docs/framework/preact/reference/variables/timeoutManager.md +++ b/docs/framework/preact/reference/variables/timeoutManager.md @@ -9,4 +9,4 @@ const timeoutManager: TimeoutManager; Defined in: [packages/query-core/src/timeoutManager.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L232) -Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. +Singleton instance of [TimeoutManager](../interfaces/TimeoutManager.md), used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/react/guides/migrating-to-react-query-4.md b/docs/framework/react/guides/migrating-to-react-query-4.md index 0735d8c58b2..0a6cbe5805c 100644 --- a/docs/framework/react/guides/migrating-to-react-query-4.md +++ b/docs/framework/react/guides/migrating-to-react-query-4.md @@ -242,7 +242,7 @@ The filter defaults to `all`, and you can choose to only match `active` or `inac #### refetchActive / refetchInactive -[queryClient.invalidateQueries](../../../reference/QueryClient.md#queryclientinvalidatequeries) had two additional, similar flags: +[queryClient.invalidateQueries](../reference/classes/QueryClient.md#invalidatequeries) had two additional, similar flags: ``` refetchActive: Boolean @@ -427,7 +427,7 @@ React Query defaults to "tracking" query properties, which should give you a nic ### Bailing out of updates with setQueryData -When using the [functional updater form of setQueryData](../../../reference/QueryClient.md#queryclientsetquerydata), you can now bail out of the update by returning `undefined`. This is helpful if `undefined` is given to you as `previousValue`, which means that currently, no cached entry exists and you don't want to / cannot create one, like in the example of toggling a todo: +When using the [functional updater form of setQueryData](../reference/classes/QueryClient.md#setquerydata), you can now bail out of the update by returning `undefined`. This is helpful if `undefined` is given to you as `previousValue`, which means that currently, no cached entry exists and you don't want to / cannot create one, like in the example of toggling a todo: ```tsx queryClient.setQueryData(['todo', id], (previousTodo) => diff --git a/docs/framework/react/guides/mutations.md b/docs/framework/react/guides/mutations.md index c7b71c46f6d..abfececc98f 100644 --- a/docs/framework/react/guides/mutations.md +++ b/docs/framework/react/guides/mutations.md @@ -59,7 +59,7 @@ Beyond those primary states, more information is available depending on the stat In the example above, you also saw that you can pass variables to your mutations function by calling the `mutate` function with a **single variable or object**. -Even with just variables, mutations aren't all that special, but when used with the `onSuccess` option, the [Query Client's `invalidateQueries` method](../../../reference/QueryClient.md#queryclientinvalidatequeries) and the [Query Client's `setQueryData` method](../../../reference/QueryClient.md#queryclientsetquerydata), mutations become a very powerful tool. +Even with just variables, mutations aren't all that special, but when used with the `onSuccess` option, the [Query Client's `invalidateQueries` method](../reference/classes/QueryClient.md#invalidatequeries) and the [Query Client's `setQueryData` method](../reference/classes/QueryClient.md#setquerydata), mutations become a very powerful tool. [//]: # 'Info1' diff --git a/docs/framework/react/guides/network-mode.md b/docs/framework/react/guides/network-mode.md index 6457f6b1458..0e9a7183eb3 100644 --- a/docs/framework/react/guides/network-mode.md +++ b/docs/framework/react/guides/network-mode.md @@ -37,7 +37,7 @@ In those situations, the first fetch might succeed because it comes from an offl ## Devtools -The [TanStack Query Devtools](../devtools.md) will show Queries in a `paused` state if they would be fetching, but there is no network connection. There is also a toggle button to _Mock offline behavior_. Please note that this button will _not_ actually mess with your network connection (you can do that in the browser devtools), but it will set the [OnlineManager](../../../reference/onlineManager.md) in an offline state. +The [TanStack Query Devtools](../devtools.md) will show Queries in a `paused` state if they would be fetching, but there is no network connection. There is also a toggle button to _Mock offline behavior_. Please note that this button will _not_ actually mess with your network connection (you can do that in the browser devtools), but it will set the [OnlineManager](../reference/interfaces/OnlineManager.md) in an offline state. ## Signature diff --git a/docs/framework/react/guides/prefetching.md b/docs/framework/react/guides/prefetching.md index 5b5260838dc..917f2d44097 100644 --- a/docs/framework/react/guides/prefetching.md +++ b/docs/framework/react/guides/prefetching.md @@ -448,7 +448,7 @@ Integration with other routers is also possible, see the [react-router](../examp ## Manually Priming a Query -If you already have the data for your query synchronously available, you don't need to prefetch it. You can just use the [Query Client's `setQueryData` method](../../../reference/QueryClient.md#queryclientsetquerydata) to directly add or update a query's cached result by key. +If you already have the data for your query synchronously available, you don't need to prefetch it. You can just use the [Query Client's `setQueryData` method](../reference/classes/QueryClient.md#setquerydata) to directly add or update a query's cached result by key. [//]: # 'ExampleManualPriming' diff --git a/docs/framework/react/guides/query-functions.md b/docs/framework/react/guides/query-functions.md index e121bab54a2..ab7cf0aada7 100644 --- a/docs/framework/react/guides/query-functions.md +++ b/docs/framework/react/guides/query-functions.md @@ -102,7 +102,7 @@ function fetchTodoList({ queryKey }) { The `QueryFunctionContext` is the object passed to each query function. It consists of: - `queryKey: QueryKey`: [Query Keys](./query-keys.md) -- `client: QueryClient`: [QueryClient](../../../reference/QueryClient.md) +- `client: QueryClient`: [QueryClient](../reference/classes/QueryClient.md) - `signal?: AbortSignal` - [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) instance provided by TanStack Query - Can be used for [Query Cancellation](./query-cancellation.md) diff --git a/docs/framework/react/guides/ssr.md b/docs/framework/react/guides/ssr.md index 7a30d8e77a8..95792f21ac9 100644 --- a/docs/framework/react/guides/ssr.md +++ b/docs/framework/react/guides/ssr.md @@ -556,7 +556,7 @@ On the server, `gcTime` defaults to `Infinity` which disables manual garbage col Avoid setting `gcTime` to `0` as it may result in a hydration error. This occurs because the [Hydration Boundary](../reference/functions/HydrationBoundary.md) places necessary data into the cache for rendering, but if the garbage collector removes the data before the rendering completes, issues may arise. If you require a shorter `gcTime`, we recommend setting it to `2 * 1000` to allow sufficient time for the app to reference the data. -To clear the cache after it is not needed and to lower memory consumption, you can add a call to [`queryClient.clear()`](../../../reference/QueryClient.md#queryclientclear) after the request is handled and dehydrated state has been sent to the client. +To clear the cache after it is not needed and to lower memory consumption, you can add a call to [`queryClient.clear()`](../reference/classes/QueryClient.md#clear) after the request is handled and dehydrated state has been sent to the client. Alternatively, you can set a smaller `gcTime`. diff --git a/docs/framework/react/guides/updates-from-mutation-responses.md b/docs/framework/react/guides/updates-from-mutation-responses.md index f3a582805df..4e744d92c70 100644 --- a/docs/framework/react/guides/updates-from-mutation-responses.md +++ b/docs/framework/react/guides/updates-from-mutation-responses.md @@ -3,7 +3,7 @@ id: updates-from-mutation-responses title: Updates from Mutation Responses --- -When dealing with mutations that **update** objects on the server, it's common for the new object to be automatically returned in the response of the mutation. Instead of refetching any queries for that item and wasting a network call for data we already have, we can take advantage of the object returned by the mutation function and update the existing query with the new data immediately using the [Query Client's `setQueryData`](../../../reference/QueryClient.md#queryclientsetquerydata) method: +When dealing with mutations that **update** objects on the server, it's common for the new object to be automatically returned in the response of the mutation. Instead of refetching any queries for that item and wasting a network call for data we already have, we can take advantage of the object returned by the mutation function and update the existing query with the new data immediately using the [Query Client's `setQueryData`](../reference/classes/QueryClient.md#setquerydata) method: [//]: # 'Example' diff --git a/docs/framework/react/plugins/persistQueryClient.md b/docs/framework/react/plugins/persistQueryClient.md index 2dc8a86e187..2597610f356 100644 --- a/docs/framework/react/plugins/persistQueryClient.md +++ b/docs/framework/react/plugins/persistQueryClient.md @@ -21,7 +21,7 @@ It should be set as the same value or higher than persistQueryClient's `maxAge` You can also pass it `Infinity` to disable garbage collection behavior entirely. -Due to a JavaScript limitation, the maximum allowed `gcTime` is about [24 days](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#maximum_delay_value), although it is possible to work around this limit using [timeoutManager.setTimeoutProvider](../../../reference/timeoutManager.md#timeoutmanagersettimeoutprovider). +Due to a JavaScript limitation, the maximum allowed `gcTime` is about [24 days](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#maximum_delay_value), although it is possible to work around this limit using [timeoutManager.setTimeoutProvider](../reference/interfaces/TimeoutManager.md#settimeoutprovider). ```tsx const queryClient = new QueryClient({ @@ -217,7 +217,7 @@ ReactDOM.createRoot(rootElement).render( - `onSuccess?: () => Promise | unknown` - optional - will be called when the initial restore is finished - - can be used to [resumePausedMutations](../../../reference/QueryClient.md#queryclientresumepausedmutations) + - can be used to [resumePausedMutations](../reference/classes/QueryClient.md#resumepausedmutations) - if a Promise is returned, it will be awaited; restoring is seen as ongoing until then - `onError?: () => Promise | unknown` - optional diff --git a/docs/framework/react/reference/classes/InfiniteQueryObserver.md b/docs/framework/react/reference/classes/InfiniteQueryObserver.md index af43087a3ad..4ced8b25507 100644 --- a/docs/framework/react/reference/classes/InfiniteQueryObserver.md +++ b/docs/framework/react/reference/classes/InfiniteQueryObserver.md @@ -1,6 +1,9 @@ --- id: InfiniteQueryObserver title: InfiniteQueryObserver +redirect_from: + - reference/InfiniteQueryObserver + - framework/react/reference/InfiniteQueryObserver --- Defined in: [packages/query-core/src/infiniteQueryObserver.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L41) diff --git a/docs/framework/react/reference/classes/MutationCache.md b/docs/framework/react/reference/classes/MutationCache.md index 5a172b4cb9b..039964564e8 100644 --- a/docs/framework/react/reference/classes/MutationCache.md +++ b/docs/framework/react/reference/classes/MutationCache.md @@ -1,6 +1,9 @@ --- id: MutationCache title: MutationCache +redirect_from: + - reference/MutationCache + - framework/react/reference/MutationCache --- Defined in: [packages/query-core/src/mutationCache.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L124) diff --git a/docs/framework/react/reference/classes/QueriesObserver.md b/docs/framework/react/reference/classes/QueriesObserver.md index a40f2d2bef6..80067b16446 100644 --- a/docs/framework/react/reference/classes/QueriesObserver.md +++ b/docs/framework/react/reference/classes/QueriesObserver.md @@ -1,6 +1,9 @@ --- id: QueriesObserver title: QueriesObserver +redirect_from: + - reference/QueriesObserver + - framework/react/reference/QueriesObserver --- Defined in: [packages/query-core/src/queriesObserver.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L54) diff --git a/docs/framework/react/reference/classes/QueryCache.md b/docs/framework/react/reference/classes/QueryCache.md index b7a577b5e54..2db75a8c01b 100644 --- a/docs/framework/react/reference/classes/QueryCache.md +++ b/docs/framework/react/reference/classes/QueryCache.md @@ -1,6 +1,9 @@ --- id: QueryCache title: QueryCache +redirect_from: + - reference/QueryCache + - framework/react/reference/QueryCache --- Defined in: [packages/query-core/src/queryCache.ts:123](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L123) diff --git a/docs/framework/react/reference/classes/QueryClient.md b/docs/framework/react/reference/classes/QueryClient.md index c7d1a034545..a713a69deab 100644 --- a/docs/framework/react/reference/classes/QueryClient.md +++ b/docs/framework/react/reference/classes/QueryClient.md @@ -1,6 +1,9 @@ --- id: QueryClient title: QueryClient +redirect_from: + - reference/QueryClient + - framework/react/reference/QueryClient --- Defined in: [packages/query-core/src/queryClient.ts:79](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L79) diff --git a/docs/framework/react/reference/classes/QueryObserver.md b/docs/framework/react/reference/classes/QueryObserver.md index 51ff16910df..938ddc396e6 100644 --- a/docs/framework/react/reference/classes/QueryObserver.md +++ b/docs/framework/react/reference/classes/QueryObserver.md @@ -1,6 +1,9 @@ --- id: QueryObserver title: QueryObserver +redirect_from: + - reference/QueryObserver + - framework/react/reference/QueryObserver --- Defined in: [packages/query-core/src/queryObserver.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L57) diff --git a/docs/framework/react/reference/functions/experimental_streamedQuery.md b/docs/framework/react/reference/functions/experimental_streamedQuery.md index 4c490322d60..c535a8664d8 100644 --- a/docs/framework/react/reference/functions/experimental_streamedQuery.md +++ b/docs/framework/react/reference/functions/experimental_streamedQuery.md @@ -1,6 +1,8 @@ --- id: experimental_streamedQuery title: experimental_streamedQuery +redirect_from: + - reference/streamedQuery --- ```ts diff --git a/docs/framework/react/reference/index.md b/docs/framework/react/reference/index.md index 823c518e2e7..a4d49eff695 100644 --- a/docs/framework/react/reference/index.md +++ b/docs/framework/react/reference/index.md @@ -26,6 +26,7 @@ title: "@tanstack/react-query" - [FetchNextPageOptions](interfaces/FetchNextPageOptions.md) - [FetchPreviousPageOptions](interfaces/FetchPreviousPageOptions.md) - [~~FetchQueryOptions~~](interfaces/FetchQueryOptions.md) +- [FocusManager](interfaces/FocusManager.md) - [HydrateOptions](interfaces/HydrateOptions.md) - [HydrationBoundaryProps](interfaces/HydrationBoundaryProps.md) - [InfiniteData](interfaces/InfiniteData.md) @@ -53,6 +54,7 @@ title: "@tanstack/react-query" - [MutationOptions](interfaces/MutationOptions.md) - [MutationState](interfaces/MutationState.md) - [NotifyEvent](interfaces/NotifyEvent.md) +- [OnlineManager](interfaces/OnlineManager.md) - [QueriesObserverOptions](interfaces/QueriesObserverOptions.md) - [QueryCacheConfig](interfaces/QueryCacheConfig.md) - [QueryClientConfig](interfaces/QueryClientConfig.md) @@ -75,6 +77,7 @@ title: "@tanstack/react-query" - [ResetOptions](interfaces/ResetOptions.md) - [ResultOptions](interfaces/ResultOptions.md) - [SetDataOptions](interfaces/SetDataOptions.md) +- [TimeoutManager](interfaces/TimeoutManager.md) - [UseBaseQueryOptions](interfaces/UseBaseQueryOptions.md) - [UseInfiniteQueryOptions](interfaces/UseInfiniteQueryOptions.md) - [UseMutationOptions](interfaces/UseMutationOptions.md) diff --git a/docs/framework/react/reference/interfaces/FocusManager.md b/docs/framework/react/reference/interfaces/FocusManager.md new file mode 100644 index 00000000000..a7de707217d --- /dev/null +++ b/docs/framework/react/reference/interfaces/FocusManager.md @@ -0,0 +1,240 @@ +--- +id: FocusManager +title: FocusManager +redirect_from: + - reference/focusManager + - framework/react/reference/focusManager +--- + +Defined in: [packages/query-core/src/focusManager.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L14) + +The `FocusManager` manages the focus state within TanStack Query. + +It can be used to change the default event listeners or to manually change the focus state. + +## Extends + +- `Subscribable`\<`Listener`\> + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### isFocused() + +```ts +isFocused(): boolean; +``` + +Defined in: [packages/query-core/src/focusManager.ts:128](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L128) + +`isFocused` can be used to get the current focus state. + +#### Returns + +`boolean` + +*** + +### onFocus() + +```ts +onFocus(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L118) + +`onFocus` notifies all subscribed listeners with the current focus state. + +#### Returns + +`void` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L39) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L45) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setEventListener() + +```ts +setEventListener(setup): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L77) + +`setEventListener` can be used to set a custom event listener that will +be used to determine the focus state. The provided `setup` function +receives a `setFocused` callback: call it with a `boolean` to manually +set the focus state, or with no arguments to re-evaluate the current +focus state and notify subscribers. + +#### Parameters + +##### setup + +`SetupFn` + +#### Returns + +`void` + +#### Example + +```ts +import { focusManager } from '@tanstack/query-core' + +focusManager.setEventListener((handleFocus) => { + const listener = () => handleFocus() + // Listen to visibilitychange + if (typeof window !== 'undefined' && window.addEventListener) { + window.addEventListener('visibilitychange', listener, false) + } + + return () => { + // Be sure to unsubscribe if a new handler is set + window.removeEventListener('visibilitychange', listener) + } +}) +``` + +*** + +### setFocused() + +```ts +setFocused(focused?): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:107](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L107) + +`setFocused` can be used to manually set the focus state. Set `undefined` +to fall back to the default focus check. + +#### Parameters + +##### focused? + +`boolean` + +#### Returns + +`void` + +#### Example + +```ts +import { focusManager } from '@tanstack/query-core' + +// Set focused +focusManager.setFocused(true) + +// Set unfocused +focusManager.setFocused(false) + +// Fallback to the default focus check +focusManager.setFocused(undefined) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`Listener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/react/reference/interfaces/OnlineManager.md b/docs/framework/react/reference/interfaces/OnlineManager.md new file mode 100644 index 00000000000..dcb42eefdfa --- /dev/null +++ b/docs/framework/react/reference/interfaces/OnlineManager.md @@ -0,0 +1,217 @@ +--- +id: OnlineManager +title: OnlineManager +redirect_from: + - reference/onlineManager + - framework/react/reference/onlineManager +--- + +Defined in: [packages/query-core/src/onlineManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L15) + +The `OnlineManager` manages the online state within TanStack Query. It can +be used to change the default event listeners or to manually change the +online state. + +By default, the `onlineManager` assumes an active network connection, and +listens to the `online` and `offline` events on the `window` object to +detect changes. + +## Extends + +- `Subscribable`\<`Listener`\> + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### isOnline() + +```ts +isOnline(): boolean; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:109](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L109) + +`isOnline` can be used to get the current online state. + +#### Returns + +`boolean` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L44) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:50](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L50) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setEventListener() + +```ts +setEventListener(setup): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L75) + +`setEventListener` can be used to set a custom event listener that will +be used to determine the online state. The provided `setup` function +receives a `setOnline` callback that should be called with a `boolean` +whenever the online state changes. + +#### Parameters + +##### setup + +`SetupFn` + +#### Returns + +`void` + +#### Example + +```ts +import NetInfo from '@react-native-community/netinfo' +import { onlineManager } from '@tanstack/query-core' + +onlineManager.setEventListener((setOnline) => { + return NetInfo.addEventListener((state) => { + setOnline(!!state.isConnected) + }) +}) +``` + +*** + +### setOnline() + +```ts +setOnline(online): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L95) + +`setOnline` can be used to manually set the online state. + +#### Parameters + +##### online + +`boolean` + +#### Returns + +`void` + +#### Example + +```ts +import { onlineManager } from '@tanstack/query-core' + +// Set to online +onlineManager.setOnline(true) + +// Set to offline +onlineManager.setOnline(false) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`Listener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/react/reference/interfaces/TimeoutManager.md b/docs/framework/react/reference/interfaces/TimeoutManager.md new file mode 100644 index 00000000000..d97ee3f4aef --- /dev/null +++ b/docs/framework/react/reference/interfaces/TimeoutManager.md @@ -0,0 +1,248 @@ +--- +id: TimeoutManager +title: TimeoutManager +redirect_from: + - reference/timeoutManager +--- + +Defined in: [packages/query-core/src/timeoutManager.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L70) + +Allows customization of how timeouts are created. + +@tanstack/query-core makes liberal use of timeouts to implement `staleTime` +and `gcTime`. The default TimeoutManager provider uses the platform's global +`setTimeout` implementation, which is known to have scalability issues with +thousands of timeouts on the event loop. + +If you hit this limitation, consider providing a custom TimeoutProvider that +coalesces timeouts. + +## Implements + +- `Omit`\<[`TimeoutProvider`](../type-aliases/TimeoutProvider.md), `"name"`\> + +## Methods + +### clearInterval() + +```ts +clearInterval(intervalId): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:224](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L224) + +`clearInterval` can be used to cancel an interval, like the global +`clearInterval` function. It should be called with an interval ID +returned by `setInterval`. + +#### Parameters + +##### intervalId + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) | `undefined` + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const intervalId = timeoutManager.setInterval( + () => console.log('ran at:', new Date()), + 1000, +) + +timeoutManager.clearInterval(intervalId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`clearInterval`](../type-aliases/TimeoutProvider.md#clearinterval) + +*** + +### clearTimeout() + +```ts +clearTimeout(timeoutId): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:179](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L179) + +`clearTimeout` cancels a timeout callback scheduled with `setTimeout`, +like the global `clearTimeout` function. It should be called with a +timer ID returned by `setTimeout`. + +#### Parameters + +##### timeoutId + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) | `undefined` + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const timeoutId = timeoutManager.setTimeout( + () => console.log('ran at:', new Date()), + 1000, +) + +timeoutManager.clearTimeout(timeoutId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`clearTimeout`](../type-aliases/TimeoutProvider.md#cleartimeout) + +*** + +### setInterval() + +```ts +setInterval(callback, delay): ManagedTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:200](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L200) + +`setInterval` schedules a callback to be called approximately every +`delay` milliseconds, like the global `setInterval` function. + +Like `setTimeout`, it returns a timer ID, which may be a number or an +object that can be coerced to a number via `Symbol.toPrimitive`. + +#### Parameters + +##### callback + +[`TimeoutCallback`](../type-aliases/TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const intervalId = timeoutManager.setInterval( + () => console.log('ran at:', new Date()), + 1000, +) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`setInterval`](../type-aliases/TimeoutProvider.md#setinterval) + +*** + +### setTimeout() + +```ts +setTimeout(callback, delay): ManagedTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:155](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L155) + +`setTimeout` schedules a callback to run after approximately `delay` +milliseconds, like the global `setTimeout` function. The callback can be +canceled with `clearTimeout`. + +It returns a timer ID, which may be a number or an object that can be +coerced to a number via `Symbol.toPrimitive`. + +#### Parameters + +##### callback + +[`TimeoutCallback`](../type-aliases/TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const timeoutId = timeoutManager.setTimeout( + () => console.log('ran at:', new Date()), + 1000, +) + +const timeoutIdNumber: number = Number(timeoutId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`setTimeout`](../type-aliases/TimeoutProvider.md#settimeout) + +*** + +### setTimeoutProvider() + +```ts +setTimeoutProvider(provider): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L106) + +`setTimeoutProvider` can be used to set a custom implementation of the +`setTimeout`, `clearTimeout`, `setInterval`, `clearInterval` functions, +called a `TimeoutProvider`. + +This may be useful if you notice event loop performance issues with +thousands of queries. A custom TimeoutProvider could also support timer +delays longer than the global `setTimeout` maximum delay value of about +24 days. + +It is important to call `setTimeoutProvider` before creating a +QueryClient or queries, so that the same provider is used consistently +for all timers in the application, since different TimeoutProviders +cannot cancel each others' timers. + +#### Type Parameters + +##### TTimerId + +`TTimerId` *extends* [`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Parameters + +##### provider + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md)\<`TTimerId`\> + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager, QueryClient } from '@tanstack/query-core' +import { CustomTimeoutProvider } from './CustomTimeoutProvider' + +timeoutManager.setTimeoutProvider(new CustomTimeoutProvider()) + +export const queryClient = new QueryClient() +``` diff --git a/docs/framework/react/reference/type-aliases/TimeoutCallback.md b/docs/framework/react/reference/type-aliases/TimeoutCallback.md index 387fb1238f3..773b5fdaeb9 100644 --- a/docs/framework/react/reference/type-aliases/TimeoutCallback.md +++ b/docs/framework/react/reference/type-aliases/TimeoutCallback.md @@ -9,7 +9,7 @@ type TimeoutCallback = (_) => void; Defined in: [packages/query-core/src/timeoutManager.ts:9](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L9) -TimeoutManager does not support passing arguments to the callback. +[TimeoutManager](../interfaces/TimeoutManager.md) does not support passing arguments to the callback. `(_: void)` is the argument type inferred by TypeScript's default typings for `setTimeout(cb, number)`. diff --git a/docs/framework/react/reference/variables/environmentManager.md b/docs/framework/react/reference/variables/environmentManager.md index e207cfd2484..6eaa20da4f3 100644 --- a/docs/framework/react/reference/variables/environmentManager.md +++ b/docs/framework/react/reference/variables/environmentManager.md @@ -1,6 +1,8 @@ --- id: environmentManager title: environmentManager +redirect_from: + - reference/environmentManager --- ```ts diff --git a/docs/framework/react/reference/variables/focusManager.md b/docs/framework/react/reference/variables/focusManager.md index cbf7fcb4a17..86477849e06 100644 --- a/docs/framework/react/reference/variables/focusManager.md +++ b/docs/framework/react/reference/variables/focusManager.md @@ -9,4 +9,4 @@ const focusManager: FocusManager; Defined in: [packages/query-core/src/focusManager.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L142) -Singleton instance of FocusManager, used to manage and observe the focus state within TanStack Query. +Singleton instance of [FocusManager](../interfaces/FocusManager.md), used to manage and observe the focus state within TanStack Query. diff --git a/docs/framework/react/reference/variables/notifyManager.md b/docs/framework/react/reference/variables/notifyManager.md index 4bdf3478be0..b5da92573e1 100644 --- a/docs/framework/react/reference/variables/notifyManager.md +++ b/docs/framework/react/reference/variables/notifyManager.md @@ -1,6 +1,9 @@ --- id: notifyManager title: notifyManager +redirect_from: + - reference/notifyManager + - framework/react/reference/notifyManager --- ```ts diff --git a/docs/framework/react/reference/variables/onlineManager.md b/docs/framework/react/reference/variables/onlineManager.md index 4ae083f245b..2eeec5385d8 100644 --- a/docs/framework/react/reference/variables/onlineManager.md +++ b/docs/framework/react/reference/variables/onlineManager.md @@ -9,4 +9,4 @@ const onlineManager: OnlineManager; Defined in: [packages/query-core/src/onlineManager.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L117) -Singleton instance of OnlineManager, used to manage and observe the online state within TanStack Query. +Singleton instance of [OnlineManager](../interfaces/OnlineManager.md), used to manage and observe the online state within TanStack Query. diff --git a/docs/framework/react/reference/variables/timeoutManager.md b/docs/framework/react/reference/variables/timeoutManager.md index ef9cca969e9..1eca1a5f343 100644 --- a/docs/framework/react/reference/variables/timeoutManager.md +++ b/docs/framework/react/reference/variables/timeoutManager.md @@ -9,4 +9,4 @@ const timeoutManager: TimeoutManager; Defined in: [packages/query-core/src/timeoutManager.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L232) -Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. +Singleton instance of [TimeoutManager](../interfaces/TimeoutManager.md), used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/solid/reference/index.md b/docs/framework/solid/reference/index.md index d95777b39bc..6bac666e791 100644 --- a/docs/framework/solid/reference/index.md +++ b/docs/framework/solid/reference/index.md @@ -26,6 +26,7 @@ title: "@tanstack/solid-query" - [FetchNextPageOptions](interfaces/FetchNextPageOptions.md) - [FetchPreviousPageOptions](interfaces/FetchPreviousPageOptions.md) - [~~FetchQueryOptions~~](interfaces/FetchQueryOptions.md) +- [FocusManager](interfaces/FocusManager.md) - [HydrateOptions](interfaces/HydrateOptions.md) - [InfiniteData](interfaces/InfiniteData.md) - [InfiniteQueryObserverBaseResult](interfaces/InfiniteQueryObserverBaseResult.md) @@ -53,6 +54,7 @@ title: "@tanstack/solid-query" - [MutationOptions](interfaces/MutationOptions.md) - [MutationState](interfaces/MutationState.md) - [NotifyEvent](interfaces/NotifyEvent.md) +- [OnlineManager](interfaces/OnlineManager.md) - [QueriesObserverOptions](interfaces/QueriesObserverOptions.md) - [QueryCacheConfig](interfaces/QueryCacheConfig.md) - [QueryClientConfig](interfaces/QueryClientConfig.md) @@ -74,6 +76,7 @@ title: "@tanstack/solid-query" - [ResetOptions](interfaces/ResetOptions.md) - [ResultOptions](interfaces/ResultOptions.md) - [SetDataOptions](interfaces/SetDataOptions.md) +- [TimeoutManager](interfaces/TimeoutManager.md) - [UseBaseQueryOptions](interfaces/UseBaseQueryOptions.md) ## Type Aliases diff --git a/docs/framework/solid/reference/interfaces/FocusManager.md b/docs/framework/solid/reference/interfaces/FocusManager.md new file mode 100644 index 00000000000..1ab81dc6357 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/FocusManager.md @@ -0,0 +1,237 @@ +--- +id: FocusManager +title: FocusManager +--- + +Defined in: [packages/query-core/src/focusManager.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L14) + +The `FocusManager` manages the focus state within TanStack Query. + +It can be used to change the default event listeners or to manually change the focus state. + +## Extends + +- `Subscribable`\<`Listener`\> + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### isFocused() + +```ts +isFocused(): boolean; +``` + +Defined in: [packages/query-core/src/focusManager.ts:128](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L128) + +`isFocused` can be used to get the current focus state. + +#### Returns + +`boolean` + +*** + +### onFocus() + +```ts +onFocus(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L118) + +`onFocus` notifies all subscribed listeners with the current focus state. + +#### Returns + +`void` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L39) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L45) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setEventListener() + +```ts +setEventListener(setup): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L77) + +`setEventListener` can be used to set a custom event listener that will +be used to determine the focus state. The provided `setup` function +receives a `setFocused` callback: call it with a `boolean` to manually +set the focus state, or with no arguments to re-evaluate the current +focus state and notify subscribers. + +#### Parameters + +##### setup + +`SetupFn` + +#### Returns + +`void` + +#### Example + +```ts +import { focusManager } from '@tanstack/query-core' + +focusManager.setEventListener((handleFocus) => { + const listener = () => handleFocus() + // Listen to visibilitychange + if (typeof window !== 'undefined' && window.addEventListener) { + window.addEventListener('visibilitychange', listener, false) + } + + return () => { + // Be sure to unsubscribe if a new handler is set + window.removeEventListener('visibilitychange', listener) + } +}) +``` + +*** + +### setFocused() + +```ts +setFocused(focused?): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:107](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L107) + +`setFocused` can be used to manually set the focus state. Set `undefined` +to fall back to the default focus check. + +#### Parameters + +##### focused? + +`boolean` + +#### Returns + +`void` + +#### Example + +```ts +import { focusManager } from '@tanstack/query-core' + +// Set focused +focusManager.setFocused(true) + +// Set unfocused +focusManager.setFocused(false) + +// Fallback to the default focus check +focusManager.setFocused(undefined) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`Listener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/solid/reference/interfaces/OnlineManager.md b/docs/framework/solid/reference/interfaces/OnlineManager.md new file mode 100644 index 00000000000..1a936c91ed9 --- /dev/null +++ b/docs/framework/solid/reference/interfaces/OnlineManager.md @@ -0,0 +1,214 @@ +--- +id: OnlineManager +title: OnlineManager +--- + +Defined in: [packages/query-core/src/onlineManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L15) + +The `OnlineManager` manages the online state within TanStack Query. It can +be used to change the default event listeners or to manually change the +online state. + +By default, the `onlineManager` assumes an active network connection, and +listens to the `online` and `offline` events on the `window` object to +detect changes. + +## Extends + +- `Subscribable`\<`Listener`\> + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### isOnline() + +```ts +isOnline(): boolean; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:109](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L109) + +`isOnline` can be used to get the current online state. + +#### Returns + +`boolean` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L44) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:50](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L50) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setEventListener() + +```ts +setEventListener(setup): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L75) + +`setEventListener` can be used to set a custom event listener that will +be used to determine the online state. The provided `setup` function +receives a `setOnline` callback that should be called with a `boolean` +whenever the online state changes. + +#### Parameters + +##### setup + +`SetupFn` + +#### Returns + +`void` + +#### Example + +```ts +import NetInfo from '@react-native-community/netinfo' +import { onlineManager } from '@tanstack/query-core' + +onlineManager.setEventListener((setOnline) => { + return NetInfo.addEventListener((state) => { + setOnline(!!state.isConnected) + }) +}) +``` + +*** + +### setOnline() + +```ts +setOnline(online): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L95) + +`setOnline` can be used to manually set the online state. + +#### Parameters + +##### online + +`boolean` + +#### Returns + +`void` + +#### Example + +```ts +import { onlineManager } from '@tanstack/query-core' + +// Set to online +onlineManager.setOnline(true) + +// Set to offline +onlineManager.setOnline(false) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`Listener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/solid/reference/interfaces/TimeoutManager.md b/docs/framework/solid/reference/interfaces/TimeoutManager.md new file mode 100644 index 00000000000..95ff07b2ccc --- /dev/null +++ b/docs/framework/solid/reference/interfaces/TimeoutManager.md @@ -0,0 +1,246 @@ +--- +id: TimeoutManager +title: TimeoutManager +--- + +Defined in: [packages/query-core/src/timeoutManager.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L70) + +Allows customization of how timeouts are created. + +@tanstack/query-core makes liberal use of timeouts to implement `staleTime` +and `gcTime`. The default TimeoutManager provider uses the platform's global +`setTimeout` implementation, which is known to have scalability issues with +thousands of timeouts on the event loop. + +If you hit this limitation, consider providing a custom TimeoutProvider that +coalesces timeouts. + +## Implements + +- `Omit`\<[`TimeoutProvider`](../type-aliases/TimeoutProvider.md), `"name"`\> + +## Methods + +### clearInterval() + +```ts +clearInterval(intervalId): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:224](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L224) + +`clearInterval` can be used to cancel an interval, like the global +`clearInterval` function. It should be called with an interval ID +returned by `setInterval`. + +#### Parameters + +##### intervalId + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) | `undefined` + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const intervalId = timeoutManager.setInterval( + () => console.log('ran at:', new Date()), + 1000, +) + +timeoutManager.clearInterval(intervalId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`clearInterval`](../type-aliases/TimeoutProvider.md#clearinterval) + +*** + +### clearTimeout() + +```ts +clearTimeout(timeoutId): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:179](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L179) + +`clearTimeout` cancels a timeout callback scheduled with `setTimeout`, +like the global `clearTimeout` function. It should be called with a +timer ID returned by `setTimeout`. + +#### Parameters + +##### timeoutId + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) | `undefined` + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const timeoutId = timeoutManager.setTimeout( + () => console.log('ran at:', new Date()), + 1000, +) + +timeoutManager.clearTimeout(timeoutId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`clearTimeout`](../type-aliases/TimeoutProvider.md#cleartimeout) + +*** + +### setInterval() + +```ts +setInterval(callback, delay): ManagedTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:200](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L200) + +`setInterval` schedules a callback to be called approximately every +`delay` milliseconds, like the global `setInterval` function. + +Like `setTimeout`, it returns a timer ID, which may be a number or an +object that can be coerced to a number via `Symbol.toPrimitive`. + +#### Parameters + +##### callback + +[`TimeoutCallback`](../type-aliases/TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const intervalId = timeoutManager.setInterval( + () => console.log('ran at:', new Date()), + 1000, +) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`setInterval`](../type-aliases/TimeoutProvider.md#setinterval) + +*** + +### setTimeout() + +```ts +setTimeout(callback, delay): ManagedTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:155](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L155) + +`setTimeout` schedules a callback to run after approximately `delay` +milliseconds, like the global `setTimeout` function. The callback can be +canceled with `clearTimeout`. + +It returns a timer ID, which may be a number or an object that can be +coerced to a number via `Symbol.toPrimitive`. + +#### Parameters + +##### callback + +[`TimeoutCallback`](../type-aliases/TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const timeoutId = timeoutManager.setTimeout( + () => console.log('ran at:', new Date()), + 1000, +) + +const timeoutIdNumber: number = Number(timeoutId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`setTimeout`](../type-aliases/TimeoutProvider.md#settimeout) + +*** + +### setTimeoutProvider() + +```ts +setTimeoutProvider(provider): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L106) + +`setTimeoutProvider` can be used to set a custom implementation of the +`setTimeout`, `clearTimeout`, `setInterval`, `clearInterval` functions, +called a `TimeoutProvider`. + +This may be useful if you notice event loop performance issues with +thousands of queries. A custom TimeoutProvider could also support timer +delays longer than the global `setTimeout` maximum delay value of about +24 days. + +It is important to call `setTimeoutProvider` before creating a +QueryClient or queries, so that the same provider is used consistently +for all timers in the application, since different TimeoutProviders +cannot cancel each others' timers. + +#### Type Parameters + +##### TTimerId + +`TTimerId` *extends* [`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Parameters + +##### provider + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md)\<`TTimerId`\> + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager, QueryClient } from '@tanstack/query-core' +import { CustomTimeoutProvider } from './CustomTimeoutProvider' + +timeoutManager.setTimeoutProvider(new CustomTimeoutProvider()) + +export const queryClient = new QueryClient() +``` diff --git a/docs/framework/solid/reference/type-aliases/TimeoutCallback.md b/docs/framework/solid/reference/type-aliases/TimeoutCallback.md index 387fb1238f3..773b5fdaeb9 100644 --- a/docs/framework/solid/reference/type-aliases/TimeoutCallback.md +++ b/docs/framework/solid/reference/type-aliases/TimeoutCallback.md @@ -9,7 +9,7 @@ type TimeoutCallback = (_) => void; Defined in: [packages/query-core/src/timeoutManager.ts:9](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L9) -TimeoutManager does not support passing arguments to the callback. +[TimeoutManager](../interfaces/TimeoutManager.md) does not support passing arguments to the callback. `(_: void)` is the argument type inferred by TypeScript's default typings for `setTimeout(cb, number)`. diff --git a/docs/framework/solid/reference/variables/focusManager.md b/docs/framework/solid/reference/variables/focusManager.md index cbf7fcb4a17..86477849e06 100644 --- a/docs/framework/solid/reference/variables/focusManager.md +++ b/docs/framework/solid/reference/variables/focusManager.md @@ -9,4 +9,4 @@ const focusManager: FocusManager; Defined in: [packages/query-core/src/focusManager.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L142) -Singleton instance of FocusManager, used to manage and observe the focus state within TanStack Query. +Singleton instance of [FocusManager](../interfaces/FocusManager.md), used to manage and observe the focus state within TanStack Query. diff --git a/docs/framework/solid/reference/variables/onlineManager.md b/docs/framework/solid/reference/variables/onlineManager.md index 4ae083f245b..2eeec5385d8 100644 --- a/docs/framework/solid/reference/variables/onlineManager.md +++ b/docs/framework/solid/reference/variables/onlineManager.md @@ -9,4 +9,4 @@ const onlineManager: OnlineManager; Defined in: [packages/query-core/src/onlineManager.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L117) -Singleton instance of OnlineManager, used to manage and observe the online state within TanStack Query. +Singleton instance of [OnlineManager](../interfaces/OnlineManager.md), used to manage and observe the online state within TanStack Query. diff --git a/docs/framework/solid/reference/variables/timeoutManager.md b/docs/framework/solid/reference/variables/timeoutManager.md index ef9cca969e9..1eca1a5f343 100644 --- a/docs/framework/solid/reference/variables/timeoutManager.md +++ b/docs/framework/solid/reference/variables/timeoutManager.md @@ -9,4 +9,4 @@ const timeoutManager: TimeoutManager; Defined in: [packages/query-core/src/timeoutManager.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L232) -Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. +Singleton instance of [TimeoutManager](../interfaces/TimeoutManager.md), used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/svelte/reference/index.md b/docs/framework/svelte/reference/index.md index 83a59b64d29..f448902ceee 100644 --- a/docs/framework/svelte/reference/index.md +++ b/docs/framework/svelte/reference/index.md @@ -26,6 +26,7 @@ title: "@tanstack/svelte-query" - [FetchNextPageOptions](interfaces/FetchNextPageOptions.md) - [FetchPreviousPageOptions](interfaces/FetchPreviousPageOptions.md) - [~~FetchQueryOptions~~](interfaces/FetchQueryOptions.md) +- [FocusManager](interfaces/FocusManager.md) - [HydrateOptions](interfaces/HydrateOptions.md) - [InfiniteData](interfaces/InfiniteData.md) - [InfiniteQueryObserverBaseResult](interfaces/InfiniteQueryObserverBaseResult.md) @@ -52,6 +53,7 @@ title: "@tanstack/svelte-query" - [MutationOptions](interfaces/MutationOptions.md) - [MutationState](interfaces/MutationState.md) - [NotifyEvent](interfaces/NotifyEvent.md) +- [OnlineManager](interfaces/OnlineManager.md) - [QueriesObserverOptions](interfaces/QueriesObserverOptions.md) - [QueryCacheConfig](interfaces/QueryCacheConfig.md) - [QueryClientConfig](interfaces/QueryClientConfig.md) @@ -73,6 +75,7 @@ title: "@tanstack/svelte-query" - [ResetOptions](interfaces/ResetOptions.md) - [ResultOptions](interfaces/ResultOptions.md) - [SetDataOptions](interfaces/SetDataOptions.md) +- [TimeoutManager](interfaces/TimeoutManager.md) ## Type Aliases diff --git a/docs/framework/svelte/reference/interfaces/FocusManager.md b/docs/framework/svelte/reference/interfaces/FocusManager.md new file mode 100644 index 00000000000..1ab81dc6357 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/FocusManager.md @@ -0,0 +1,237 @@ +--- +id: FocusManager +title: FocusManager +--- + +Defined in: [packages/query-core/src/focusManager.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L14) + +The `FocusManager` manages the focus state within TanStack Query. + +It can be used to change the default event listeners or to manually change the focus state. + +## Extends + +- `Subscribable`\<`Listener`\> + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### isFocused() + +```ts +isFocused(): boolean; +``` + +Defined in: [packages/query-core/src/focusManager.ts:128](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L128) + +`isFocused` can be used to get the current focus state. + +#### Returns + +`boolean` + +*** + +### onFocus() + +```ts +onFocus(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L118) + +`onFocus` notifies all subscribed listeners with the current focus state. + +#### Returns + +`void` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L39) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L45) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setEventListener() + +```ts +setEventListener(setup): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L77) + +`setEventListener` can be used to set a custom event listener that will +be used to determine the focus state. The provided `setup` function +receives a `setFocused` callback: call it with a `boolean` to manually +set the focus state, or with no arguments to re-evaluate the current +focus state and notify subscribers. + +#### Parameters + +##### setup + +`SetupFn` + +#### Returns + +`void` + +#### Example + +```ts +import { focusManager } from '@tanstack/query-core' + +focusManager.setEventListener((handleFocus) => { + const listener = () => handleFocus() + // Listen to visibilitychange + if (typeof window !== 'undefined' && window.addEventListener) { + window.addEventListener('visibilitychange', listener, false) + } + + return () => { + // Be sure to unsubscribe if a new handler is set + window.removeEventListener('visibilitychange', listener) + } +}) +``` + +*** + +### setFocused() + +```ts +setFocused(focused?): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:107](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L107) + +`setFocused` can be used to manually set the focus state. Set `undefined` +to fall back to the default focus check. + +#### Parameters + +##### focused? + +`boolean` + +#### Returns + +`void` + +#### Example + +```ts +import { focusManager } from '@tanstack/query-core' + +// Set focused +focusManager.setFocused(true) + +// Set unfocused +focusManager.setFocused(false) + +// Fallback to the default focus check +focusManager.setFocused(undefined) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`Listener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/svelte/reference/interfaces/OnlineManager.md b/docs/framework/svelte/reference/interfaces/OnlineManager.md new file mode 100644 index 00000000000..1a936c91ed9 --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/OnlineManager.md @@ -0,0 +1,214 @@ +--- +id: OnlineManager +title: OnlineManager +--- + +Defined in: [packages/query-core/src/onlineManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L15) + +The `OnlineManager` manages the online state within TanStack Query. It can +be used to change the default event listeners or to manually change the +online state. + +By default, the `onlineManager` assumes an active network connection, and +listens to the `online` and `offline` events on the `window` object to +detect changes. + +## Extends + +- `Subscribable`\<`Listener`\> + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### isOnline() + +```ts +isOnline(): boolean; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:109](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L109) + +`isOnline` can be used to get the current online state. + +#### Returns + +`boolean` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L44) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:50](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L50) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setEventListener() + +```ts +setEventListener(setup): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L75) + +`setEventListener` can be used to set a custom event listener that will +be used to determine the online state. The provided `setup` function +receives a `setOnline` callback that should be called with a `boolean` +whenever the online state changes. + +#### Parameters + +##### setup + +`SetupFn` + +#### Returns + +`void` + +#### Example + +```ts +import NetInfo from '@react-native-community/netinfo' +import { onlineManager } from '@tanstack/query-core' + +onlineManager.setEventListener((setOnline) => { + return NetInfo.addEventListener((state) => { + setOnline(!!state.isConnected) + }) +}) +``` + +*** + +### setOnline() + +```ts +setOnline(online): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L95) + +`setOnline` can be used to manually set the online state. + +#### Parameters + +##### online + +`boolean` + +#### Returns + +`void` + +#### Example + +```ts +import { onlineManager } from '@tanstack/query-core' + +// Set to online +onlineManager.setOnline(true) + +// Set to offline +onlineManager.setOnline(false) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`Listener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/svelte/reference/interfaces/TimeoutManager.md b/docs/framework/svelte/reference/interfaces/TimeoutManager.md new file mode 100644 index 00000000000..95ff07b2ccc --- /dev/null +++ b/docs/framework/svelte/reference/interfaces/TimeoutManager.md @@ -0,0 +1,246 @@ +--- +id: TimeoutManager +title: TimeoutManager +--- + +Defined in: [packages/query-core/src/timeoutManager.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L70) + +Allows customization of how timeouts are created. + +@tanstack/query-core makes liberal use of timeouts to implement `staleTime` +and `gcTime`. The default TimeoutManager provider uses the platform's global +`setTimeout` implementation, which is known to have scalability issues with +thousands of timeouts on the event loop. + +If you hit this limitation, consider providing a custom TimeoutProvider that +coalesces timeouts. + +## Implements + +- `Omit`\<[`TimeoutProvider`](../type-aliases/TimeoutProvider.md), `"name"`\> + +## Methods + +### clearInterval() + +```ts +clearInterval(intervalId): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:224](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L224) + +`clearInterval` can be used to cancel an interval, like the global +`clearInterval` function. It should be called with an interval ID +returned by `setInterval`. + +#### Parameters + +##### intervalId + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) | `undefined` + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const intervalId = timeoutManager.setInterval( + () => console.log('ran at:', new Date()), + 1000, +) + +timeoutManager.clearInterval(intervalId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`clearInterval`](../type-aliases/TimeoutProvider.md#clearinterval) + +*** + +### clearTimeout() + +```ts +clearTimeout(timeoutId): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:179](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L179) + +`clearTimeout` cancels a timeout callback scheduled with `setTimeout`, +like the global `clearTimeout` function. It should be called with a +timer ID returned by `setTimeout`. + +#### Parameters + +##### timeoutId + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) | `undefined` + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const timeoutId = timeoutManager.setTimeout( + () => console.log('ran at:', new Date()), + 1000, +) + +timeoutManager.clearTimeout(timeoutId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`clearTimeout`](../type-aliases/TimeoutProvider.md#cleartimeout) + +*** + +### setInterval() + +```ts +setInterval(callback, delay): ManagedTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:200](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L200) + +`setInterval` schedules a callback to be called approximately every +`delay` milliseconds, like the global `setInterval` function. + +Like `setTimeout`, it returns a timer ID, which may be a number or an +object that can be coerced to a number via `Symbol.toPrimitive`. + +#### Parameters + +##### callback + +[`TimeoutCallback`](../type-aliases/TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const intervalId = timeoutManager.setInterval( + () => console.log('ran at:', new Date()), + 1000, +) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`setInterval`](../type-aliases/TimeoutProvider.md#setinterval) + +*** + +### setTimeout() + +```ts +setTimeout(callback, delay): ManagedTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:155](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L155) + +`setTimeout` schedules a callback to run after approximately `delay` +milliseconds, like the global `setTimeout` function. The callback can be +canceled with `clearTimeout`. + +It returns a timer ID, which may be a number or an object that can be +coerced to a number via `Symbol.toPrimitive`. + +#### Parameters + +##### callback + +[`TimeoutCallback`](../type-aliases/TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const timeoutId = timeoutManager.setTimeout( + () => console.log('ran at:', new Date()), + 1000, +) + +const timeoutIdNumber: number = Number(timeoutId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`setTimeout`](../type-aliases/TimeoutProvider.md#settimeout) + +*** + +### setTimeoutProvider() + +```ts +setTimeoutProvider(provider): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L106) + +`setTimeoutProvider` can be used to set a custom implementation of the +`setTimeout`, `clearTimeout`, `setInterval`, `clearInterval` functions, +called a `TimeoutProvider`. + +This may be useful if you notice event loop performance issues with +thousands of queries. A custom TimeoutProvider could also support timer +delays longer than the global `setTimeout` maximum delay value of about +24 days. + +It is important to call `setTimeoutProvider` before creating a +QueryClient or queries, so that the same provider is used consistently +for all timers in the application, since different TimeoutProviders +cannot cancel each others' timers. + +#### Type Parameters + +##### TTimerId + +`TTimerId` *extends* [`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Parameters + +##### provider + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md)\<`TTimerId`\> + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager, QueryClient } from '@tanstack/query-core' +import { CustomTimeoutProvider } from './CustomTimeoutProvider' + +timeoutManager.setTimeoutProvider(new CustomTimeoutProvider()) + +export const queryClient = new QueryClient() +``` diff --git a/docs/framework/svelte/reference/type-aliases/TimeoutCallback.md b/docs/framework/svelte/reference/type-aliases/TimeoutCallback.md index 387fb1238f3..773b5fdaeb9 100644 --- a/docs/framework/svelte/reference/type-aliases/TimeoutCallback.md +++ b/docs/framework/svelte/reference/type-aliases/TimeoutCallback.md @@ -9,7 +9,7 @@ type TimeoutCallback = (_) => void; Defined in: [packages/query-core/src/timeoutManager.ts:9](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L9) -TimeoutManager does not support passing arguments to the callback. +[TimeoutManager](../interfaces/TimeoutManager.md) does not support passing arguments to the callback. `(_: void)` is the argument type inferred by TypeScript's default typings for `setTimeout(cb, number)`. diff --git a/docs/framework/svelte/reference/variables/focusManager.md b/docs/framework/svelte/reference/variables/focusManager.md index cbf7fcb4a17..86477849e06 100644 --- a/docs/framework/svelte/reference/variables/focusManager.md +++ b/docs/framework/svelte/reference/variables/focusManager.md @@ -9,4 +9,4 @@ const focusManager: FocusManager; Defined in: [packages/query-core/src/focusManager.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L142) -Singleton instance of FocusManager, used to manage and observe the focus state within TanStack Query. +Singleton instance of [FocusManager](../interfaces/FocusManager.md), used to manage and observe the focus state within TanStack Query. diff --git a/docs/framework/svelte/reference/variables/onlineManager.md b/docs/framework/svelte/reference/variables/onlineManager.md index 4ae083f245b..2eeec5385d8 100644 --- a/docs/framework/svelte/reference/variables/onlineManager.md +++ b/docs/framework/svelte/reference/variables/onlineManager.md @@ -9,4 +9,4 @@ const onlineManager: OnlineManager; Defined in: [packages/query-core/src/onlineManager.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L117) -Singleton instance of OnlineManager, used to manage and observe the online state within TanStack Query. +Singleton instance of [OnlineManager](../interfaces/OnlineManager.md), used to manage and observe the online state within TanStack Query. diff --git a/docs/framework/svelte/reference/variables/timeoutManager.md b/docs/framework/svelte/reference/variables/timeoutManager.md index ef9cca969e9..1eca1a5f343 100644 --- a/docs/framework/svelte/reference/variables/timeoutManager.md +++ b/docs/framework/svelte/reference/variables/timeoutManager.md @@ -9,4 +9,4 @@ const timeoutManager: TimeoutManager; Defined in: [packages/query-core/src/timeoutManager.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L232) -Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. +Singleton instance of [TimeoutManager](../interfaces/TimeoutManager.md), used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/vue/guides/ssr.md b/docs/framework/vue/guides/ssr.md index eee4e59bfdf..f4467c713b6 100644 --- a/docs/framework/vue/guides/ssr.md +++ b/docs/framework/vue/guides/ssr.md @@ -254,7 +254,7 @@ In case you are creating the `QueryClient` for every request, Vue Query creates On the server, `gcTime` defaults to `Infinity` which disables manual garbage collection and will automatically clear memory once a request has finished. If you are explicitly setting a non-Infinity `gcTime` then you will be responsible for clearing the cache early. -To clear the cache after it is not needed and to lower memory consumption, you can add a call to [`queryClient.clear()`](../../../reference/QueryClient/#queryclientclear) after the request is handled and dehydrated state has been sent to the client. +To clear the cache after it is not needed and to lower memory consumption, you can add a call to [`queryClient.clear()`](../reference/classes/QueryClient.md#clear) after the request is handled and dehydrated state has been sent to the client. ## `dehydrate`/`hydrate` options diff --git a/docs/framework/vue/reference/index.md b/docs/framework/vue/reference/index.md index 7ed5bdc968f..69bc24c81c7 100644 --- a/docs/framework/vue/reference/index.md +++ b/docs/framework/vue/reference/index.md @@ -26,6 +26,7 @@ title: "@tanstack/vue-query" - [FetchNextPageOptions](interfaces/FetchNextPageOptions.md) - [FetchPreviousPageOptions](interfaces/FetchPreviousPageOptions.md) - [~~FetchQueryOptions~~](interfaces/FetchQueryOptions.md) +- [FocusManager](interfaces/FocusManager.md) - [HydrateOptions](interfaces/HydrateOptions.md) - [InfiniteData](interfaces/InfiniteData.md) - [InfiniteQueryObserverBaseResult](interfaces/InfiniteQueryObserverBaseResult.md) @@ -50,6 +51,7 @@ title: "@tanstack/vue-query" - [MutationObserverSuccessResult](interfaces/MutationObserverSuccessResult.md) - [MutationState](interfaces/MutationState.md) - [NotifyEvent](interfaces/NotifyEvent.md) +- [OnlineManager](interfaces/OnlineManager.md) - [QueriesObserverOptions](interfaces/QueriesObserverOptions.md) - [QueryCacheConfig](interfaces/QueryCacheConfig.md) - [QueryClientConfig](interfaces/QueryClientConfig.md) @@ -69,6 +71,7 @@ title: "@tanstack/vue-query" - [ResetOptions](interfaces/ResetOptions.md) - [ResultOptions](interfaces/ResultOptions.md) - [SetDataOptions](interfaces/SetDataOptions.md) +- [TimeoutManager](interfaces/TimeoutManager.md) ## Type Aliases diff --git a/docs/framework/vue/reference/interfaces/FocusManager.md b/docs/framework/vue/reference/interfaces/FocusManager.md new file mode 100644 index 00000000000..1ab81dc6357 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/FocusManager.md @@ -0,0 +1,237 @@ +--- +id: FocusManager +title: FocusManager +--- + +Defined in: [packages/query-core/src/focusManager.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L14) + +The `FocusManager` manages the focus state within TanStack Query. + +It can be used to change the default event listeners or to manually change the focus state. + +## Extends + +- `Subscribable`\<`Listener`\> + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### isFocused() + +```ts +isFocused(): boolean; +``` + +Defined in: [packages/query-core/src/focusManager.ts:128](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L128) + +`isFocused` can be used to get the current focus state. + +#### Returns + +`boolean` + +*** + +### onFocus() + +```ts +onFocus(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L118) + +`onFocus` notifies all subscribed listeners with the current focus state. + +#### Returns + +`void` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L39) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L45) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setEventListener() + +```ts +setEventListener(setup): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L77) + +`setEventListener` can be used to set a custom event listener that will +be used to determine the focus state. The provided `setup` function +receives a `setFocused` callback: call it with a `boolean` to manually +set the focus state, or with no arguments to re-evaluate the current +focus state and notify subscribers. + +#### Parameters + +##### setup + +`SetupFn` + +#### Returns + +`void` + +#### Example + +```ts +import { focusManager } from '@tanstack/query-core' + +focusManager.setEventListener((handleFocus) => { + const listener = () => handleFocus() + // Listen to visibilitychange + if (typeof window !== 'undefined' && window.addEventListener) { + window.addEventListener('visibilitychange', listener, false) + } + + return () => { + // Be sure to unsubscribe if a new handler is set + window.removeEventListener('visibilitychange', listener) + } +}) +``` + +*** + +### setFocused() + +```ts +setFocused(focused?): void; +``` + +Defined in: [packages/query-core/src/focusManager.ts:107](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L107) + +`setFocused` can be used to manually set the focus state. Set `undefined` +to fall back to the default focus check. + +#### Parameters + +##### focused? + +`boolean` + +#### Returns + +`void` + +#### Example + +```ts +import { focusManager } from '@tanstack/query-core' + +// Set focused +focusManager.setFocused(true) + +// Set unfocused +focusManager.setFocused(false) + +// Fallback to the default focus check +focusManager.setFocused(undefined) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`Listener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/vue/reference/interfaces/OnlineManager.md b/docs/framework/vue/reference/interfaces/OnlineManager.md new file mode 100644 index 00000000000..1a936c91ed9 --- /dev/null +++ b/docs/framework/vue/reference/interfaces/OnlineManager.md @@ -0,0 +1,214 @@ +--- +id: OnlineManager +title: OnlineManager +--- + +Defined in: [packages/query-core/src/onlineManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L15) + +The `OnlineManager` manages the online state within TanStack Query. It can +be used to change the default event listeners or to manually change the +online state. + +By default, the `onlineManager` assumes an active network connection, and +listens to the `online` and `offline` events on the `window` object to +detect changes. + +## Extends + +- `Subscribable`\<`Listener`\> + +## Properties + +### listeners + +```ts +protected listeners: Set; +``` + +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) + +#### Inherited from + +```ts +Subscribable.listeners +``` + +## Methods + +### hasListeners() + +```ts +hasListeners(): boolean; +``` + +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) + +#### Returns + +`boolean` + +#### Inherited from + +```ts +Subscribable.hasListeners +``` + +*** + +### isOnline() + +```ts +isOnline(): boolean; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:109](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L109) + +`isOnline` can be used to get the current online state. + +#### Returns + +`boolean` + +*** + +### onSubscribe() + +```ts +protected onSubscribe(): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L44) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onSubscribe +``` + +*** + +### onUnsubscribe() + +```ts +protected onUnsubscribe(): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:50](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L50) + +#### Returns + +`void` + +#### Overrides + +```ts +Subscribable.onUnsubscribe +``` + +*** + +### setEventListener() + +```ts +setEventListener(setup): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L75) + +`setEventListener` can be used to set a custom event listener that will +be used to determine the online state. The provided `setup` function +receives a `setOnline` callback that should be called with a `boolean` +whenever the online state changes. + +#### Parameters + +##### setup + +`SetupFn` + +#### Returns + +`void` + +#### Example + +```ts +import NetInfo from '@react-native-community/netinfo' +import { onlineManager } from '@tanstack/query-core' + +onlineManager.setEventListener((setOnline) => { + return NetInfo.addEventListener((state) => { + setOnline(!!state.isConnected) + }) +}) +``` + +*** + +### setOnline() + +```ts +setOnline(online): void; +``` + +Defined in: [packages/query-core/src/onlineManager.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L95) + +`setOnline` can be used to manually set the online state. + +#### Parameters + +##### online + +`boolean` + +#### Returns + +`void` + +#### Example + +```ts +import { onlineManager } from '@tanstack/query-core' + +// Set to online +onlineManager.setOnline(true) + +// Set to offline +onlineManager.setOnline(false) +``` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) + +#### Parameters + +##### listener + +`Listener` + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` + +#### Inherited from + +```ts +Subscribable.subscribe +``` diff --git a/docs/framework/vue/reference/interfaces/TimeoutManager.md b/docs/framework/vue/reference/interfaces/TimeoutManager.md new file mode 100644 index 00000000000..95ff07b2ccc --- /dev/null +++ b/docs/framework/vue/reference/interfaces/TimeoutManager.md @@ -0,0 +1,246 @@ +--- +id: TimeoutManager +title: TimeoutManager +--- + +Defined in: [packages/query-core/src/timeoutManager.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L70) + +Allows customization of how timeouts are created. + +@tanstack/query-core makes liberal use of timeouts to implement `staleTime` +and `gcTime`. The default TimeoutManager provider uses the platform's global +`setTimeout` implementation, which is known to have scalability issues with +thousands of timeouts on the event loop. + +If you hit this limitation, consider providing a custom TimeoutProvider that +coalesces timeouts. + +## Implements + +- `Omit`\<[`TimeoutProvider`](../type-aliases/TimeoutProvider.md), `"name"`\> + +## Methods + +### clearInterval() + +```ts +clearInterval(intervalId): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:224](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L224) + +`clearInterval` can be used to cancel an interval, like the global +`clearInterval` function. It should be called with an interval ID +returned by `setInterval`. + +#### Parameters + +##### intervalId + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) | `undefined` + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const intervalId = timeoutManager.setInterval( + () => console.log('ran at:', new Date()), + 1000, +) + +timeoutManager.clearInterval(intervalId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`clearInterval`](../type-aliases/TimeoutProvider.md#clearinterval) + +*** + +### clearTimeout() + +```ts +clearTimeout(timeoutId): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:179](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L179) + +`clearTimeout` cancels a timeout callback scheduled with `setTimeout`, +like the global `clearTimeout` function. It should be called with a +timer ID returned by `setTimeout`. + +#### Parameters + +##### timeoutId + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) | `undefined` + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const timeoutId = timeoutManager.setTimeout( + () => console.log('ran at:', new Date()), + 1000, +) + +timeoutManager.clearTimeout(timeoutId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`clearTimeout`](../type-aliases/TimeoutProvider.md#cleartimeout) + +*** + +### setInterval() + +```ts +setInterval(callback, delay): ManagedTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:200](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L200) + +`setInterval` schedules a callback to be called approximately every +`delay` milliseconds, like the global `setInterval` function. + +Like `setTimeout`, it returns a timer ID, which may be a number or an +object that can be coerced to a number via `Symbol.toPrimitive`. + +#### Parameters + +##### callback + +[`TimeoutCallback`](../type-aliases/TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const intervalId = timeoutManager.setInterval( + () => console.log('ran at:', new Date()), + 1000, +) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`setInterval`](../type-aliases/TimeoutProvider.md#setinterval) + +*** + +### setTimeout() + +```ts +setTimeout(callback, delay): ManagedTimerId; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:155](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L155) + +`setTimeout` schedules a callback to run after approximately `delay` +milliseconds, like the global `setTimeout` function. The callback can be +canceled with `clearTimeout`. + +It returns a timer ID, which may be a number or an object that can be +coerced to a number via `Symbol.toPrimitive`. + +#### Parameters + +##### callback + +[`TimeoutCallback`](../type-aliases/TimeoutCallback.md) + +##### delay + +`number` + +#### Returns + +[`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Example + +```ts +import { timeoutManager } from '@tanstack/query-core' + +const timeoutId = timeoutManager.setTimeout( + () => console.log('ran at:', new Date()), + 1000, +) + +const timeoutIdNumber: number = Number(timeoutId) +``` + +#### Implementation of + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md).[`setTimeout`](../type-aliases/TimeoutProvider.md#settimeout) + +*** + +### setTimeoutProvider() + +```ts +setTimeoutProvider(provider): void; +``` + +Defined in: [packages/query-core/src/timeoutManager.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L106) + +`setTimeoutProvider` can be used to set a custom implementation of the +`setTimeout`, `clearTimeout`, `setInterval`, `clearInterval` functions, +called a `TimeoutProvider`. + +This may be useful if you notice event loop performance issues with +thousands of queries. A custom TimeoutProvider could also support timer +delays longer than the global `setTimeout` maximum delay value of about +24 days. + +It is important to call `setTimeoutProvider` before creating a +QueryClient or queries, so that the same provider is used consistently +for all timers in the application, since different TimeoutProviders +cannot cancel each others' timers. + +#### Type Parameters + +##### TTimerId + +`TTimerId` *extends* [`ManagedTimerId`](../type-aliases/ManagedTimerId.md) + +#### Parameters + +##### provider + +[`TimeoutProvider`](../type-aliases/TimeoutProvider.md)\<`TTimerId`\> + +#### Returns + +`void` + +#### Example + +```ts +import { timeoutManager, QueryClient } from '@tanstack/query-core' +import { CustomTimeoutProvider } from './CustomTimeoutProvider' + +timeoutManager.setTimeoutProvider(new CustomTimeoutProvider()) + +export const queryClient = new QueryClient() +``` diff --git a/docs/framework/vue/reference/type-aliases/TimeoutCallback.md b/docs/framework/vue/reference/type-aliases/TimeoutCallback.md index 387fb1238f3..773b5fdaeb9 100644 --- a/docs/framework/vue/reference/type-aliases/TimeoutCallback.md +++ b/docs/framework/vue/reference/type-aliases/TimeoutCallback.md @@ -9,7 +9,7 @@ type TimeoutCallback = (_) => void; Defined in: [packages/query-core/src/timeoutManager.ts:9](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L9) -TimeoutManager does not support passing arguments to the callback. +[TimeoutManager](../interfaces/TimeoutManager.md) does not support passing arguments to the callback. `(_: void)` is the argument type inferred by TypeScript's default typings for `setTimeout(cb, number)`. diff --git a/docs/framework/vue/reference/variables/focusManager.md b/docs/framework/vue/reference/variables/focusManager.md index cbf7fcb4a17..86477849e06 100644 --- a/docs/framework/vue/reference/variables/focusManager.md +++ b/docs/framework/vue/reference/variables/focusManager.md @@ -9,4 +9,4 @@ const focusManager: FocusManager; Defined in: [packages/query-core/src/focusManager.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L142) -Singleton instance of FocusManager, used to manage and observe the focus state within TanStack Query. +Singleton instance of [FocusManager](../interfaces/FocusManager.md), used to manage and observe the focus state within TanStack Query. diff --git a/docs/framework/vue/reference/variables/onlineManager.md b/docs/framework/vue/reference/variables/onlineManager.md index 4ae083f245b..2eeec5385d8 100644 --- a/docs/framework/vue/reference/variables/onlineManager.md +++ b/docs/framework/vue/reference/variables/onlineManager.md @@ -9,4 +9,4 @@ const onlineManager: OnlineManager; Defined in: [packages/query-core/src/onlineManager.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L117) -Singleton instance of OnlineManager, used to manage and observe the online state within TanStack Query. +Singleton instance of [OnlineManager](../interfaces/OnlineManager.md), used to manage and observe the online state within TanStack Query. diff --git a/docs/framework/vue/reference/variables/timeoutManager.md b/docs/framework/vue/reference/variables/timeoutManager.md index ef9cca969e9..1eca1a5f343 100644 --- a/docs/framework/vue/reference/variables/timeoutManager.md +++ b/docs/framework/vue/reference/variables/timeoutManager.md @@ -9,4 +9,4 @@ const timeoutManager: TimeoutManager; Defined in: [packages/query-core/src/timeoutManager.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L232) -Singleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers. +Singleton instance of [TimeoutManager](../interfaces/TimeoutManager.md), used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/reference/InfiniteQueryObserver.md b/docs/reference/InfiniteQueryObserver.md deleted file mode 100644 index 7001f06c59e..00000000000 --- a/docs/reference/InfiniteQueryObserver.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -id: InfiniteQueryObserver -title: InfiniteQueryObserver -redirect_from: - - framework/react/reference/InfiniteQueryObserver ---- - -The `InfiniteQueryObserver` can be used to observe and switch between infinite queries. - -```tsx -const observer = new InfiniteQueryObserver(queryClient, { - queryKey: ['posts'], - queryFn: fetchPosts, - getNextPageParam: (lastPage, allPages) => lastPage.nextCursor, - getPreviousPageParam: (firstPage, allPages) => firstPage.prevCursor, -}) - -const unsubscribe = observer.subscribe((result) => { - console.log(result) - unsubscribe() -}) -``` - -**Options** - -The options for the `InfiniteQueryObserver` are exactly the same as those of [`useInfiniteQuery`](../framework/react/reference/functions/useInfiniteQuery.md). diff --git a/docs/reference/MutationCache.md b/docs/reference/MutationCache.md deleted file mode 100644 index e0a3b4a104c..00000000000 --- a/docs/reference/MutationCache.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -id: MutationCache -title: MutationCache -redirect_from: - - framework/react/reference/MutationCache ---- - -The `MutationCache` is the storage for mutations. - -**Normally, you will not interact with the MutationCache directly and instead use the `QueryClient`.** - -```tsx -import { MutationCache } from '@tanstack/react-query' - -const mutationCache = new MutationCache({ - onError: (error) => { - console.log(error) - }, - onSuccess: (data) => { - console.log(data) - }, -}) -``` - -Its available methods are: - -- [`getAll`](#mutationcache-getall) -- [`subscribe`](#mutationcache-subscribe) -- [`clear`](#mutationcache-clear) - -**Options** - -- `onError?: (error: unknown, variables: unknown, onMutateResult: unknown, mutation: Mutation, mutationFnContext: MutationFunctionContext) => Promise | unknown` - - Optional - - This function will be called if some mutation encounters an error. - - If you return a Promise from it, it will be awaited -- `onSuccess?: (data: unknown, variables: unknown, onMutateResult: unknown, mutation: Mutation, mutationFnContext: MutationFunctionContext) => Promise | unknown` - - Optional - - This function will be called if some mutation is successful. - - If you return a Promise from it, it will be awaited -- `onSettled?: (data: unknown | undefined, error: unknown | null, variables: unknown, onMutateResult: unknown, mutation: Mutation, mutationFnContext: MutationFunctionContext) => Promise | unknown` - - Optional - - This function will be called if some mutation is settled (either successful or errored). - - If you return a Promise from it, it will be awaited -- `onMutate?: (variables: unknown, mutation: Mutation, mutationFnContext: MutationFunctionContext) => Promise | unknown` - - Optional - - This function will be called before some mutation executes. - - If you return a Promise from it, it will be awaited - -## Global callbacks - -The `onError`, `onSuccess`, `onSettled` and `onMutate` callbacks on the MutationCache can be used to handle these events on a global level. They are different to `defaultOptions` provided to the QueryClient because: - -- `defaultOptions` can be overridden by each Mutation - the global callbacks will **always** be called. -- `onMutate` does not allow returning a result. - -## `mutationCache.getAll` - -`getAll` returns all mutations within the cache. - -> Note: This is not typically needed for most applications, but can come in handy when needing more information about a mutation in rare scenarios - -```tsx -const mutations = mutationCache.getAll() -``` - -**Returns** - -- `Mutation[]` - - Mutation instances from the cache - -## `mutationCache.subscribe` - -The `subscribe` method can be used to subscribe to the mutation cache as a whole and be informed of safe/known updates to the cache like mutation states changing or mutations being updated, added or removed. - -```tsx -const callback = (event) => { - console.log(event.type, event.mutation) -} - -const unsubscribe = mutationCache.subscribe(callback) -``` - -**Options** - -- `callback: (mutation?: MutationCacheNotifyEvent) => void` - - This function will be called with the mutation cache any time it is updated. - -**Returns** - -- `unsubscribe: Function => void` - - This function will unsubscribe the callback from the mutation cache. - -## `mutationCache.clear` - -The `clear` method can be used to clear the cache entirely and start fresh. - -```tsx -mutationCache.clear() -``` diff --git a/docs/reference/QueriesObserver.md b/docs/reference/QueriesObserver.md deleted file mode 100644 index 705c6eb2df3..00000000000 --- a/docs/reference/QueriesObserver.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -id: QueriesObserver -title: QueriesObserver -redirect_from: - - framework/react/reference/QueriesObserver ---- - -The `QueriesObserver` can be used to observe multiple queries. - -```tsx -const observer = new QueriesObserver(queryClient, [ - { queryKey: ['post', 1], queryFn: fetchPost }, - { queryKey: ['post', 2], queryFn: fetchPost }, -]) - -const unsubscribe = observer.subscribe((result) => { - console.log(result) - unsubscribe() -}) -``` - -**Options** - -The options for the `QueriesObserver` are exactly the same as those of [`useQueries`](../framework/react/reference/functions/useQueries.md). diff --git a/docs/reference/QueryCache.md b/docs/reference/QueryCache.md deleted file mode 100644 index 91562117762..00000000000 --- a/docs/reference/QueryCache.md +++ /dev/null @@ -1,125 +0,0 @@ ---- -id: QueryCache -title: QueryCache -redirect_from: - - framework/react/reference/QueryCache ---- - -The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta information and state of queries it contains. - -**Normally, you will not interact with the QueryCache directly and instead use the `QueryClient` for a specific cache.** - -```tsx -import { QueryCache } from '@tanstack/react-query' - -const queryCache = new QueryCache({ - onError: (error) => { - console.log(error) - }, - onSuccess: (data) => { - console.log(data) - }, - onSettled: (data, error) => { - console.log(data, error) - }, -}) - -const query = queryCache.find({ queryKey: ['posts'] }) -``` - -Its available methods are: - -- [`queryCache.find`](#querycache-find) -- [`queryCache.findAll`](#querycache-findall) -- [`queryCache.subscribe`](#querycache-subscribe) -- [`queryCache.clear`](#querycache-clear) -- [Further reading](#further-reading) - -**Options** - -- `onError?: (error: unknown, query: Query) => void` - - Optional - - This function will be called if some query encounters an error. -- `onSuccess?: (data: unknown, query: Query) => void` - - Optional - - This function will be called if some query is successful. -- `onSettled?: (data: unknown | undefined, error: unknown | null, query: Query) => void` - - Optional - - This function will be called if some query is settled (either successful or errored). - -## `queryCache.find` - -`find` is a slightly more advanced synchronous method that can be used to get an existing query instance from the cache. This instance not only contains **all** the state for the query, but all of the instances, and underlying guts of the query as well. If the query does not exist, `undefined` will be returned. - -> Note: This is not typically needed for most applications, but can come in handy when needing more information about a query in rare scenarios (eg. Looking at the query.state.dataUpdatedAt timestamp to decide whether a query is fresh enough to be used as an initial value) - -```tsx -const query = queryCache.find({ queryKey }) -``` - -**Options** - -- `filters: QueryFilters`: [Query Filters](../framework/react/guides/filters#query-filters) - - `queryKey: QueryKey`: [Query Keys](../framework/react/guides/query-keys.md) - -**Returns** - -- `Query` - - The query instance from the cache - -## `queryCache.findAll` - -`findAll` is even more advanced synchronous method that can be used to get existing query instances from the cache that partially match query key. If queries do not exist, empty array will be returned. - -> Note: This is not typically needed for most applications, but can come in handy when needing more information about a query in rare scenarios - -```tsx -const queries = queryCache.findAll({ queryKey }) -``` - -**Options** - -- `filters?: QueryFilters`: [Query Filters](../framework/react/guides/filters.md#query-filters) - -**Returns** - -- `Query[]` - - Query instances from the cache - -## `queryCache.subscribe` - -The `subscribe` method can be used to subscribe to the query cache as a whole and be informed of safe/known updates to the cache like query states changing or queries being updated, added or removed - -```tsx -const callback = (event) => { - console.log(event.type, event.query) -} - -const unsubscribe = queryCache.subscribe(callback) -``` - -**Options** - -- `callback: (event: QueryCacheNotifyEvent) => void` - - This function will be called with the query cache any time it is updated via its tracked update mechanisms (eg, `query.setState`, `queryClient.removeQueries`, etc). Out of scope mutations to the cache are not encouraged and will not fire subscription callbacks - -**Returns** - -- `unsubscribe: Function => void` - - This function will unsubscribe the callback from the query cache. - -## `queryCache.clear` - -The `clear` method can be used to clear the cache entirely and start fresh. - -```tsx -queryCache.clear() -``` - -[//]: # 'Materials' - -## Further reading - -To get a better understanding how the QueryCache works internally, have a look at [the Inside React Query article by TkDodo](https://tkdodo.eu/blog/inside-react-query). - -[//]: # 'Materials' diff --git a/docs/reference/QueryClient.md b/docs/reference/QueryClient.md deleted file mode 100644 index 7b174727b35..00000000000 --- a/docs/reference/QueryClient.md +++ /dev/null @@ -1,521 +0,0 @@ ---- -id: QueryClient -title: QueryClient -redirect_from: - - framework/react/reference/QueryClient ---- - -The `QueryClient` can be used to interact with a cache: - -```tsx -import { QueryClient } from '@tanstack/react-query' - -const queryClient = new QueryClient({ - defaultOptions: { - queries: { - staleTime: Infinity, - }, - }, -}) - -await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts }) -``` - -Its available methods are: - -- [`queryClient.query`](#queryclient-query) -- [`queryClient.infiniteQuery`](#queryclient-infinitequery) -- [`queryClient.getQueryData`](#queryclient-getquerydata) -- [`queryClient.getQueriesData`](#queryclient-getqueriesdata) -- [`queryClient.setQueryData`](#queryclient-setquerydata) -- [`queryClient.getQueryState`](#queryclient-getquerystate) -- [`queryClient.setQueriesData`](#queryclient-setqueriesdata) -- [`queryClient.invalidateQueries`](#queryclient-invalidatequeries) -- [`queryClient.refetchQueries`](#queryclient-refetchqueries) -- [`queryClient.cancelQueries`](#queryclient-cancelqueries) -- [`queryClient.removeQueries`](#queryclient-removequeries) -- [`queryClient.resetQueries`](#queryclient-resetqueries) -- [`queryClient.isFetching`](#queryclient-isfetching) -- [`queryClient.isMutating`](#queryclient-ismutating) -- [`queryClient.getDefaultOptions`](#queryclient-getdefaultoptions) -- [`queryClient.setDefaultOptions`](#queryclient-setdefaultoptions) -- [`queryClient.getQueryDefaults`](#queryclient-getquerydefaults) -- [`queryClient.setQueryDefaults`](#queryclient-setquerydefaults) -- [`queryClient.getMutationDefaults`](#queryclient-getmutationdefaults) -- [`queryClient.setMutationDefaults`](#queryclient-setmutationdefaults) -- [`queryClient.getQueryCache`](#queryclient-getquerycache) -- [`queryClient.getMutationCache`](#queryclient-getmutationcache) -- [`queryClient.clear`](#queryclient-clear) -- [`queryClient.resumePausedMutations`](#queryclient-resumepausedmutations) - -**Options** - -- `queryCache?: QueryCache` - - Optional - - The query cache this client is connected to. -- `mutationCache?: MutationCache` - - Optional - - The mutation cache this client is connected to. -- `defaultOptions?: DefaultOptions` - - Optional - - Define defaults for all queries and mutations using this queryClient. - - You can also define defaults to be used for [hydration](../framework/react/guides/ssr.md) - -## `queryClient.query` - -`query` is an asynchronous method that can be used to fetch and cache a query. It will either resolve with the data or throw with an error. - -If the query exists and the data is not invalidated or older than the given `staleTime`, then the data from the cache will be returned. Otherwise it will try to fetch the latest data. - -```tsx -try { - const data = await queryClient.query({ queryKey, queryFn }) -} catch (error) { - console.log(error) -} -``` - -Specify a `staleTime` to only fetch when the data is older than a certain amount of time: - -```tsx -try { - const data = await queryClient.query({ - queryKey, - queryFn, - staleTime: 10000, - select: (data) => data.items, - }) -} catch (error) { - console.log(error) -} -``` - -**Options** - -The options for `query` are exactly the same as those of [`useQuery`](../framework/react/reference/functions/useQuery.md), except the following: `enabled, refetchInterval, refetchIntervalInBackground, refetchOnWindowFocus, refetchOnReconnect, refetchOnMount, notifyOnChangeProps, throwOnError, suspense, placeholderData`; which are strictly for useQuery and useInfiniteQuery. You can check the [source code](https://github.com/TanStack/query/blob/7cd2d192e6da3df0b08e334ea1cf04cd70478827/packages/query-core/src/types.ts#L119) for more clarity. - -**Returns** - -- `Promise` - -## `queryClient.infiniteQuery` - -`infiniteQuery` is similar to `query` but can be used to fetch and cache an infinite query. - -```tsx -try { - const data = await queryClient.infiniteQuery({ queryKey, queryFn }) - console.log(data.pages) -} catch (error) { - console.log(error) -} -``` - -**Options** - -The options for `infiniteQuery` are exactly the same as those of [`query`](#queryclient-query), with the addition of `initialPageParam`, `pages` and `getNextPageParam` options from [`useInfiniteQuery`](../framework/react/reference/functions/useInfiniteQuery.md). - -**Returns** - -- `Promise>` - -## `queryClient.getQueriesData` - -`getQueriesData` is a synchronous function that can be used to get the cached data of multiple queries. Only queries that match the passed queryKey or queryFilter will be returned. If there are no matching queries, an empty array will be returned. - -```tsx -const data = queryClient.getQueriesData(filters) -``` - -**Options** - -- `filters: QueryFilters`: [Query Filters](../framework/react/guides/filters.md#query-filters) - - if a filter is passed, the data with queryKeys matching the filter will be returned - -**Returns** - -- `[queryKey: QueryKey, data: TQueryFnData | undefined][]` - - An array of tuples for the matched query keys, or `[]` if there are no matches. The tuples are the query key and its associated data. - -**Caveats** - -Because the returned data in each tuple can be of varying structures (i.e. using a filter to return "active" queries can return different data types), the `TData` generic defaults to `unknown`. If you provide a more specific type to `TData` it is assumed that you are certain each tuple's data entry is all the same type. - -This distinction is more a "convenience" for ts devs that know which structure will be returned. - -## `queryClient.setQueryData` - -`setQueryData` is a synchronous function that can be used to immediately update a query's cached data. If the query does not exist, it will be created. **If the query is not utilized by a query hook within the default `gcTime`, the query will be garbage collected. If the default `gcTime` has not been configured, it defaults to 5 minutes.** To update multiple queries at once and match query keys partially, you need to use [`queryClient.setQueriesData`](#queryclient-setqueriesdata) instead. - -> The difference between using `setQueryData` and `query` is that `setQueryData` is sync and assumes that you already synchronously have the data available. If you need to fetch the data asynchronously, it's suggested that you either refetch the query key or use `query` to handle the asynchronous fetch. - -```tsx -queryClient.setQueryData(queryKey, updater) -``` - -**Options** - -- `queryKey: QueryKey`: [Query Keys](../framework/react/guides/query-keys.md) -- `updater: TQueryFnData | undefined | ((oldData: TQueryFnData | undefined) => TQueryFnData | undefined)` - - If non-function is passed, the data will be updated to this value - - If a function is passed, it will receive the old data value and be expected to return a new one. - -**Using an updater value** - -```tsx -setQueryData(queryKey, newData) -``` - -If the value is `undefined`, the query data is not updated. - -**Using an updater function** - -For convenience in syntax, you can also pass an updater function which receives the current data value and returns the new one: - -```tsx -setQueryData(queryKey, (oldData) => newData) -``` - -If the updater function returns `undefined`, the query data will not be updated. If the updater function receives `undefined` as input, you can return `undefined` to bail out of the update and thus _not_ create a new cache entry. - -**Immutability** - -Updates via `setQueryData` must be performed in an _immutable_ way. **DO NOT** attempt to write directly to the cache by mutating `oldData` or data that you retrieved via `getQueryData` in place. - -## `queryClient.getQueryState` - -`getQueryState` is a synchronous function that can be used to get an existing query's state. If the query does not exist, `undefined` will be returned. - -```tsx -const state = queryClient.getQueryState(queryKey) -console.log(state.dataUpdatedAt) -``` - -**Options** - -- `queryKey: QueryKey`: [Query Keys](../framework/react/guides/query-keys.md) - -## `queryClient.setQueriesData` - -`setQueriesData` is a synchronous function that can be used to immediately update cached data of multiple queries by using filter function or partially matching the query key. Only queries that match the passed queryKey or queryFilter will be updated - no new cache entries will be created. Under the hood, [`setQueryData`](#queryclient-setquerydata) is called for each existing query. - -```tsx -queryClient.setQueriesData(filters, updater) -``` - -**Options** - -- `filters: QueryFilters`: [Query Filters](../framework/react/guides/filters.md#query-filters) - - if a filter is passed, queryKeys matching the filter will be updated -- `updater: TQueryFnData | (oldData: TQueryFnData | undefined) => TQueryFnData` - - the [setQueryData](#queryclient-setquerydata) updater function or new data, will be called for each matching queryKey - -## `queryClient.invalidateQueries` - -The `invalidateQueries` method can be used to invalidate and refetch single or multiple queries in the cache based on their query keys or any other functionally accessible property/state of the query. By default, all matching queries are immediately marked as invalid and active queries are refetched in the background. - -- If you **do not want active queries to refetch**, and simply be marked as invalid, you can use the `refetchType: 'none'` option. -- If you **want inactive queries to refetch** as well, use the `refetchType: 'all'` option -- For refetching, [queryClient.refetchQueries](#queryclient-refetchqueries) is called. - -```tsx -await queryClient.invalidateQueries( - { - queryKey: ['posts'], - exact, - refetchType: 'active', - }, - { throwOnError, cancelRefetch }, -) -``` - -**Options** - -- `filters?: QueryFilters`: [Query Filters](../framework/react/guides/filters.md#query-filters) - - `queryKey?: QueryKey`: [Query Keys](../framework/react/guides/query-keys.md) - - `refetchType?: 'active' | 'inactive' | 'all' | 'none'` - - Defaults to `'active'` - - When set to `active`, only queries that match the refetch predicate and are actively being rendered via `useQuery` and friends will be refetched in the background. - - When set to `inactive`, only queries that match the refetch predicate and are NOT actively being rendered via `useQuery` and friends will be refetched in the background. - - When set to `all`, all queries that match the refetch predicate will be refetched in the background. - - When set to `none`, no queries will be refetched, and those that match the refetch predicate will be marked as invalid only. -- `options?: InvalidateOptions`: - - `throwOnError?: boolean` - - When set to `true`, this method will throw if any of the query refetch tasks fail. - - `cancelRefetch?: boolean` - - Defaults to `true` - - Per default, a currently running request will be cancelled before a new request is made - - When set to `false`, no refetch will be made if there is already a request running. - -**Notes** - -- Unlike [`refetchQueries`](#queryclient-refetchqueries), `invalidateQueries` marks matching queries as invalidated and then refetches `active` queries (unless otherwise specified with the `refetchType` option). -- Unlike [`removeQueries`](#queryclient-removequeries), `invalidateQueries` keeps matching queries in the cache. - -## `queryClient.refetchQueries` - -The `refetchQueries` method can be used to refetch queries based on certain conditions. - -Examples: - -```tsx -// refetch all queries: -await queryClient.refetchQueries() - -// refetch all stale queries: -await queryClient.refetchQueries({ stale: true }) - -// refetch all active queries partially matching a query key: -await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' }) - -// refetch all active queries exactly matching a query key: -await queryClient.refetchQueries({ - queryKey: ['posts', 1], - type: 'active', - exact: true, -}) -``` - -**Options** - -- `filters?: QueryFilters`: [Query Filters](../framework/react/guides/filters.md#query-filters) -- `options?: RefetchOptions`: - - `throwOnError?: boolean` - - When set to `true`, this method will throw if any of the query refetch tasks fail. - - `cancelRefetch?: boolean` - - Defaults to `true` - - Per default, a currently running request will be cancelled before a new request is made - - When set to `false`, no refetch will be made if there is already a request running. - -**Returns** - -This function returns a promise that will resolve when all of the queries are done being refetched. By default, it **will not** throw an error if any of those queries refetches fail, but this can be configured by setting the `throwOnError` option to `true` - -**Notes** - -- Queries that are "disabled" because they only have disabled Observers will never be refetched. -- Queries that are "static" because they only have Observers with a Static StaleTime will never be refetched. -- Unlike [`invalidateQueries`](#queryclient-invalidatequeries), `refetchQueries` refetches all matching queries. - -## `queryClient.cancelQueries` - -The `cancelQueries` method can be used to cancel outgoing queries based on their query keys or any other functionally accessible property/state of the query. - -This is most useful when performing optimistic updates since you will likely need to cancel any outgoing query refetches so they don't clobber your optimistic update when they resolve. - -```tsx -await queryClient.cancelQueries( - { queryKey: ['posts'], exact: true }, - { silent: true }, -) -``` - -**Options** - -- `filters?: QueryFilters`: [Query Filters](../framework/react/guides/filters.md#query-filters) -- `cancelOptions?: CancelOptions`: [Cancel Options](../framework/react/guides/query-cancellation.md#cancel-options) - -**Returns** - -This method does not return anything - -## `queryClient.removeQueries` - -The `removeQueries` method can be used to remove queries from the cache based on their query keys or any other functionally accessible property/state of the query. - -```tsx -queryClient.removeQueries({ queryKey, exact: true }) -``` - -**Options** - -- `filters?: QueryFilters`: [Query Filters](../framework/react/guides/filters.md#query-filters) - -**Returns** - -This method does not return anything - -**Notes** - -- Unlike [`invalidateQueries`](#queryclient-invalidatequeries) or [`refetchQueries`](#queryclient-refetchqueries), `removeQueries` removes matching queries from the cache instead of refetching them. - -## `queryClient.resetQueries` - -The `resetQueries` method can be used to reset queries in the cache to their -initial state based on their query keys or any other functionally accessible -property/state of the query. - -This will notify subscribers — unlike `clear`, which removes all -subscribers — and reset the query to its pre-loaded state — unlike -`invalidateQueries`. If a query has `initialData`, the query's data will be -reset to that. If a query is active, it will be refetched. - -```tsx -queryClient.resetQueries({ queryKey, exact: true }) -``` - -**Options** - -- `filters?: QueryFilters`: [Query Filters](../framework/react/guides/filters.md#query-filters) -- `options?: ResetOptions`: - - `throwOnError?: boolean` - - When set to `true`, this method will throw if any of the query refetch tasks fail. - - `cancelRefetch?: boolean` - - Defaults to `true` - - Per default, a currently running request will be cancelled before a new request is made - - When set to `false`, no refetch will be made if there is already a request running. - -**Returns** - -This method returns a promise that resolves when all active queries have been refetched. - -## `queryClient.isFetching` - -This `isFetching` method returns an `integer` representing how many queries, if any, in the cache are currently fetching (including background-fetching, loading new pages, or loading more infinite query results) - -```tsx -if (queryClient.isFetching()) { - console.log('At least one query is fetching!') -} -``` - -TanStack Query also exports a handy [`useIsFetching`](../framework/react/reference/functions/useIsFetching.md) hook that will let you subscribe to this state in your components without creating a manual subscription to the query cache. - -**Options** - -- `filters?: QueryFilters`: [Query Filters](../framework/react/guides/filters.md#query-filters) - -**Returns** - -This method returns the number of fetching queries. - -## `queryClient.isMutating` - -This `isMutating` method returns an `integer` representing how many mutations, if any, in the cache are currently fetching. - -```tsx -if (queryClient.isMutating()) { - console.log('At least one mutation is fetching!') -} -``` - -TanStack Query also exports a handy [`useIsMutating`](../framework/react/reference/functions/useIsMutating.md) hook that will let you subscribe to this state in your components without creating a manual subscription to the mutation cache. - -**Options** - -- `filters: MutationFilters`: [Mutation Filters](../framework/react/guides/filters.md#mutation-filters) - -**Returns** - -This method returns the number of fetching mutations. - -## `queryClient.getDefaultOptions` - -The `getDefaultOptions` method returns the default options which have been set when creating the client or with `setDefaultOptions`. - -```tsx -const defaultOptions = queryClient.getDefaultOptions() -``` - -## `queryClient.setDefaultOptions` - -The `setDefaultOptions` method can be used to dynamically set the default options for this queryClient. Previously defined default options will be overwritten. - -```tsx -queryClient.setDefaultOptions({ - queries: { - staleTime: Infinity, - }, -}) -``` - -## `queryClient.getQueryDefaults` - -The `getQueryDefaults` method returns the default options which have been set for specific queries: - -```tsx -const defaultOptions = queryClient.getQueryDefaults(['posts']) -``` - -> Note that if several query defaults match the given query key, they will be merged together based on the order of registration. -> See [`setQueryDefaults`](#queryclient-setquerydefaults). - -## `queryClient.setQueryDefaults` - -`setQueryDefaults` can be used to set default options for specific queries: - -```tsx -queryClient.setQueryDefaults(['posts'], { queryFn: fetchPosts }) - -function Component() { - const { data } = useQuery({ queryKey: ['posts'] }) -} -``` - -**Options** - -- `queryKey: QueryKey`: [Query Keys](../framework/react/guides/query-keys.md) -- `options: QueryOptions` - -> As stated in [`getQueryDefaults`](#queryclient-getquerydefaults), the order of registration of query defaults does matter. -> Since the matching defaults are merged by `getQueryDefaults`, the registration should be made in the following order: from the **most generic key** to the **least generic one** . -> This way, more specific defaults will override more generic defaults. - -## `queryClient.getMutationDefaults` - -The `getMutationDefaults` method returns the default options which have been set for specific mutations: - -```tsx -const defaultOptions = queryClient.getMutationDefaults(['addPost']) -``` - -## `queryClient.setMutationDefaults` - -`setMutationDefaults` can be used to set default options for specific mutations: - -```tsx -queryClient.setMutationDefaults(['addPost'], { mutationFn: addPost }) - -function Component() { - const { data } = useMutation({ mutationKey: ['addPost'] }) -} -``` - -**Options** - -- `mutationKey: unknown[]` -- `options: MutationOptions` - -> Similar to [`setQueryDefaults`](#queryclient-setquerydefaults), the order of registration does matter here. - -## `queryClient.getQueryCache` - -The `getQueryCache` method returns the query cache this client is connected to. - -```tsx -const queryCache = queryClient.getQueryCache() -``` - -## `queryClient.getMutationCache` - -The `getMutationCache` method returns the mutation cache this client is connected to. - -```tsx -const mutationCache = queryClient.getMutationCache() -``` - -## `queryClient.clear` - -The `clear` method clears all connected caches. - -```tsx -queryClient.clear() -``` - -## `queryClient.resumePausedMutations` - -Can be used to resume mutations that have been paused because there was no network connection. - -```tsx -queryClient.resumePausedMutations() -``` diff --git a/docs/reference/QueryObserver.md b/docs/reference/QueryObserver.md deleted file mode 100644 index da291efa9fc..00000000000 --- a/docs/reference/QueryObserver.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -id: QueryObserver -title: QueryObserver -redirect_from: - - framework/react/reference/QueryObserver ---- - -The `QueryObserver` can be used to observe and switch between queries. - -```tsx -const observer = new QueryObserver(queryClient, { queryKey: ['posts'] }) - -const unsubscribe = observer.subscribe((result) => { - console.log(result) - unsubscribe() -}) -``` - -**Options** - -The options for the `QueryObserver` are exactly the same as those of [`useQuery`](../framework/react/reference/functions/useQuery.md). diff --git a/docs/reference/environmentManager.md b/docs/reference/environmentManager.md deleted file mode 100644 index 04dd25ace7c..00000000000 --- a/docs/reference/environmentManager.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: EnvironmentManager -title: environmentManager ---- - -The `environmentManager` manages how TanStack Query detects whether the current runtime should be treated as server-side. - -By default, it uses the same server detection as the exported `isServer` utility from query-core. - -Use this manager to override server detection globally for runtimes that are not traditional browser/server environments (for example, extension workers). - -Its available methods are: - -- [`isServer`](#environmentmanager-isserver) -- [`setIsServer`](#environmentmanager-setisserver) - -## `environmentManager.isServer` - -Returns whether the current runtime is treated as a server environment. - -```tsx -import { environmentManager } from '@tanstack/react-query' - -const server = environmentManager.isServer() -``` - -## `environmentManager.setIsServer` - -Overrides the server check globally. - -```tsx -import { environmentManager } from '@tanstack/react-query' - -// Override -environmentManager.setIsServer(() => { - return typeof window === 'undefined' && !('chrome' in globalThis) -}) -``` - -**Options** - -- `isServerValue: () => boolean` - -To restore the default behavior, set the function back to query-core's `isServer` utility: - -```tsx -import { environmentManager, isServer } from '@tanstack/react-query' - -environmentManager.setIsServer(() => isServer) -``` diff --git a/docs/reference/focusManager.md b/docs/reference/focusManager.md deleted file mode 100644 index 4eb4dd82fd4..00000000000 --- a/docs/reference/focusManager.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -id: FocusManager -title: FocusManager -redirect_from: - - framework/react/reference/focusManager ---- - -The `FocusManager` manages the focus state within TanStack Query. - -It can be used to change the default event listeners or to manually change the focus state. - -Its available methods are: - -- [`setEventListener`](#focusmanager-seteventlistener) -- [`subscribe`](#focusmanager-subscribe) -- [`setFocused`](#focusmanager-setfocused) -- [`isFocused`](#focusmanager-isfocused) - -## `focusManager.setEventListener` - -`setEventListener` can be used to set a custom event listener: - -```tsx -import { focusManager } from '@tanstack/react-query' - -focusManager.setEventListener((handleFocus) => { - // Listen to visibilitychange - if (typeof window !== 'undefined' && window.addEventListener) { - window.addEventListener('visibilitychange', handleFocus, false) - } - - return () => { - // Be sure to unsubscribe if a new handler is set - window.removeEventListener('visibilitychange', handleFocus) - } -}) -``` - -## `focusManager.subscribe` - -`subscribe` can be used to subscribe to changes in the visibility state. It returns an unsubscribe function: - -```tsx -import { focusManager } from '@tanstack/react-query' - -const unsubscribe = focusManager.subscribe((isVisible) => { - console.log('isVisible', isVisible) -}) -``` - -## `focusManager.setFocused` - -`setFocused` can be used to manually set the focus state. Set `undefined` to fall back to the default focus check. - -```tsx -import { focusManager } from '@tanstack/react-query' - -// Set focused -focusManager.setFocused(true) - -// Set unfocused -focusManager.setFocused(false) - -// Fallback to the default focus check -focusManager.setFocused(undefined) -``` - -**Options** - -- `focused: boolean | undefined` - -## `focusManager.isFocused` - -`isFocused` can be used to get the current focus state. - -```tsx -const isFocused = focusManager.isFocused() -``` diff --git a/docs/reference/notifyManager.md b/docs/reference/notifyManager.md deleted file mode 100644 index fdb8c83bb3c..00000000000 --- a/docs/reference/notifyManager.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -id: NotifyManager -title: NotifyManager -redirect_from: - - framework/react/reference/notifyManager ---- - -The `notifyManager` handles scheduling and batching callbacks in TanStack Query. - -It exposes the following methods: - -- [batch](#notifymanager-batch) -- [batchCalls](#notifymanager-batchcalls) -- [schedule](#notifymanager-schedule) -- [setNotifyFunction](#notifymanager-setnotifyfunction) -- [setBatchNotifyFunction](#notifymanager-setbatchnotifyfunction) -- [setScheduler](#notifymanager-setscheduler) - -## `notifyManager.batch` - -`batch` can be used to batch all updates scheduled inside the passed callback. -This is mainly used internally to optimize queryClient updating. - -```ts -function batch(callback: () => T): T -``` - -## `notifyManager.batchCalls` - -`batchCalls` is a higher-order function that takes a callback and wraps it. -All calls to the wrapped function schedule the callback to be run on the next batch. - -```ts -type BatchCallsCallback> = (...args: T) => void - -function batchCalls>( - callback: BatchCallsCallback, -): BatchCallsCallback -``` - -## `notifyManager.schedule` - -`schedule` schedules a function to be run on the next batch. By default, the batch is run -with a setTimeout, but this can be configured. - -```ts -function schedule(callback: () => void): void -``` - -## `notifyManager.setNotifyFunction` - -`setNotifyFunction` overrides the notify function. This function is passed the -callback when it should be executed. The default notifyFunction just calls it. - -This can be used to for example wrap notifications with `React.act` while running tests: - -```ts -import { notifyManager } from '@tanstack/react-query' -import { act } from 'react-dom/test-utils' - -notifyManager.setNotifyFunction(act) -``` - -## `notifyManager.setBatchNotifyFunction` - -`setBatchNotifyFunction` sets the function to use for batched updates - -If your framework supports a custom batching function, you can let TanStack Query know about it by calling notifyManager.setBatchNotifyFunction. - -For example, this is how the batch function is set in solid-query: - -```ts -import { notifyManager } from '@tanstack/query-core' -import { batch } from 'solid-js' - -notifyManager.setBatchNotifyFunction(batch) -``` - -## `notifyManager.setScheduler` - -`setScheduler` configures a custom callback that should schedules when the next -batch runs. The default behaviour is `setTimeout(callback, 0)`. - -```ts -import { notifyManager } from '@tanstack/react-query' - -// Schedule batches in the next microtask -notifyManager.setScheduler(queueMicrotask) - -// Schedule batches before the next frame is rendered -notifyManager.setScheduler(requestAnimationFrame) - -// Schedule batches some time in the future -notifyManager.setScheduler((cb) => setTimeout(cb, 10)) -``` diff --git a/docs/reference/onlineManager.md b/docs/reference/onlineManager.md deleted file mode 100644 index d64d54f2e8e..00000000000 --- a/docs/reference/onlineManager.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -id: OnlineManager -title: OnlineManager -redirect_from: - - framework/react/reference/onlineManager ---- - -The `OnlineManager` manages the online state within TanStack Query. It can be used to change the default event listeners or to manually change the online state. - -> Per default, the `onlineManager` assumes an active network connection, and listens to the `online` and `offline` events on the `window` object to detect changes. - -> In previous versions, `navigator.onLine` was used to determine the network status. However, it doesn't work well in Chromium based browsers. There are [a lot of issues](https://bugs.chromium.org/p/chromium/issues/list?q=navigator.online) around false negatives, which lead to Queries being wrongfully marked as `offline`. - -> To circumvent this, we now always start with `online: true` and only listen to `online` and `offline` events to update the status. - -> This should reduce the likelihood of false negatives, however, it might mean false positives for offline apps that load via serviceWorkers, which can work even without an internet connection. - -Its available methods are: - -- [`setEventListener`](#onlinemanager-seteventlistener) -- [`subscribe`](#onlinemanager-subscribe) -- [`setOnline`](#onlinemanager-setonline) -- [`isOnline`](#onlinemanager-isonline) - -## `onlineManager.setEventListener` - -`setEventListener` can be used to set a custom event listener: - -```tsx -import NetInfo from '@react-native-community/netinfo' -import { onlineManager } from '@tanstack/react-query' - -onlineManager.setEventListener((setOnline) => { - return NetInfo.addEventListener((state) => { - setOnline(!!state.isConnected) - }) -}) -``` - -## `onlineManager.subscribe` - -`subscribe` can be used to subscribe to changes in the online state. It returns an unsubscribe function: - -```tsx -import { onlineManager } from '@tanstack/react-query' - -const unsubscribe = onlineManager.subscribe((isOnline) => { - console.log('isOnline', isOnline) -}) -``` - -## `onlineManager.setOnline` - -`setOnline` can be used to manually set the online state. - -```tsx -import { onlineManager } from '@tanstack/react-query' - -// Set to online -onlineManager.setOnline(true) - -// Set to offline -onlineManager.setOnline(false) -``` - -**Options** - -- `online: boolean` - -## `onlineManager.isOnline` - -`isOnline` can be used to get the current online state. - -```tsx -const isOnline = onlineManager.isOnline() -``` diff --git a/docs/reference/streamedQuery.md b/docs/reference/streamedQuery.md deleted file mode 100644 index c708288fae4..00000000000 --- a/docs/reference/streamedQuery.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -id: streamedQuery -title: streamedQuery ---- - -`streamedQuery` is a helper function to create a query function that streams data from an [AsyncIterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncIterator). Data will be an Array of all the chunks received. The query will be in a `pending` state until the first chunk of data is received, but will go to `success` after that. The query will stay in fetchStatus `fetching` until the stream ends. - -To see `streamedQuery` in action, take a look at our chat example in the [examples/react/chat directory on GitHub](https://github.com/TanStack/query/tree/main/examples/react/chat). - -```tsx -import { experimental_streamedQuery as streamedQuery } from '@tanstack/react-query' - -const query = queryOptions({ - queryKey: ['data'], - queryFn: streamedQuery({ - streamFn: fetchDataInChunks, - }), -}) -``` - -> Note: `streamedQuery` is currently marked as `experimental` because we want to gather feedback from the community. If you've tried out the API and have feedback for us, please provide it in this [GitHub discussion](https://github.com/TanStack/query/discussions/9065). - -**Options** - -- `streamFn: (context: QueryFunctionContext) => Promise>` - - **Required** - - The function that returns a Promise of an AsyncIterable with data to stream in. - - Receives a [QueryFunctionContext](../framework/react/guides/query-functions.md#queryfunctioncontext) -- `refetchMode?: 'append' | 'reset' | 'replace'` - - Optional - - Defines how refetches are handled. - - Defaults to `'reset'` - - When set to `'reset'`, the query will erase all data and go back into `pending` state. - - When set to `'append'`, data will be appended to existing data. - - When set to `'replace'`, all data will be written to the cache once the stream ends. -- `reducer?: (accumulator: TData, chunk: TQueryFnData) => TData` - - Optional - - Reduces streamed chunks (`TQueryFnData`) into the final data shape (`TData`). - - Default: appends each chunk to the end of the accumulator when `TData` is an array. - - If `TData` is not an array, you must provide a custom `reducer`. -- `initialValue?: TData = TQueryFnData` - - Optional - - Defines the initial data to be used while the first chunk is being fetched, and it is also returned when the stream yields no values. - - It is mandatory when custom `reducer` is provided. - - Defaults to an empty array. diff --git a/docs/reference/timeoutManager.md b/docs/reference/timeoutManager.md deleted file mode 100644 index 12f1d0eee2c..00000000000 --- a/docs/reference/timeoutManager.md +++ /dev/null @@ -1,119 +0,0 @@ ---- -id: TimeoutManager -title: TimeoutManager ---- - -The `TimeoutManager` handles `setTimeout` and `setInterval` timers in TanStack Query. - -TanStack Query uses timers to implement features like query `staleTime` and `gcTime`, as well as retries, throttling, and debouncing. - -By default, TimeoutManager uses the global `setTimeout` and `setInterval`, but it can be configured to use custom implementations instead. - -Its available methods are: - -- [`timeoutManager.setTimeoutProvider`](#timeoutmanager-settimeoutprovider) - - [`TimeoutProvider`](#timeoutprovider) -- [`timeoutManager.setTimeout`](#timeoutmanager-settimeout) -- [`timeoutManager.clearTimeout`](#timeoutmanager-cleartimeout) -- [`timeoutManager.setInterval`](#timeoutmanager-setinterval) -- [`timeoutManager.clearInterval`](#timeoutmanager-clearinterval) - -## `timeoutManager.setTimeoutProvider` - -`setTimeoutProvider` can be used to set a custom implementation of the `setTimeout`, `clearTimeout`, `setInterval`, `clearInterval` functions, called a `TimeoutProvider`. - -This may be useful if you notice event loop performance issues with thousands of queries. A custom TimeoutProvider could also support timer delays longer than the global `setTimeout` maximum delay value of about [24 days](https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout#maximum_delay_value). - -It is important to call `setTimeoutProvider` before creating a QueryClient or queries, so that the same provider is used consistently for all timers in the application, since different TimeoutProviders cannot cancel each others' timers. - -```tsx -import { timeoutManager, QueryClient } from '@tanstack/react-query' -import { CustomTimeoutProvider } from './CustomTimeoutProvider' - -timeoutManager.setTimeoutProvider(new CustomTimeoutProvider()) - -export const queryClient = new QueryClient() -``` - -### `TimeoutProvider` - -Timers are very performance sensitive. Short term timers (such as those with delays less than 5 seconds) tend to be latency sensitive, where long-term timers may benefit more from [timer coalescing](https://en.wikipedia.org/wiki/Timer_coalescing) - batching timers with similar deadlines together - using a data structure like a [hierarchical time wheel](https://www.npmjs.com/package/timer-wheel). - -The `TimeoutProvider` type requires that implementations handle timer ID objects that can be converted to `number` via [Symbol.toPrimitive][toPrimitive] because runtimes like NodeJS return [objects][nodejs-timeout] from their global `setTimeout` and `setInterval` functions. TimeoutProvider implementations are free to coerce timer IDs to number internally, or to return their own custom object type that implements `{ [Symbol.toPrimitive]: () => number }`. - -[nodejs-timeout]: https://nodejs.org/api/timers.html#class-timeout -[toPrimitive]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toPrimitive - -```tsx -type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number } - -type TimeoutProvider = { - readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId - readonly clearTimeout: (timeoutId: TTimerId | undefined) => void - - readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId - readonly clearInterval: (intervalId: TTimerId | undefined) => void -} -``` - -## `timeoutManager.setTimeout` - -`setTimeout(callback, delayMs)` schedules a callback to run after approximately `delay` milliseconds, like the global [setTimeout function](https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout).The callback can be canceled with `timeoutManager.clearTimeout`. - -It returns a timer ID, which may be a number or an object that can be coerced to a number via [Symbol.toPrimitive][toPrimitive]. - -```tsx -import { timeoutManager } from '@tanstack/react-query' - -const timeoutId = timeoutManager.setTimeout( - () => console.log('ran at:', new Date()), - 1000, -) - -const timeoutIdNumber: number = Number(timeoutId) -``` - -## `timeoutManager.clearTimeout` - -`clearTimeout(timerId)` cancels a timeout callback scheduled with `setTimeout`, like the global [clearTimeout function](https://developer.mozilla.org/en-US/docs/Web/API/Window/clearTimeout). It should be called with a timer ID returned by `timeoutManager.setTimeout`. - -```tsx -import { timeoutManager } from '@tanstack/react-query' - -const timeoutId = timeoutManager.setTimeout( - () => console.log('ran at:', new Date()), - 1000, -) - -timeoutManager.clearTimeout(timeoutId) -``` - -## `timeoutManager.setInterval` - -`setInterval(callback, intervalMs)` schedules a callback to be called approximately every `intervalMs`, like the global [setInterval function](https://developer.mozilla.org/en-US/docs/Web/API/Window/setInterval). - -Like `setTimeout`, it returns a timer ID, which may be a number or an object that can be coerced to a number via [Symbol.toPrimitive](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toPrimitive). - -```tsx -import { timeoutManager } from '@tanstack/react-query' - -const intervalId = timeoutManager.setInterval( - () => console.log('ran at:', new Date()), - 1000, -) -``` - -## `timeoutManager.clearInterval` - -`clearInterval(intervalId)` can be used to cancel an interval, like the global [clearInterval function](https://developer.mozilla.org/en-US/docs/Web/API/Window/clearInterval). It should be called with an interval ID returned by `timeoutManager.setInterval`. - -```tsx -import { timeoutManager } from '@tanstack/react-query' - -const intervalId = timeoutManager.setInterval( - () => console.log('ran at:', new Date()), - 1000, -) - -timeoutManager.clearInterval(intervalId) -``` diff --git a/packages/query-core/src/index.ts b/packages/query-core/src/index.ts index e25e16b4246..7d9dd23379f 100644 --- a/packages/query-core/src/index.ts +++ b/packages/query-core/src/index.ts @@ -1,6 +1,7 @@ /* istanbul ignore file */ export { focusManager } from './focusManager' +export type { FocusManager } from './focusManager' export { environmentManager } from './environmentManager' export { defaultShouldDehydrateMutation, @@ -15,6 +16,7 @@ export type { MutationCacheNotifyEvent } from './mutationCache' export { MutationObserver } from './mutationObserver' export { defaultScheduler, notifyManager } from './notifyManager' export { onlineManager } from './onlineManager' +export type { OnlineManager } from './onlineManager' export { QueriesObserver } from './queriesObserver' export { QueryCache } from './queryCache' export type { QueryCacheNotifyEvent } from './queryCache' @@ -25,6 +27,7 @@ export { timeoutManager, type ManagedTimerId, type TimeoutCallback, + type TimeoutManager, type TimeoutProvider, } from './timeoutManager' export { diff --git a/scripts/generate-docs.ts b/scripts/generate-docs.ts index 9b4c123e182..cb434c61969 100644 --- a/scripts/generate-docs.ts +++ b/scripts/generate-docs.ts @@ -280,6 +280,50 @@ const packages: Array = [ 'functions/useSuspenseQuery': [ 'framework/react/reference/useSuspenseQuery', ], + // Redirects from the legacy hand-written docs/reference/*.md pages, removed in favor of + // this generated reference. + 'classes/QueryClient': [ + 'reference/QueryClient', + 'framework/react/reference/QueryClient', + ], + 'classes/QueryCache': [ + 'reference/QueryCache', + 'framework/react/reference/QueryCache', + ], + 'classes/MutationCache': [ + 'reference/MutationCache', + 'framework/react/reference/MutationCache', + ], + 'classes/QueryObserver': [ + 'reference/QueryObserver', + 'framework/react/reference/QueryObserver', + ], + 'classes/InfiniteQueryObserver': [ + 'reference/InfiniteQueryObserver', + 'framework/react/reference/InfiniteQueryObserver', + ], + 'classes/QueriesObserver': [ + 'reference/QueriesObserver', + 'framework/react/reference/QueriesObserver', + ], + // focusManager/onlineManager/timeoutManager are class instances, not object literals, so + // TypeDoc can't inline their methods onto the `variables/*` instance page — the method docs + // that the legacy pages covered now live on the `interfaces/*` page for the class itself. + 'interfaces/FocusManager': [ + 'reference/focusManager', + 'framework/react/reference/focusManager', + ], + 'interfaces/OnlineManager': [ + 'reference/onlineManager', + 'framework/react/reference/onlineManager', + ], + 'interfaces/TimeoutManager': ['reference/timeoutManager'], + 'variables/notifyManager': [ + 'reference/notifyManager', + 'framework/react/reference/notifyManager', + ], + 'variables/environmentManager': ['reference/environmentManager'], + 'functions/experimental_streamedQuery': ['reference/streamedQuery'], }, }, { From c79079933294fcbbabc93f654aa81227ee4cde95 Mon Sep 17 00:00:00 2001 From: Wonsuk Choi Date: Mon, 7 Sep 2026 04:21:19 +0900 Subject: [PATCH 5/9] docs(query-core): regenerate reference docs after merging main --- .../angular/reference/variables/environmentManager.md | 8 ++------ .../reference/functions/defaultShouldDehydrateMutation.md | 2 +- .../reference/functions/defaultShouldDehydrateQuery.md | 2 +- docs/framework/lit/reference/functions/dehydrate.md | 2 +- docs/framework/lit/reference/functions/dehydrateQuery.md | 2 +- docs/framework/lit/reference/functions/hydrate.md | 2 +- .../framework/lit/reference/interfaces/DehydratedState.md | 6 +++--- .../reference/functions/defaultShouldDehydrateMutation.md | 2 +- .../reference/functions/defaultShouldDehydrateQuery.md | 2 +- docs/framework/preact/reference/functions/dehydrate.md | 2 +- .../preact/reference/functions/dehydrateQuery.md | 2 +- docs/framework/preact/reference/functions/hydrate.md | 2 +- .../preact/reference/interfaces/DehydratedState.md | 6 +++--- .../reference/functions/defaultShouldDehydrateMutation.md | 2 +- .../reference/functions/defaultShouldDehydrateQuery.md | 2 +- docs/framework/react/reference/functions/dehydrate.md | 2 +- .../framework/react/reference/functions/dehydrateQuery.md | 2 +- docs/framework/react/reference/functions/hydrate.md | 2 +- .../react/reference/interfaces/DehydratedState.md | 6 +++--- .../reference/functions/defaultShouldDehydrateMutation.md | 2 +- .../reference/functions/defaultShouldDehydrateQuery.md | 2 +- docs/framework/solid/reference/functions/dehydrate.md | 2 +- .../framework/solid/reference/functions/dehydrateQuery.md | 2 +- docs/framework/solid/reference/functions/hydrate.md | 2 +- .../solid/reference/interfaces/DehydratedState.md | 6 +++--- .../reference/functions/defaultShouldDehydrateMutation.md | 2 +- .../reference/functions/defaultShouldDehydrateQuery.md | 2 +- docs/framework/svelte/reference/functions/dehydrate.md | 2 +- .../svelte/reference/functions/dehydrateQuery.md | 2 +- docs/framework/svelte/reference/functions/hydrate.md | 2 +- .../svelte/reference/interfaces/DehydratedState.md | 6 +++--- .../reference/functions/defaultShouldDehydrateMutation.md | 2 +- .../reference/functions/defaultShouldDehydrateQuery.md | 2 +- docs/framework/vue/reference/functions/dehydrate.md | 2 +- docs/framework/vue/reference/functions/dehydrateQuery.md | 2 +- docs/framework/vue/reference/functions/hydrate.md | 2 +- .../framework/vue/reference/interfaces/DehydratedState.md | 6 +++--- 37 files changed, 50 insertions(+), 54 deletions(-) diff --git a/docs/framework/angular/reference/variables/environmentManager.md b/docs/framework/angular/reference/variables/environmentManager.md index 6b5ddc28e1e..e2975e30dec 100644 --- a/docs/framework/angular/reference/variables/environmentManager.md +++ b/docs/framework/angular/reference/variables/environmentManager.md @@ -17,16 +17,12 @@ extension workers), where the default detection would give the wrong answer. ## Type Declaration -### isServer() +### isServer ```ts -isServer: () => boolean; +isServer: typeof isServer; ``` -#### Returns - -`boolean` - ### setIsServer() ```ts diff --git a/docs/framework/lit/reference/functions/defaultShouldDehydrateMutation.md b/docs/framework/lit/reference/functions/defaultShouldDehydrateMutation.md index 095ccf36e7c..940f8745a5d 100644 --- a/docs/framework/lit/reference/functions/defaultShouldDehydrateMutation.md +++ b/docs/framework/lit/reference/functions/defaultShouldDehydrateMutation.md @@ -7,7 +7,7 @@ title: defaultShouldDehydrateMutation function defaultShouldDehydrateMutation(mutation): boolean; ``` -Defined in: [packages/query-core/src/hydration.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L180) +Defined in: [packages/query-core/src/hydration.ts:177](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L177) The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are currently paused (e.g. paused by `networkMode` while offline). diff --git a/docs/framework/lit/reference/functions/defaultShouldDehydrateQuery.md b/docs/framework/lit/reference/functions/defaultShouldDehydrateQuery.md index 06afc29d670..abf19439d8a 100644 --- a/docs/framework/lit/reference/functions/defaultShouldDehydrateQuery.md +++ b/docs/framework/lit/reference/functions/defaultShouldDehydrateQuery.md @@ -7,7 +7,7 @@ title: defaultShouldDehydrateQuery function defaultShouldDehydrateQuery(query): boolean; ``` -Defined in: [packages/query-core/src/hydration.ts:188](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L188) +Defined in: [packages/query-core/src/hydration.ts:185](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L185) The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is `'success'`. diff --git a/docs/framework/lit/reference/functions/dehydrate.md b/docs/framework/lit/reference/functions/dehydrate.md index b7334de7729..33cdcd3940d 100644 --- a/docs/framework/lit/reference/functions/dehydrate.md +++ b/docs/framework/lit/reference/functions/dehydrate.md @@ -7,7 +7,7 @@ title: dehydrate function dehydrate(client, options): DehydratedState; ``` -Defined in: [packages/query-core/src/hydration.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L210) +Defined in: [packages/query-core/src/hydration.ts:207](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L207) Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`, typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`. diff --git a/docs/framework/lit/reference/functions/dehydrateQuery.md b/docs/framework/lit/reference/functions/dehydrateQuery.md index 33c5bfe477e..ae991427eb1 100644 --- a/docs/framework/lit/reference/functions/dehydrateQuery.md +++ b/docs/framework/lit/reference/functions/dehydrateQuery.md @@ -10,7 +10,7 @@ function dehydrateQuery( shouldRedactErrors?): DehydratedQuery; ``` -Defined in: [packages/query-core/src/hydration.ts:151](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L151) +Defined in: [packages/query-core/src/hydration.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L148) Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g. `queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the diff --git a/docs/framework/lit/reference/functions/hydrate.md b/docs/framework/lit/reference/functions/hydrate.md index 8a281b19214..3a9e6b1ace2 100644 --- a/docs/framework/lit/reference/functions/hydrate.md +++ b/docs/framework/lit/reference/functions/hydrate.md @@ -10,7 +10,7 @@ function hydrate( options?): void; ``` -Defined in: [packages/query-core/src/hydration.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L267) +Defined in: [packages/query-core/src/hydration.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L264) Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`. diff --git a/docs/framework/lit/reference/interfaces/DehydratedState.md b/docs/framework/lit/reference/interfaces/DehydratedState.md index 7edce60a00d..be034c9e8fd 100644 --- a/docs/framework/lit/reference/interfaces/DehydratedState.md +++ b/docs/framework/lit/reference/interfaces/DehydratedState.md @@ -3,7 +3,7 @@ id: DehydratedState title: DehydratedState --- -Defined in: [packages/query-core/src/hydration.ts:97](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L97) +Defined in: [packages/query-core/src/hydration.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L94) A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data @@ -17,7 +17,7 @@ that has already been fetched, avoiding a redundant fetch on the client. mutations: DehydratedMutation[]; ``` -Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L98) +Defined in: [packages/query-core/src/hydration.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L95) *** @@ -27,4 +27,4 @@ Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStac queries: DehydratedQuery[]; ``` -Defined in: [packages/query-core/src/hydration.ts:99](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L99) +Defined in: [packages/query-core/src/hydration.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L96) diff --git a/docs/framework/preact/reference/functions/defaultShouldDehydrateMutation.md b/docs/framework/preact/reference/functions/defaultShouldDehydrateMutation.md index 095ccf36e7c..940f8745a5d 100644 --- a/docs/framework/preact/reference/functions/defaultShouldDehydrateMutation.md +++ b/docs/framework/preact/reference/functions/defaultShouldDehydrateMutation.md @@ -7,7 +7,7 @@ title: defaultShouldDehydrateMutation function defaultShouldDehydrateMutation(mutation): boolean; ``` -Defined in: [packages/query-core/src/hydration.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L180) +Defined in: [packages/query-core/src/hydration.ts:177](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L177) The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are currently paused (e.g. paused by `networkMode` while offline). diff --git a/docs/framework/preact/reference/functions/defaultShouldDehydrateQuery.md b/docs/framework/preact/reference/functions/defaultShouldDehydrateQuery.md index 06afc29d670..abf19439d8a 100644 --- a/docs/framework/preact/reference/functions/defaultShouldDehydrateQuery.md +++ b/docs/framework/preact/reference/functions/defaultShouldDehydrateQuery.md @@ -7,7 +7,7 @@ title: defaultShouldDehydrateQuery function defaultShouldDehydrateQuery(query): boolean; ``` -Defined in: [packages/query-core/src/hydration.ts:188](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L188) +Defined in: [packages/query-core/src/hydration.ts:185](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L185) The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is `'success'`. diff --git a/docs/framework/preact/reference/functions/dehydrate.md b/docs/framework/preact/reference/functions/dehydrate.md index b7334de7729..33cdcd3940d 100644 --- a/docs/framework/preact/reference/functions/dehydrate.md +++ b/docs/framework/preact/reference/functions/dehydrate.md @@ -7,7 +7,7 @@ title: dehydrate function dehydrate(client, options): DehydratedState; ``` -Defined in: [packages/query-core/src/hydration.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L210) +Defined in: [packages/query-core/src/hydration.ts:207](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L207) Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`, typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`. diff --git a/docs/framework/preact/reference/functions/dehydrateQuery.md b/docs/framework/preact/reference/functions/dehydrateQuery.md index 2827d2ebb45..2314f52fd91 100644 --- a/docs/framework/preact/reference/functions/dehydrateQuery.md +++ b/docs/framework/preact/reference/functions/dehydrateQuery.md @@ -10,7 +10,7 @@ function dehydrateQuery( shouldRedactErrors?): DehydratedQuery; ``` -Defined in: [packages/query-core/src/hydration.ts:151](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L151) +Defined in: [packages/query-core/src/hydration.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L148) Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g. `queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the diff --git a/docs/framework/preact/reference/functions/hydrate.md b/docs/framework/preact/reference/functions/hydrate.md index dc55e38bf64..c0093b57457 100644 --- a/docs/framework/preact/reference/functions/hydrate.md +++ b/docs/framework/preact/reference/functions/hydrate.md @@ -10,7 +10,7 @@ function hydrate( options?): void; ``` -Defined in: [packages/query-core/src/hydration.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L267) +Defined in: [packages/query-core/src/hydration.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L264) Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`. diff --git a/docs/framework/preact/reference/interfaces/DehydratedState.md b/docs/framework/preact/reference/interfaces/DehydratedState.md index 7edce60a00d..be034c9e8fd 100644 --- a/docs/framework/preact/reference/interfaces/DehydratedState.md +++ b/docs/framework/preact/reference/interfaces/DehydratedState.md @@ -3,7 +3,7 @@ id: DehydratedState title: DehydratedState --- -Defined in: [packages/query-core/src/hydration.ts:97](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L97) +Defined in: [packages/query-core/src/hydration.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L94) A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data @@ -17,7 +17,7 @@ that has already been fetched, avoiding a redundant fetch on the client. mutations: DehydratedMutation[]; ``` -Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L98) +Defined in: [packages/query-core/src/hydration.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L95) *** @@ -27,4 +27,4 @@ Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStac queries: DehydratedQuery[]; ``` -Defined in: [packages/query-core/src/hydration.ts:99](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L99) +Defined in: [packages/query-core/src/hydration.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L96) diff --git a/docs/framework/react/reference/functions/defaultShouldDehydrateMutation.md b/docs/framework/react/reference/functions/defaultShouldDehydrateMutation.md index 095ccf36e7c..940f8745a5d 100644 --- a/docs/framework/react/reference/functions/defaultShouldDehydrateMutation.md +++ b/docs/framework/react/reference/functions/defaultShouldDehydrateMutation.md @@ -7,7 +7,7 @@ title: defaultShouldDehydrateMutation function defaultShouldDehydrateMutation(mutation): boolean; ``` -Defined in: [packages/query-core/src/hydration.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L180) +Defined in: [packages/query-core/src/hydration.ts:177](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L177) The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are currently paused (e.g. paused by `networkMode` while offline). diff --git a/docs/framework/react/reference/functions/defaultShouldDehydrateQuery.md b/docs/framework/react/reference/functions/defaultShouldDehydrateQuery.md index 06afc29d670..abf19439d8a 100644 --- a/docs/framework/react/reference/functions/defaultShouldDehydrateQuery.md +++ b/docs/framework/react/reference/functions/defaultShouldDehydrateQuery.md @@ -7,7 +7,7 @@ title: defaultShouldDehydrateQuery function defaultShouldDehydrateQuery(query): boolean; ``` -Defined in: [packages/query-core/src/hydration.ts:188](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L188) +Defined in: [packages/query-core/src/hydration.ts:185](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L185) The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is `'success'`. diff --git a/docs/framework/react/reference/functions/dehydrate.md b/docs/framework/react/reference/functions/dehydrate.md index b7334de7729..33cdcd3940d 100644 --- a/docs/framework/react/reference/functions/dehydrate.md +++ b/docs/framework/react/reference/functions/dehydrate.md @@ -7,7 +7,7 @@ title: dehydrate function dehydrate(client, options): DehydratedState; ``` -Defined in: [packages/query-core/src/hydration.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L210) +Defined in: [packages/query-core/src/hydration.ts:207](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L207) Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`, typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`. diff --git a/docs/framework/react/reference/functions/dehydrateQuery.md b/docs/framework/react/reference/functions/dehydrateQuery.md index 2827d2ebb45..2314f52fd91 100644 --- a/docs/framework/react/reference/functions/dehydrateQuery.md +++ b/docs/framework/react/reference/functions/dehydrateQuery.md @@ -10,7 +10,7 @@ function dehydrateQuery( shouldRedactErrors?): DehydratedQuery; ``` -Defined in: [packages/query-core/src/hydration.ts:151](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L151) +Defined in: [packages/query-core/src/hydration.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L148) Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g. `queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the diff --git a/docs/framework/react/reference/functions/hydrate.md b/docs/framework/react/reference/functions/hydrate.md index dc55e38bf64..c0093b57457 100644 --- a/docs/framework/react/reference/functions/hydrate.md +++ b/docs/framework/react/reference/functions/hydrate.md @@ -10,7 +10,7 @@ function hydrate( options?): void; ``` -Defined in: [packages/query-core/src/hydration.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L267) +Defined in: [packages/query-core/src/hydration.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L264) Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`. diff --git a/docs/framework/react/reference/interfaces/DehydratedState.md b/docs/framework/react/reference/interfaces/DehydratedState.md index 7edce60a00d..be034c9e8fd 100644 --- a/docs/framework/react/reference/interfaces/DehydratedState.md +++ b/docs/framework/react/reference/interfaces/DehydratedState.md @@ -3,7 +3,7 @@ id: DehydratedState title: DehydratedState --- -Defined in: [packages/query-core/src/hydration.ts:97](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L97) +Defined in: [packages/query-core/src/hydration.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L94) A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data @@ -17,7 +17,7 @@ that has already been fetched, avoiding a redundant fetch on the client. mutations: DehydratedMutation[]; ``` -Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L98) +Defined in: [packages/query-core/src/hydration.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L95) *** @@ -27,4 +27,4 @@ Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStac queries: DehydratedQuery[]; ``` -Defined in: [packages/query-core/src/hydration.ts:99](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L99) +Defined in: [packages/query-core/src/hydration.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L96) diff --git a/docs/framework/solid/reference/functions/defaultShouldDehydrateMutation.md b/docs/framework/solid/reference/functions/defaultShouldDehydrateMutation.md index 095ccf36e7c..940f8745a5d 100644 --- a/docs/framework/solid/reference/functions/defaultShouldDehydrateMutation.md +++ b/docs/framework/solid/reference/functions/defaultShouldDehydrateMutation.md @@ -7,7 +7,7 @@ title: defaultShouldDehydrateMutation function defaultShouldDehydrateMutation(mutation): boolean; ``` -Defined in: [packages/query-core/src/hydration.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L180) +Defined in: [packages/query-core/src/hydration.ts:177](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L177) The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are currently paused (e.g. paused by `networkMode` while offline). diff --git a/docs/framework/solid/reference/functions/defaultShouldDehydrateQuery.md b/docs/framework/solid/reference/functions/defaultShouldDehydrateQuery.md index 06afc29d670..abf19439d8a 100644 --- a/docs/framework/solid/reference/functions/defaultShouldDehydrateQuery.md +++ b/docs/framework/solid/reference/functions/defaultShouldDehydrateQuery.md @@ -7,7 +7,7 @@ title: defaultShouldDehydrateQuery function defaultShouldDehydrateQuery(query): boolean; ``` -Defined in: [packages/query-core/src/hydration.ts:188](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L188) +Defined in: [packages/query-core/src/hydration.ts:185](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L185) The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is `'success'`. diff --git a/docs/framework/solid/reference/functions/dehydrate.md b/docs/framework/solid/reference/functions/dehydrate.md index 451c558858c..816469e6119 100644 --- a/docs/framework/solid/reference/functions/dehydrate.md +++ b/docs/framework/solid/reference/functions/dehydrate.md @@ -7,7 +7,7 @@ title: dehydrate function dehydrate(client, options): DehydratedState; ``` -Defined in: [packages/query-core/src/hydration.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L210) +Defined in: [packages/query-core/src/hydration.ts:207](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L207) Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`, typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`. diff --git a/docs/framework/solid/reference/functions/dehydrateQuery.md b/docs/framework/solid/reference/functions/dehydrateQuery.md index 2827d2ebb45..2314f52fd91 100644 --- a/docs/framework/solid/reference/functions/dehydrateQuery.md +++ b/docs/framework/solid/reference/functions/dehydrateQuery.md @@ -10,7 +10,7 @@ function dehydrateQuery( shouldRedactErrors?): DehydratedQuery; ``` -Defined in: [packages/query-core/src/hydration.ts:151](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L151) +Defined in: [packages/query-core/src/hydration.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L148) Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g. `queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the diff --git a/docs/framework/solid/reference/functions/hydrate.md b/docs/framework/solid/reference/functions/hydrate.md index 1b9ad8025a4..0283d46b709 100644 --- a/docs/framework/solid/reference/functions/hydrate.md +++ b/docs/framework/solid/reference/functions/hydrate.md @@ -10,7 +10,7 @@ function hydrate( options?): void; ``` -Defined in: [packages/query-core/src/hydration.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L267) +Defined in: [packages/query-core/src/hydration.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L264) Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`. diff --git a/docs/framework/solid/reference/interfaces/DehydratedState.md b/docs/framework/solid/reference/interfaces/DehydratedState.md index 7edce60a00d..be034c9e8fd 100644 --- a/docs/framework/solid/reference/interfaces/DehydratedState.md +++ b/docs/framework/solid/reference/interfaces/DehydratedState.md @@ -3,7 +3,7 @@ id: DehydratedState title: DehydratedState --- -Defined in: [packages/query-core/src/hydration.ts:97](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L97) +Defined in: [packages/query-core/src/hydration.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L94) A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data @@ -17,7 +17,7 @@ that has already been fetched, avoiding a redundant fetch on the client. mutations: DehydratedMutation[]; ``` -Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L98) +Defined in: [packages/query-core/src/hydration.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L95) *** @@ -27,4 +27,4 @@ Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStac queries: DehydratedQuery[]; ``` -Defined in: [packages/query-core/src/hydration.ts:99](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L99) +Defined in: [packages/query-core/src/hydration.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L96) diff --git a/docs/framework/svelte/reference/functions/defaultShouldDehydrateMutation.md b/docs/framework/svelte/reference/functions/defaultShouldDehydrateMutation.md index 095ccf36e7c..940f8745a5d 100644 --- a/docs/framework/svelte/reference/functions/defaultShouldDehydrateMutation.md +++ b/docs/framework/svelte/reference/functions/defaultShouldDehydrateMutation.md @@ -7,7 +7,7 @@ title: defaultShouldDehydrateMutation function defaultShouldDehydrateMutation(mutation): boolean; ``` -Defined in: [packages/query-core/src/hydration.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L180) +Defined in: [packages/query-core/src/hydration.ts:177](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L177) The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are currently paused (e.g. paused by `networkMode` while offline). diff --git a/docs/framework/svelte/reference/functions/defaultShouldDehydrateQuery.md b/docs/framework/svelte/reference/functions/defaultShouldDehydrateQuery.md index 06afc29d670..abf19439d8a 100644 --- a/docs/framework/svelte/reference/functions/defaultShouldDehydrateQuery.md +++ b/docs/framework/svelte/reference/functions/defaultShouldDehydrateQuery.md @@ -7,7 +7,7 @@ title: defaultShouldDehydrateQuery function defaultShouldDehydrateQuery(query): boolean; ``` -Defined in: [packages/query-core/src/hydration.ts:188](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L188) +Defined in: [packages/query-core/src/hydration.ts:185](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L185) The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is `'success'`. diff --git a/docs/framework/svelte/reference/functions/dehydrate.md b/docs/framework/svelte/reference/functions/dehydrate.md index b7334de7729..33cdcd3940d 100644 --- a/docs/framework/svelte/reference/functions/dehydrate.md +++ b/docs/framework/svelte/reference/functions/dehydrate.md @@ -7,7 +7,7 @@ title: dehydrate function dehydrate(client, options): DehydratedState; ``` -Defined in: [packages/query-core/src/hydration.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L210) +Defined in: [packages/query-core/src/hydration.ts:207](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L207) Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`, typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`. diff --git a/docs/framework/svelte/reference/functions/dehydrateQuery.md b/docs/framework/svelte/reference/functions/dehydrateQuery.md index 2827d2ebb45..2314f52fd91 100644 --- a/docs/framework/svelte/reference/functions/dehydrateQuery.md +++ b/docs/framework/svelte/reference/functions/dehydrateQuery.md @@ -10,7 +10,7 @@ function dehydrateQuery( shouldRedactErrors?): DehydratedQuery; ``` -Defined in: [packages/query-core/src/hydration.ts:151](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L151) +Defined in: [packages/query-core/src/hydration.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L148) Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g. `queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the diff --git a/docs/framework/svelte/reference/functions/hydrate.md b/docs/framework/svelte/reference/functions/hydrate.md index dc55e38bf64..c0093b57457 100644 --- a/docs/framework/svelte/reference/functions/hydrate.md +++ b/docs/framework/svelte/reference/functions/hydrate.md @@ -10,7 +10,7 @@ function hydrate( options?): void; ``` -Defined in: [packages/query-core/src/hydration.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L267) +Defined in: [packages/query-core/src/hydration.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L264) Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`. diff --git a/docs/framework/svelte/reference/interfaces/DehydratedState.md b/docs/framework/svelte/reference/interfaces/DehydratedState.md index 7edce60a00d..be034c9e8fd 100644 --- a/docs/framework/svelte/reference/interfaces/DehydratedState.md +++ b/docs/framework/svelte/reference/interfaces/DehydratedState.md @@ -3,7 +3,7 @@ id: DehydratedState title: DehydratedState --- -Defined in: [packages/query-core/src/hydration.ts:97](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L97) +Defined in: [packages/query-core/src/hydration.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L94) A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data @@ -17,7 +17,7 @@ that has already been fetched, avoiding a redundant fetch on the client. mutations: DehydratedMutation[]; ``` -Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L98) +Defined in: [packages/query-core/src/hydration.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L95) *** @@ -27,4 +27,4 @@ Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStac queries: DehydratedQuery[]; ``` -Defined in: [packages/query-core/src/hydration.ts:99](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L99) +Defined in: [packages/query-core/src/hydration.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L96) diff --git a/docs/framework/vue/reference/functions/defaultShouldDehydrateMutation.md b/docs/framework/vue/reference/functions/defaultShouldDehydrateMutation.md index 095ccf36e7c..940f8745a5d 100644 --- a/docs/framework/vue/reference/functions/defaultShouldDehydrateMutation.md +++ b/docs/framework/vue/reference/functions/defaultShouldDehydrateMutation.md @@ -7,7 +7,7 @@ title: defaultShouldDehydrateMutation function defaultShouldDehydrateMutation(mutation): boolean; ``` -Defined in: [packages/query-core/src/hydration.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L180) +Defined in: [packages/query-core/src/hydration.ts:177](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L177) The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are currently paused (e.g. paused by `networkMode` while offline). diff --git a/docs/framework/vue/reference/functions/defaultShouldDehydrateQuery.md b/docs/framework/vue/reference/functions/defaultShouldDehydrateQuery.md index 06afc29d670..abf19439d8a 100644 --- a/docs/framework/vue/reference/functions/defaultShouldDehydrateQuery.md +++ b/docs/framework/vue/reference/functions/defaultShouldDehydrateQuery.md @@ -7,7 +7,7 @@ title: defaultShouldDehydrateQuery function defaultShouldDehydrateQuery(query): boolean; ``` -Defined in: [packages/query-core/src/hydration.ts:188](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L188) +Defined in: [packages/query-core/src/hydration.ts:185](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L185) The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is `'success'`. diff --git a/docs/framework/vue/reference/functions/dehydrate.md b/docs/framework/vue/reference/functions/dehydrate.md index 451c558858c..816469e6119 100644 --- a/docs/framework/vue/reference/functions/dehydrate.md +++ b/docs/framework/vue/reference/functions/dehydrate.md @@ -7,7 +7,7 @@ title: dehydrate function dehydrate(client, options): DehydratedState; ``` -Defined in: [packages/query-core/src/hydration.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L210) +Defined in: [packages/query-core/src/hydration.ts:207](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L207) Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`, typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`. diff --git a/docs/framework/vue/reference/functions/dehydrateQuery.md b/docs/framework/vue/reference/functions/dehydrateQuery.md index 2827d2ebb45..2314f52fd91 100644 --- a/docs/framework/vue/reference/functions/dehydrateQuery.md +++ b/docs/framework/vue/reference/functions/dehydrateQuery.md @@ -10,7 +10,7 @@ function dehydrateQuery( shouldRedactErrors?): DehydratedQuery; ``` -Defined in: [packages/query-core/src/hydration.ts:151](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L151) +Defined in: [packages/query-core/src/hydration.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L148) Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g. `queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the diff --git a/docs/framework/vue/reference/functions/hydrate.md b/docs/framework/vue/reference/functions/hydrate.md index 1b9ad8025a4..0283d46b709 100644 --- a/docs/framework/vue/reference/functions/hydrate.md +++ b/docs/framework/vue/reference/functions/hydrate.md @@ -10,7 +10,7 @@ function hydrate( options?): void; ``` -Defined in: [packages/query-core/src/hydration.ts:267](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L267) +Defined in: [packages/query-core/src/hydration.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L264) Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`. diff --git a/docs/framework/vue/reference/interfaces/DehydratedState.md b/docs/framework/vue/reference/interfaces/DehydratedState.md index 7edce60a00d..be034c9e8fd 100644 --- a/docs/framework/vue/reference/interfaces/DehydratedState.md +++ b/docs/framework/vue/reference/interfaces/DehydratedState.md @@ -3,7 +3,7 @@ id: DehydratedState title: DehydratedState --- -Defined in: [packages/query-core/src/hydration.ts:97](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L97) +Defined in: [packages/query-core/src/hydration.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L94) A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data @@ -17,7 +17,7 @@ that has already been fetched, avoiding a redundant fetch on the client. mutations: DehydratedMutation[]; ``` -Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L98) +Defined in: [packages/query-core/src/hydration.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L95) *** @@ -27,4 +27,4 @@ Defined in: [packages/query-core/src/hydration.ts:98](https://github.com/TanStac queries: DehydratedQuery[]; ``` -Defined in: [packages/query-core/src/hydration.ts:99](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L99) +Defined in: [packages/query-core/src/hydration.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L96) From bb09d9bf55f5f87352fae321793339fe0e2472d3 Mon Sep 17 00:00:00 2001 From: Wonsuk Choi Date: Mon, 7 Sep 2026 04:36:09 +0900 Subject: [PATCH 6/9] docs(query-core): document missing default values for MutationOptions, combine, and QueryFilters.type --- .../lit/reference/classes/QueriesObserver.md | 20 ++--- .../lit/reference/functions/hashKey.md | 2 +- .../reference/functions/keepPreviousData.md | 2 +- .../lit/reference/functions/matchMutation.md | 2 +- .../lit/reference/functions/matchQuery.md | 2 +- .../framework/lit/reference/functions/noop.md | 4 +- .../reference/functions/partialMatchKey.md | 2 +- .../reference/functions/replaceEqualDeep.md | 2 +- .../reference/functions/shouldThrowError.md | 2 +- .../lit/reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 10 +-- .../interfaces/EnsureQueryDataOptions.md | 38 +++++----- .../interfaces/FetchNextPageOptions.md | 6 +- .../interfaces/FetchPreviousPageOptions.md | 6 +- .../reference/interfaces/FetchQueryOptions.md | 36 ++++----- .../InfiniteQueryObserverBaseResult.md | 68 ++++++++--------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 ++++++++--------- .../InfiniteQueryObserverLoadingResult.md | 68 ++++++++--------- .../InfiniteQueryObserverOptions.md | 73 +++++++++++-------- .../InfiniteQueryObserverPendingResult.md | 68 ++++++++--------- .../InfiniteQueryObserverPlaceholderResult.md | 68 ++++++++--------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 ++++++++--------- .../InfiniteQueryObserverSuccessResult.md | 68 ++++++++--------- .../InfiniteQueryPageParamsOptions.md | 8 +- .../reference/interfaces/InitialPageParam.md | 4 +- .../reference/interfaces/InvalidateOptions.md | 6 +- .../interfaces/InvalidateQueryFilters.md | 18 +++-- .../lit/reference/interfaces/MutateOptions.md | 8 +- .../reference/interfaces/MutationFilters.md | 10 +-- .../interfaces/MutationObserverBaseResult.md | 22 +++--- .../interfaces/MutationObserverErrorResult.md | 22 +++--- .../interfaces/MutationObserverIdleResult.md | 22 +++--- .../MutationObserverLoadingResult.md | 22 +++--- .../interfaces/MutationObserverOptions.md | 51 +++++++++---- .../MutationObserverSuccessResult.md | 22 +++--- .../reference/interfaces/MutationOptions.md | 49 +++++++++---- .../lit/reference/interfaces/NotifyEvent.md | 4 +- .../interfaces/QueriesObserverOptions.md | 4 +- .../reference/interfaces/QueryClientConfig.md | 8 +- .../interfaces/QueryExecuteOptions.md | 38 +++++----- .../lit/reference/interfaces/QueryFilters.md | 14 ++-- .../interfaces/QueryObserverBaseResult.md | 52 ++++++------- .../QueryObserverLoadingErrorResult.md | 52 ++++++------- .../interfaces/QueryObserverLoadingResult.md | 52 ++++++------- .../interfaces/QueryObserverOptions.md | 67 ++++++++++------- .../interfaces/QueryObserverPendingResult.md | 52 ++++++------- .../QueryObserverPlaceholderResult.md | 52 ++++++------- .../QueryObserverRefetchErrorResult.md | 52 ++++++------- .../interfaces/QueryObserverSuccessResult.md | 52 ++++++------- .../lit/reference/interfaces/QueryOptions.md | 30 ++++---- .../reference/interfaces/RefetchOptions.md | 6 +- .../interfaces/RefetchQueryFilters.md | 16 ++-- .../lit/reference/interfaces/ResetOptions.md | 6 +- .../lit/reference/interfaces/ResultOptions.md | 4 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../DefaultedInfiniteQueryObserverOptions.md | 2 +- .../DefaultedQueryObserverOptions.md | 2 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../EnsureInfiniteQueryDataOptions.md | 2 +- .../type-aliases/FetchInfiniteQueryOptions.md | 2 +- .../lit/reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryExecuteOptions.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +- .../lit/reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../lit/reference/type-aliases/QueryStatus.md | 2 +- .../lit/reference/type-aliases/SkipToken.md | 2 +- .../reference/type-aliases/ThrowOnError.md | 2 +- .../lit/reference/type-aliases/Updater.md | 2 +- .../reference/type-aliases/WithRequired.md | 2 +- .../lit/reference/variables/isServer.md | 2 +- .../lit/reference/variables/skipToken.md | 2 +- .../reference/classes/QueriesObserver.md | 20 ++--- .../preact/reference/functions/hashKey.md | 2 +- .../reference/functions/keepPreviousData.md | 2 +- .../reference/functions/matchMutation.md | 2 +- .../preact/reference/functions/matchQuery.md | 2 +- .../preact/reference/functions/noop.md | 4 +- .../reference/functions/partialMatchKey.md | 2 +- .../reference/functions/replaceEqualDeep.md | 2 +- .../reference/functions/shouldThrowError.md | 2 +- .../reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 10 +-- .../interfaces/EnsureQueryDataOptions.md | 38 +++++----- .../interfaces/FetchNextPageOptions.md | 6 +- .../interfaces/FetchPreviousPageOptions.md | 6 +- .../reference/interfaces/FetchQueryOptions.md | 36 ++++----- .../InfiniteQueryObserverBaseResult.md | 68 ++++++++--------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 ++++++++--------- .../InfiniteQueryObserverLoadingResult.md | 68 ++++++++--------- .../InfiniteQueryObserverOptions.md | 73 +++++++++++-------- .../InfiniteQueryObserverPendingResult.md | 68 ++++++++--------- .../InfiniteQueryObserverPlaceholderResult.md | 68 ++++++++--------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 ++++++++--------- .../InfiniteQueryObserverSuccessResult.md | 68 ++++++++--------- .../InfiniteQueryPageParamsOptions.md | 8 +- .../reference/interfaces/InitialPageParam.md | 4 +- .../reference/interfaces/InvalidateOptions.md | 6 +- .../interfaces/InvalidateQueryFilters.md | 18 +++-- .../reference/interfaces/MutateOptions.md | 8 +- .../reference/interfaces/MutationFilters.md | 10 +-- .../interfaces/MutationObserverBaseResult.md | 22 +++--- .../interfaces/MutationObserverErrorResult.md | 22 +++--- .../interfaces/MutationObserverIdleResult.md | 22 +++--- .../MutationObserverLoadingResult.md | 22 +++--- .../interfaces/MutationObserverOptions.md | 51 +++++++++---- .../MutationObserverSuccessResult.md | 22 +++--- .../reference/interfaces/MutationOptions.md | 49 +++++++++---- .../reference/interfaces/NotifyEvent.md | 4 +- .../interfaces/QueriesObserverOptions.md | 4 +- .../reference/interfaces/QueryClientConfig.md | 8 +- .../interfaces/QueryExecuteOptions.md | 38 +++++----- .../reference/interfaces/QueryFilters.md | 14 ++-- .../interfaces/QueryObserverBaseResult.md | 52 ++++++------- .../QueryObserverLoadingErrorResult.md | 52 ++++++------- .../interfaces/QueryObserverLoadingResult.md | 52 ++++++------- .../interfaces/QueryObserverOptions.md | 67 ++++++++++------- .../interfaces/QueryObserverPendingResult.md | 52 ++++++------- .../QueryObserverPlaceholderResult.md | 52 ++++++------- .../QueryObserverRefetchErrorResult.md | 52 ++++++------- .../interfaces/QueryObserverSuccessResult.md | 52 ++++++------- .../reference/interfaces/QueryOptions.md | 30 ++++---- .../reference/interfaces/RefetchOptions.md | 6 +- .../interfaces/RefetchQueryFilters.md | 16 ++-- .../reference/interfaces/ResetOptions.md | 6 +- .../reference/interfaces/ResultOptions.md | 4 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../interfaces/UseBaseQueryOptions.md | 65 ++++++++++------- .../interfaces/UseInfiniteQueryOptions.md | 68 +++++++++-------- .../interfaces/UseMutationOptions.md | 49 +++++++++---- .../reference/interfaces/UseQueryOptions.md | 62 +++++++++------- .../UseSuspenseInfiniteQueryOptions.md | 58 ++++++++------- .../interfaces/UseSuspenseQueryOptions.md | 52 +++++++------ .../DefaultedInfiniteQueryObserverOptions.md | 2 +- .../DefaultedQueryObserverOptions.md | 2 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../EnsureInfiniteQueryDataOptions.md | 2 +- .../type-aliases/FetchInfiniteQueryOptions.md | 2 +- .../reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryExecuteOptions.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +- .../reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/SkipToken.md | 2 +- .../reference/type-aliases/ThrowOnError.md | 2 +- .../preact/reference/type-aliases/Updater.md | 2 +- .../reference/type-aliases/WithRequired.md | 2 +- .../preact/reference/variables/isServer.md | 2 +- .../preact/reference/variables/skipToken.md | 2 +- .../reference/classes/QueriesObserver.md | 20 ++--- .../react/reference/functions/hashKey.md | 2 +- .../reference/functions/keepPreviousData.md | 2 +- .../reference/functions/matchMutation.md | 2 +- .../react/reference/functions/matchQuery.md | 2 +- .../react/reference/functions/noop.md | 4 +- .../reference/functions/partialMatchKey.md | 2 +- .../reference/functions/replaceEqualDeep.md | 2 +- .../reference/functions/shouldThrowError.md | 2 +- .../reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 10 +-- .../interfaces/EnsureQueryDataOptions.md | 38 +++++----- .../interfaces/FetchNextPageOptions.md | 6 +- .../interfaces/FetchPreviousPageOptions.md | 6 +- .../reference/interfaces/FetchQueryOptions.md | 36 ++++----- .../InfiniteQueryObserverBaseResult.md | 68 ++++++++--------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 ++++++++--------- .../InfiniteQueryObserverLoadingResult.md | 68 ++++++++--------- .../InfiniteQueryObserverOptions.md | 73 +++++++++++-------- .../InfiniteQueryObserverPendingResult.md | 68 ++++++++--------- .../InfiniteQueryObserverPlaceholderResult.md | 68 ++++++++--------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 ++++++++--------- .../InfiniteQueryObserverSuccessResult.md | 68 ++++++++--------- .../InfiniteQueryPageParamsOptions.md | 8 +- .../reference/interfaces/InitialPageParam.md | 4 +- .../reference/interfaces/InvalidateOptions.md | 6 +- .../interfaces/InvalidateQueryFilters.md | 18 +++-- .../reference/interfaces/MutateOptions.md | 8 +- .../reference/interfaces/MutationFilters.md | 10 +-- .../interfaces/MutationObserverBaseResult.md | 22 +++--- .../interfaces/MutationObserverErrorResult.md | 22 +++--- .../interfaces/MutationObserverIdleResult.md | 22 +++--- .../MutationObserverLoadingResult.md | 22 +++--- .../interfaces/MutationObserverOptions.md | 51 +++++++++---- .../MutationObserverSuccessResult.md | 22 +++--- .../reference/interfaces/MutationOptions.md | 49 +++++++++---- .../react/reference/interfaces/NotifyEvent.md | 4 +- .../interfaces/QueriesObserverOptions.md | 4 +- .../reference/interfaces/QueryClientConfig.md | 8 +- .../interfaces/QueryExecuteOptions.md | 38 +++++----- .../reference/interfaces/QueryFilters.md | 14 ++-- .../interfaces/QueryObserverBaseResult.md | 52 ++++++------- .../QueryObserverLoadingErrorResult.md | 52 ++++++------- .../interfaces/QueryObserverLoadingResult.md | 52 ++++++------- .../interfaces/QueryObserverOptions.md | 67 ++++++++++------- .../interfaces/QueryObserverPendingResult.md | 52 ++++++------- .../QueryObserverPlaceholderResult.md | 52 ++++++------- .../QueryObserverRefetchErrorResult.md | 52 ++++++------- .../interfaces/QueryObserverSuccessResult.md | 52 ++++++------- .../reference/interfaces/QueryOptions.md | 30 ++++---- .../reference/interfaces/RefetchOptions.md | 6 +- .../interfaces/RefetchQueryFilters.md | 16 ++-- .../reference/interfaces/ResetOptions.md | 6 +- .../reference/interfaces/ResultOptions.md | 4 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../interfaces/UseBaseQueryOptions.md | 65 ++++++++++------- .../interfaces/UseInfiniteQueryOptions.md | 68 +++++++++-------- .../interfaces/UseMutationOptions.md | 49 +++++++++---- .../reference/interfaces/UseQueryOptions.md | 62 +++++++++------- .../UseSuspenseInfiniteQueryOptions.md | 58 ++++++++------- .../interfaces/UseSuspenseQueryOptions.md | 52 +++++++------ .../DefaultedInfiniteQueryObserverOptions.md | 2 +- .../DefaultedQueryObserverOptions.md | 2 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../EnsureInfiniteQueryDataOptions.md | 2 +- .../type-aliases/FetchInfiniteQueryOptions.md | 2 +- .../reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryExecuteOptions.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +- .../reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../reference/type-aliases/QueryStatus.md | 2 +- .../react/reference/type-aliases/SkipToken.md | 2 +- .../reference/type-aliases/ThrowOnError.md | 2 +- .../react/reference/type-aliases/Updater.md | 2 +- .../reference/type-aliases/WithRequired.md | 2 +- .../react/reference/variables/isServer.md | 2 +- .../react/reference/variables/skipToken.md | 2 +- .../reference/classes/QueriesObserver.md | 20 ++--- .../solid/reference/functions/hashKey.md | 2 +- .../reference/functions/keepPreviousData.md | 2 +- .../reference/functions/matchMutation.md | 2 +- .../solid/reference/functions/matchQuery.md | 2 +- .../solid/reference/functions/noop.md | 4 +- .../reference/functions/partialMatchKey.md | 2 +- .../reference/functions/replaceEqualDeep.md | 2 +- .../reference/functions/shouldThrowError.md | 2 +- .../reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 6 +- .../interfaces/EnsureQueryDataOptions.md | 38 +++++----- .../interfaces/FetchNextPageOptions.md | 6 +- .../interfaces/FetchPreviousPageOptions.md | 6 +- .../reference/interfaces/FetchQueryOptions.md | 36 ++++----- .../InfiniteQueryObserverBaseResult.md | 68 ++++++++--------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 ++++++++--------- .../InfiniteQueryObserverLoadingResult.md | 68 ++++++++--------- .../InfiniteQueryObserverOptions.md | 68 +++++++++-------- .../InfiniteQueryObserverPendingResult.md | 68 ++++++++--------- .../InfiniteQueryObserverPlaceholderResult.md | 68 ++++++++--------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 ++++++++--------- .../InfiniteQueryObserverSuccessResult.md | 68 ++++++++--------- .../interfaces/InfiniteQueryOptions.md | 63 +++++++++------- .../InfiniteQueryPageParamsOptions.md | 8 +- .../reference/interfaces/InitialPageParam.md | 4 +- .../reference/interfaces/InvalidateOptions.md | 6 +- .../interfaces/InvalidateQueryFilters.md | 18 +++-- .../reference/interfaces/MutateOptions.md | 8 +- .../reference/interfaces/MutationFilters.md | 10 +-- .../interfaces/MutationObserverBaseResult.md | 22 +++--- .../interfaces/MutationObserverErrorResult.md | 22 +++--- .../interfaces/MutationObserverIdleResult.md | 22 +++--- .../MutationObserverLoadingResult.md | 22 +++--- .../interfaces/MutationObserverOptions.md | 51 +++++++++---- .../MutationObserverSuccessResult.md | 22 +++--- .../reference/interfaces/MutationOptions.md | 49 +++++++++---- .../solid/reference/interfaces/NotifyEvent.md | 4 +- .../interfaces/QueriesObserverOptions.md | 4 +- .../reference/interfaces/QueryClientConfig.md | 4 +- .../interfaces/QueryExecuteOptions.md | 38 +++++----- .../reference/interfaces/QueryFilters.md | 14 ++-- .../interfaces/QueryObserverBaseResult.md | 52 ++++++------- .../QueryObserverLoadingErrorResult.md | 52 ++++++------- .../interfaces/QueryObserverLoadingResult.md | 52 ++++++------- .../interfaces/QueryObserverOptions.md | 62 +++++++++------- .../interfaces/QueryObserverPendingResult.md | 52 ++++++------- .../QueryObserverPlaceholderResult.md | 52 ++++++------- .../QueryObserverRefetchErrorResult.md | 52 ++++++------- .../interfaces/QueryObserverSuccessResult.md | 52 ++++++------- .../reference/interfaces/QueryOptions.md | 59 ++++++++------- .../reference/interfaces/RefetchOptions.md | 6 +- .../interfaces/RefetchQueryFilters.md | 16 ++-- .../reference/interfaces/ResetOptions.md | 6 +- .../reference/interfaces/ResultOptions.md | 4 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../interfaces/UseBaseQueryOptions.md | 59 ++++++++------- .../DefaultedInfiniteQueryObserverOptions.md | 2 +- .../DefaultedQueryObserverOptions.md | 2 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../EnsureInfiniteQueryDataOptions.md | 2 +- .../type-aliases/FetchInfiniteQueryOptions.md | 2 +- .../reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryExecuteOptions.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +- .../reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../reference/type-aliases/QueryStatus.md | 2 +- .../solid/reference/type-aliases/SkipToken.md | 2 +- .../reference/type-aliases/ThrowOnError.md | 2 +- .../solid/reference/type-aliases/Updater.md | 2 +- .../reference/type-aliases/WithRequired.md | 2 +- .../solid/reference/variables/isServer.md | 2 +- .../solid/reference/variables/skipToken.md | 2 +- .../reference/classes/QueriesObserver.md | 20 ++--- .../svelte/reference/functions/hashKey.md | 2 +- .../reference/functions/keepPreviousData.md | 2 +- .../reference/functions/matchMutation.md | 2 +- .../svelte/reference/functions/matchQuery.md | 2 +- .../svelte/reference/functions/noop.md | 4 +- .../reference/functions/partialMatchKey.md | 2 +- .../reference/functions/replaceEqualDeep.md | 2 +- .../reference/functions/shouldThrowError.md | 2 +- .../reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 10 +-- .../interfaces/EnsureQueryDataOptions.md | 38 +++++----- .../interfaces/FetchNextPageOptions.md | 6 +- .../interfaces/FetchPreviousPageOptions.md | 6 +- .../reference/interfaces/FetchQueryOptions.md | 36 ++++----- .../InfiniteQueryObserverBaseResult.md | 68 ++++++++--------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 ++++++++--------- .../InfiniteQueryObserverLoadingResult.md | 68 ++++++++--------- .../InfiniteQueryObserverOptions.md | 73 +++++++++++-------- .../InfiniteQueryObserverPendingResult.md | 68 ++++++++--------- .../InfiniteQueryObserverPlaceholderResult.md | 68 ++++++++--------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 ++++++++--------- .../InfiniteQueryObserverSuccessResult.md | 68 ++++++++--------- .../InfiniteQueryPageParamsOptions.md | 8 +- .../reference/interfaces/InitialPageParam.md | 4 +- .../reference/interfaces/InvalidateOptions.md | 6 +- .../interfaces/InvalidateQueryFilters.md | 18 +++-- .../reference/interfaces/MutateOptions.md | 8 +- .../reference/interfaces/MutationFilters.md | 10 +-- .../interfaces/MutationObserverBaseResult.md | 22 +++--- .../interfaces/MutationObserverErrorResult.md | 22 +++--- .../interfaces/MutationObserverIdleResult.md | 22 +++--- .../MutationObserverLoadingResult.md | 22 +++--- .../interfaces/MutationObserverOptions.md | 51 +++++++++---- .../MutationObserverSuccessResult.md | 22 +++--- .../reference/interfaces/MutationOptions.md | 49 +++++++++---- .../reference/interfaces/NotifyEvent.md | 4 +- .../interfaces/QueriesObserverOptions.md | 4 +- .../reference/interfaces/QueryClientConfig.md | 8 +- .../interfaces/QueryExecuteOptions.md | 38 +++++----- .../reference/interfaces/QueryFilters.md | 14 ++-- .../interfaces/QueryObserverBaseResult.md | 52 ++++++------- .../QueryObserverLoadingErrorResult.md | 52 ++++++------- .../interfaces/QueryObserverLoadingResult.md | 52 ++++++------- .../interfaces/QueryObserverOptions.md | 67 ++++++++++------- .../interfaces/QueryObserverPendingResult.md | 52 ++++++------- .../QueryObserverPlaceholderResult.md | 52 ++++++------- .../QueryObserverRefetchErrorResult.md | 52 ++++++------- .../interfaces/QueryObserverSuccessResult.md | 52 ++++++------- .../reference/interfaces/QueryOptions.md | 30 ++++---- .../reference/interfaces/RefetchOptions.md | 6 +- .../interfaces/RefetchQueryFilters.md | 16 ++-- .../reference/interfaces/ResetOptions.md | 6 +- .../reference/interfaces/ResultOptions.md | 4 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../DefaultedInfiniteQueryObserverOptions.md | 2 +- .../DefaultedQueryObserverOptions.md | 2 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../EnsureInfiniteQueryDataOptions.md | 2 +- .../type-aliases/FetchInfiniteQueryOptions.md | 2 +- .../reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryExecuteOptions.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +- .../reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/SkipToken.md | 2 +- .../reference/type-aliases/ThrowOnError.md | 2 +- .../svelte/reference/type-aliases/Updater.md | 2 +- .../reference/type-aliases/WithRequired.md | 2 +- .../svelte/reference/variables/isServer.md | 2 +- .../svelte/reference/variables/skipToken.md | 2 +- .../vue/reference/classes/QueriesObserver.md | 20 ++--- .../vue/reference/functions/hashKey.md | 2 +- .../reference/functions/keepPreviousData.md | 2 +- .../vue/reference/functions/matchMutation.md | 2 +- .../vue/reference/functions/matchQuery.md | 2 +- .../framework/vue/reference/functions/noop.md | 4 +- .../reference/functions/partialMatchKey.md | 2 +- .../reference/functions/replaceEqualDeep.md | 2 +- .../reference/functions/shouldThrowError.md | 2 +- .../vue/reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 10 +-- .../interfaces/EnsureQueryDataOptions.md | 38 +++++----- .../interfaces/FetchNextPageOptions.md | 6 +- .../interfaces/FetchPreviousPageOptions.md | 6 +- .../reference/interfaces/FetchQueryOptions.md | 36 ++++----- .../InfiniteQueryObserverBaseResult.md | 68 ++++++++--------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 ++++++++--------- .../InfiniteQueryObserverLoadingResult.md | 68 ++++++++--------- .../InfiniteQueryObserverOptions.md | 73 +++++++++++-------- .../InfiniteQueryObserverPendingResult.md | 68 ++++++++--------- .../InfiniteQueryObserverPlaceholderResult.md | 68 ++++++++--------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 ++++++++--------- .../InfiniteQueryObserverSuccessResult.md | 68 ++++++++--------- .../InfiniteQueryPageParamsOptions.md | 8 +- .../reference/interfaces/InitialPageParam.md | 4 +- .../reference/interfaces/InvalidateOptions.md | 6 +- .../interfaces/InvalidateQueryFilters.md | 18 +++-- .../vue/reference/interfaces/MutateOptions.md | 8 +- .../interfaces/MutationObserverBaseResult.md | 22 +++--- .../interfaces/MutationObserverErrorResult.md | 22 +++--- .../interfaces/MutationObserverIdleResult.md | 22 +++--- .../MutationObserverLoadingResult.md | 22 +++--- .../interfaces/MutationObserverOptions.md | 51 +++++++++---- .../MutationObserverSuccessResult.md | 22 +++--- .../vue/reference/interfaces/NotifyEvent.md | 4 +- .../interfaces/QueriesObserverOptions.md | 4 +- .../reference/interfaces/QueryClientConfig.md | 8 +- .../interfaces/QueryExecuteOptions.md | 38 +++++----- .../interfaces/QueryObserverBaseResult.md | 52 ++++++------- .../QueryObserverLoadingErrorResult.md | 52 ++++++------- .../interfaces/QueryObserverLoadingResult.md | 52 ++++++------- .../interfaces/QueryObserverOptions.md | 67 ++++++++++------- .../interfaces/QueryObserverPendingResult.md | 52 ++++++------- .../QueryObserverPlaceholderResult.md | 52 ++++++------- .../QueryObserverRefetchErrorResult.md | 52 ++++++------- .../interfaces/QueryObserverSuccessResult.md | 52 ++++++------- .../reference/interfaces/RefetchOptions.md | 6 +- .../interfaces/RefetchQueryFilters.md | 16 ++-- .../vue/reference/interfaces/ResetOptions.md | 6 +- .../vue/reference/interfaces/ResultOptions.md | 4 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../DefaultedInfiniteQueryObserverOptions.md | 2 +- .../DefaultedQueryObserverOptions.md | 2 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../EnsureInfiniteQueryDataOptions.md | 2 +- .../type-aliases/FetchInfiniteQueryOptions.md | 2 +- .../vue/reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryExecuteOptions.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +- .../vue/reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../vue/reference/type-aliases/QueryStatus.md | 2 +- .../vue/reference/type-aliases/SkipToken.md | 2 +- .../reference/type-aliases/ThrowOnError.md | 2 +- .../vue/reference/type-aliases/Updater.md | 2 +- .../reference/type-aliases/WithRequired.md | 2 +- .../vue/reference/variables/isServer.md | 2 +- .../vue/reference/variables/skipToken.md | 2 +- packages/query-core/src/queriesObserver.ts | 2 + packages/query-core/src/types.ts | 35 +++++++++ packages/query-core/src/utils.ts | 2 + 505 files changed, 5468 insertions(+), 4789 deletions(-) diff --git a/docs/framework/lit/reference/classes/QueriesObserver.md b/docs/framework/lit/reference/classes/QueriesObserver.md index 2b593b06e6a..a64a0fa56f7 100644 --- a/docs/framework/lit/reference/classes/QueriesObserver.md +++ b/docs/framework/lit/reference/classes/QueriesObserver.md @@ -3,7 +3,7 @@ id: QueriesObserver title: QueriesObserver --- -Defined in: [packages/query-core/src/queriesObserver.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L54) +Defined in: [packages/query-core/src/queriesObserver.ts:56](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L56) A `QueriesObserver` watches an array of queries at once, exposing them as a single array of `QueryObserverResult`s (or, when a `combine` option is @@ -45,7 +45,7 @@ new QueriesObserver( options?): QueriesObserver; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L68) +Defined in: [packages/query-core/src/queriesObserver.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L70) #### Parameters @@ -95,7 +95,7 @@ Subscribable.listeners destroy(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L104) +Defined in: [packages/query-core/src/queriesObserver.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L106) Stops observing all queries: clears all listeners and destroys every underlying `QueryObserver` this observer manages. @@ -112,7 +112,7 @@ underlying `QueryObserver` this observer manages. getCurrentResult(): QueryObserverResult[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L208) +Defined in: [packages/query-core/src/queriesObserver.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L210) Returns the most recently computed array of `QueryObserverResult`s, one per observed query, in the same order as the queries passed to the @@ -137,7 +137,7 @@ const data = results.map((result) => result.data) getObservers(): QueryObserver[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L225) +Defined in: [packages/query-core/src/queriesObserver.ts:227](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L227) Returns the underlying `QueryObserver` instances this observer manages, in the same order as the queries passed to the constructor or @@ -155,7 +155,7 @@ in the same order as the queries passed to the constructor or getOptimisticResult(queries, combine): [QueryObserverResult[], (r?) => TCombinedResult, () => QueryObserverResult[]]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L236) +Defined in: [packages/query-core/src/queriesObserver.ts:238](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L238) The `QueriesObserver` counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult) — computes the result for the given (already-defaulted) queries right now, synchronously. Called by @@ -185,7 +185,7 @@ wrap the results for property-access tracking. getQueries(): Query[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:216](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L216) +Defined in: [packages/query-core/src/queriesObserver.ts:218](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L218) Returns the underlying `Query` instances currently being observed, in the same order as the queries passed to the constructor or `setQueries`. @@ -222,7 +222,7 @@ Subscribable.hasListeners protected onSubscribe(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L84) +Defined in: [packages/query-core/src/queriesObserver.ts:86](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L86) #### Returns @@ -242,7 +242,7 @@ Subscribable.onSubscribe protected onUnsubscribe(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L94) +Defined in: [packages/query-core/src/queriesObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L96) #### Returns @@ -262,7 +262,7 @@ Subscribable.onUnsubscribe setQueries(queries, options?): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:125](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L125) +Defined in: [packages/query-core/src/queriesObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L127) Replaces the set of queries being observed. Existing `QueryObserver`s are reused for queries that match an already-observed query hash; diff --git a/docs/framework/lit/reference/functions/hashKey.md b/docs/framework/lit/reference/functions/hashKey.md index 9e7844aa09d..dc774c032ce 100644 --- a/docs/framework/lit/reference/functions/hashKey.md +++ b/docs/framework/lit/reference/functions/hashKey.md @@ -7,7 +7,7 @@ title: hashKey function hashKey(queryKey): string; ``` -Defined in: [packages/query-core/src/utils.ts:282](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L282) +Defined in: [packages/query-core/src/utils.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L284) Default query & mutation keys hash function. Hashes the value into a stable hash. diff --git a/docs/framework/lit/reference/functions/keepPreviousData.md b/docs/framework/lit/reference/functions/keepPreviousData.md index d41c7d7c726..6a84f4c5970 100644 --- a/docs/framework/lit/reference/functions/keepPreviousData.md +++ b/docs/framework/lit/reference/functions/keepPreviousData.md @@ -7,7 +7,7 @@ title: keepPreviousData function keepPreviousData(previousData): T | undefined; ``` -Defined in: [packages/query-core/src/utils.ts:491](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L491) +Defined in: [packages/query-core/src/utils.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L493) Intended to be passed as a query's `placeholderData` option, for example `placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new diff --git a/docs/framework/lit/reference/functions/matchMutation.md b/docs/framework/lit/reference/functions/matchMutation.md index 79468dcfad9..40210da4cf1 100644 --- a/docs/framework/lit/reference/functions/matchMutation.md +++ b/docs/framework/lit/reference/functions/matchMutation.md @@ -7,7 +7,7 @@ title: matchMutation function matchMutation(filters, mutation): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:235](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L235) +Defined in: [packages/query-core/src/utils.ts:237](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L237) Checks whether a mutation matches the given [MutationFilters](../interfaces/MutationFilters.md). Every filter that is specified must match; filters that are left unspecified are ignored. diff --git a/docs/framework/lit/reference/functions/matchQuery.md b/docs/framework/lit/reference/functions/matchQuery.md index f98fe5f3537..4c54b2df995 100644 --- a/docs/framework/lit/reference/functions/matchQuery.md +++ b/docs/framework/lit/reference/functions/matchQuery.md @@ -7,7 +7,7 @@ title: matchQuery function matchQuery(filters, query): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L173) +Defined in: [packages/query-core/src/utils.ts:175](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L175) Checks whether a query matches the given [QueryFilters](../interfaces/QueryFilters.md). Every filter that is specified must match; filters that are left unspecified are ignored. diff --git a/docs/framework/lit/reference/functions/noop.md b/docs/framework/lit/reference/functions/noop.md index fd1b8dc2ad0..01fb409f4e9 100644 --- a/docs/framework/lit/reference/functions/noop.md +++ b/docs/framework/lit/reference/functions/noop.md @@ -9,7 +9,7 @@ title: noop function noop(): void; ``` -Defined in: [packages/query-core/src/utils.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L117) +Defined in: [packages/query-core/src/utils.ts:119](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L119) A function that does nothing. @@ -23,7 +23,7 @@ A function that does nothing. function noop(): undefined; ``` -Defined in: [packages/query-core/src/utils.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L118) +Defined in: [packages/query-core/src/utils.ts:120](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L120) A function that does nothing. diff --git a/docs/framework/lit/reference/functions/partialMatchKey.md b/docs/framework/lit/reference/functions/partialMatchKey.md index 3795de85b95..4db67323e9b 100644 --- a/docs/framework/lit/reference/functions/partialMatchKey.md +++ b/docs/framework/lit/reference/functions/partialMatchKey.md @@ -7,7 +7,7 @@ title: partialMatchKey function partialMatchKey(a, b): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L298) +Defined in: [packages/query-core/src/utils.ts:300](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L300) Checks if key `b` partially matches with key `a`. diff --git a/docs/framework/lit/reference/functions/replaceEqualDeep.md b/docs/framework/lit/reference/functions/replaceEqualDeep.md index 9d6a01a7030..dfd23c33115 100644 --- a/docs/framework/lit/reference/functions/replaceEqualDeep.md +++ b/docs/framework/lit/reference/functions/replaceEqualDeep.md @@ -10,7 +10,7 @@ function replaceEqualDeep( depth?): T; ``` -Defined in: [packages/query-core/src/utils.ts:337](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L337) +Defined in: [packages/query-core/src/utils.ts:339](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L339) This function returns `a` if `b` is deeply equal. If not, it will replace any deeply equal children of `b` with those of `a`. diff --git a/docs/framework/lit/reference/functions/shouldThrowError.md b/docs/framework/lit/reference/functions/shouldThrowError.md index 3146617391e..1f1e62a8d0e 100644 --- a/docs/framework/lit/reference/functions/shouldThrowError.md +++ b/docs/framework/lit/reference/functions/shouldThrowError.md @@ -7,7 +7,7 @@ title: shouldThrowError function shouldThrowError(throwOnError, params): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L574) +Defined in: [packages/query-core/src/utils.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L576) Resolves a `throwOnError` option to a boolean. If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller, diff --git a/docs/framework/lit/reference/interfaces/CancelOptions.md b/docs/framework/lit/reference/interfaces/CancelOptions.md index 14394c18533..f52c729f3b1 100644 --- a/docs/framework/lit/reference/interfaces/CancelOptions.md +++ b/docs/framework/lit/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1466) +Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1501) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1467) +Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1468) +Defined in: [packages/query-core/src/types.ts:1503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1503) diff --git a/docs/framework/lit/reference/interfaces/DefaultOptions.md b/docs/framework/lit/reference/interfaces/DefaultOptions.md index 026116d11db..67ae012f9ee 100644 --- a/docs/framework/lit/reference/interfaces/DefaultOptions.md +++ b/docs/framework/lit/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) +Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1487) ## Type Parameters @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/ optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) +Defined in: [packages/query-core/src/types.ts:1498](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1498) Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). @@ -31,7 +31,7 @@ Default options used when dehydrating the client's caches; see [DehydrateOptions optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1496](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1496) Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). @@ -67,7 +67,7 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) +Defined in: [packages/query-core/src/types.ts:1494](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1494) Default options applied to every mutation, unless overridden per-mutation. @@ -79,6 +79,6 @@ Default options applied to every mutation, unless overridden per-mutation. optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) +Defined in: [packages/query-core/src/types.ts:1489](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1489) Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/lit/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/lit/reference/interfaces/EnsureQueryDataOptions.md index 7f1fb493a09..3974323fd21 100644 --- a/docs/framework/lit/reference/interfaces/EnsureQueryDataOptions.md +++ b/docs/framework/lit/reference/interfaces/EnsureQueryDataOptions.md @@ -3,7 +3,7 @@ id: EnsureQueryDataOptions title: EnsureQueryDataOptions --- -Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) +Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L606) ## Deprecated @@ -41,7 +41,7 @@ Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -66,7 +66,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -87,7 +87,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -103,7 +103,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) +Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) #### Inherited from @@ -117,7 +117,7 @@ Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -133,7 +133,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -150,7 +150,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -170,7 +170,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -189,7 +189,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -209,7 +209,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -226,7 +226,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -247,7 +247,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -263,12 +263,13 @@ If specified, this function is used to hash the `queryKey` to a string. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -283,7 +284,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -305,7 +306,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional revalidateIfStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L608) +Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L619) *** @@ -315,7 +316,7 @@ Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) +Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -332,10 +333,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/lit/reference/interfaces/FetchNextPageOptions.md b/docs/framework/lit/reference/interfaces/FetchNextPageOptions.md index d12afe35fe1..2c0be977140 100644 --- a/docs/framework/lit/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/lit/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L716) +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) +Defined in: [packages/query-core/src/types.ts:736](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L736) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/lit/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/lit/reference/interfaces/FetchPreviousPageOptions.md index 93ca92088f1..683e789ee52 100644 --- a/docs/framework/lit/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/lit/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) +Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L739) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:748](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L748) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/lit/reference/interfaces/FetchQueryOptions.md b/docs/framework/lit/reference/interfaces/FetchQueryOptions.md index d7f5f8946fe..709ddd27897 100644 --- a/docs/framework/lit/reference/interfaces/FetchQueryOptions.md +++ b/docs/framework/lit/reference/interfaces/FetchQueryOptions.md @@ -3,7 +3,7 @@ id: FetchQueryOptions title: FetchQueryOptions --- -Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L576) +Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L587) ## Deprecated @@ -45,7 +45,7 @@ Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -72,7 +72,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -95,7 +95,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -113,7 +113,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) +Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) *** @@ -123,7 +123,7 @@ Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -141,7 +141,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -160,7 +160,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -182,7 +182,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -203,7 +203,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -225,7 +225,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -244,7 +244,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -267,7 +267,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -285,12 +285,13 @@ WithRequired.queryKeyHashFn optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -307,7 +308,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -331,7 +332,7 @@ WithRequired.retryDelay optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) +Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -344,10 +345,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult.md index f1443c39625..9195e0727f8 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L991) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) +Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) +Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) +Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) +Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) +Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 7c55201c028..2841b5ab116 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) +Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) +Defined in: [packages/query-core/src/types.ts:1076](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1076) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) +Defined in: [packages/query-core/src/types.ts:1077](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1077) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) +Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult.md index f9541ebd73b..95ff84b3ef3 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) +Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) +Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) +Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) +Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverOptions.md index b118d756b10..90f19ed98b5 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverOptions.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverOptions title: InfiniteQueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) +Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L531) ## Extends @@ -39,11 +39,12 @@ Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/q optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -58,7 +59,7 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -81,7 +82,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -98,7 +99,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -117,7 +118,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -138,7 +139,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -154,7 +155,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from @@ -168,7 +169,7 @@ Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -184,7 +185,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -201,7 +202,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -221,7 +222,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -241,7 +242,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -260,7 +261,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -278,7 +279,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -298,7 +299,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -315,7 +316,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -336,7 +337,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -352,10 +353,11 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -370,7 +372,7 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -387,12 +389,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -407,12 +410,13 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -427,12 +431,13 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -447,12 +452,13 @@ Defaults to `true`. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -467,7 +473,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -489,10 +495,11 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -507,7 +514,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -536,12 +543,13 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -556,10 +564,11 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -574,10 +583,11 @@ Defaults to `true`. optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. #### Inherited from @@ -592,12 +602,13 @@ Defaults to `false`. optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult.md index 1bab3233ec9..c3e8b022cdb 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1027](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1027) +Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1029](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1029) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) +Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) +Defined in: [packages/query-core/src/types.ts:1042](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1042) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) +Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index 58310e1af49..e62579744ba 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) +Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) +Defined in: [packages/query-core/src/types.ts:1133](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1133) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) +Defined in: [packages/query-core/src/types.ts:1128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1128) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) +Defined in: [packages/query-core/src/types.ts:1129](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1129) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) +Defined in: [packages/query-core/src/types.ts:1132](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1132) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) +Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) +Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) +Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index 22ed760c153..a67e877f083 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1094](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1094) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) +Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) +Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) +Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 732c882f86f..0b875662cbc 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) +Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) +Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) +Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) +Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/lit/reference/interfaces/InfiniteQueryPageParamsOptions.md index bfab8bfc319..afe27785edc 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryPageParamsOptions.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryPageParamsOptions title: InfiniteQueryPageParamsOptions --- -Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) +Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L347) ## Extends @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/q getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -44,7 +44,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -57,7 +57,7 @@ The result will also be used to determine the value of `hasPreviousPage`. initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from diff --git a/docs/framework/lit/reference/interfaces/InitialPageParam.md b/docs/framework/lit/reference/interfaces/InitialPageParam.md index ffbf32ae0d6..2d42bf029a4 100644 --- a/docs/framework/lit/reference/interfaces/InitialPageParam.md +++ b/docs/framework/lit/reference/interfaces/InitialPageParam.md @@ -3,7 +3,7 @@ id: InitialPageParam title: InitialPageParam --- -Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) +Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L343) ## Extended by @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/q initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) diff --git a/docs/framework/lit/reference/interfaces/InvalidateOptions.md b/docs/framework/lit/reference/interfaces/InvalidateOptions.md index 1cd96c88165..d83ecd43ec0 100644 --- a/docs/framework/lit/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/lit/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L713) +Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/lit/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/lit/reference/interfaces/InvalidateQueryFilters.md index 35fd04b9378..36eb3f27998 100644 --- a/docs/framework/lit/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/lit/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) +Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -26,7 +26,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -42,7 +42,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -58,7 +58,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -84,7 +84,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -100,7 +100,7 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) +Defined in: [packages/query-core/src/types.ts:717](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L717) Controls which of the matched (now-invalidated) queries are refetched in the background. Defaults to `'active'`. @@ -117,7 +117,7 @@ Defaults to `'active'`. optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -133,10 +133,12 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries +Defaults to `'all'`. + #### Inherited from [`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/lit/reference/interfaces/MutateOptions.md b/docs/framework/lit/reference/interfaces/MutateOptions.md index 6e27e4e6d29..b12b3b29ec2 100644 --- a/docs/framework/lit/reference/interfaces/MutateOptions.md +++ b/docs/framework/lit/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1247) +Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1282) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1235](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1235) +Defined in: [packages/query-core/src/types.ts:1270](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1270) #### Parameters diff --git a/docs/framework/lit/reference/interfaces/MutationFilters.md b/docs/framework/lit/reference/interfaces/MutationFilters.md index 378a411bfe5..fbc0208e8e1 100644 --- a/docs/framework/lit/reference/interfaces/MutationFilters.md +++ b/docs/framework/lit/reference/interfaces/MutationFilters.md @@ -3,7 +3,7 @@ id: MutationFilters title: MutationFilters --- -Defined in: [packages/query-core/src/utils.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L62) +Defined in: [packages/query-core/src/utils.ts:64](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L64) Filters used to select mutations, for example in `mutationCache.findAll` or `queryClient.isMutating`. All provided filters must match; filters that are left unspecified are ignored. @@ -34,7 +34,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L71) +Defined in: [packages/query-core/src/utils.ts:73](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L73) Match mutation key exactly @@ -46,7 +46,7 @@ Match mutation key exactly optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/utils.ts:81](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L81) +Defined in: [packages/query-core/src/utils.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L83) Include mutations matching this mutation key @@ -58,7 +58,7 @@ Include mutations matching this mutation key optional predicate: (mutation) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L75) +Defined in: [packages/query-core/src/utils.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L77) Include mutations matching this predicate function @@ -80,6 +80,6 @@ Include mutations matching this predicate function optional status: MutationStatus; ``` -Defined in: [packages/query-core/src/utils.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L85) +Defined in: [packages/query-core/src/utils.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L87) Filter by mutation status diff --git a/docs/framework/lit/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/lit/reference/interfaces/MutationObserverBaseResult.md index 190d4d4d3b6..e1c09a56737 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) +Defined in: [packages/query-core/src/types.ts:1315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1315) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1289) +Defined in: [packages/query-core/src/types.ts:1324](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1324) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1298) +Defined in: [packages/query-core/src/types.ts:1333](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1333) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1303) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1308) +Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1313](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1313) +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1318](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1318) +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1327](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1327) +Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1293](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1293) +Defined in: [packages/query-core/src/types.ts:1328](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1328) The variables object passed to the `mutationFn`. diff --git a/docs/framework/lit/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/lit/reference/interfaces/MutationObserverErrorResult.md index 03af3a33d12..cce591e3465 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) +Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1399](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1399) +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) +Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1402) +Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1403](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1403) +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1404) +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1405](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1405) +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) +Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) The variables object passed to the `mutationFn`. diff --git a/docs/framework/lit/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/lit/reference/interfaces/MutationObserverIdleResult.md index 833db327a04..b7892846a6c 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) +Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1356](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1356) +Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1359](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1359) +Defined in: [packages/query-core/src/types.ts:1394](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1394) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1360) +Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1361) +Defined in: [packages/query-core/src/types.ts:1396](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1396) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) +Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1357](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1357) +Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) The variables object passed to the `mutationFn`. diff --git a/docs/framework/lit/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/lit/reference/interfaces/MutationObserverLoadingResult.md index 6732628f444..d4368822213 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) +Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1379](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1379) +Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) +Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1381](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1381) +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) +Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1383](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1383) +Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1384](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1384) +Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1378](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1378) +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) The variables object passed to the `mutationFn`. diff --git a/docs/framework/lit/reference/interfaces/MutationObserverOptions.md b/docs/framework/lit/reference/interfaces/MutationObserverOptions.md index be502d19332..1e609be9bf1 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1220) +Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1255) ## Extends @@ -35,7 +35,12 @@ Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) + +The time in milliseconds that an unused/inactive mutation remains in memory before it is +garbage collected. + +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. #### Inherited from @@ -49,7 +54,7 @@ Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) #### Inherited from @@ -63,7 +68,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) #### Inherited from @@ -77,7 +82,7 @@ Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Inherited from @@ -91,7 +96,13 @@ Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. #### Inherited from @@ -105,7 +116,7 @@ Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -141,7 +152,7 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) #### Parameters @@ -169,7 +180,7 @@ Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) #### Parameters @@ -209,7 +220,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) +Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) #### Parameters @@ -245,7 +256,14 @@ Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) + +If `false`, failed mutations will not retry by default. +If `true`, failed mutations will retry infinitely. +If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. +If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + +Defaults to `0`. #### Inherited from @@ -259,7 +277,12 @@ Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/ optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) +Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +Defaults to a function that applies exponential backoff, capped at 30 seconds. #### Inherited from @@ -273,7 +296,7 @@ Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/ optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) +Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) #### Inherited from @@ -287,4 +310,4 @@ Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) +Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) diff --git a/docs/framework/lit/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/lit/reference/interfaces/MutationObserverSuccessResult.md index 89e8c2739cc..52cdcc4883e 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) +Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1420](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1420) +Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) +Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1423](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1423) +Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1424](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1424) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1425) +Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1426](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1426) +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) +Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) The variables object passed to the `mutationFn`. diff --git a/docs/framework/lit/reference/interfaces/MutationOptions.md b/docs/framework/lit/reference/interfaces/MutationOptions.md index 8721b62d099..49f2b8f4f19 100644 --- a/docs/framework/lit/reference/interfaces/MutationOptions.md +++ b/docs/framework/lit/reference/interfaces/MutationOptions.md @@ -3,7 +3,7 @@ id: MutationOptions title: MutationOptions --- -Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) ## Extended by @@ -35,7 +35,12 @@ Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) + +The time in milliseconds that an unused/inactive mutation remains in memory before it is +garbage collected. + +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. *** @@ -45,7 +50,7 @@ Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) *** @@ -55,7 +60,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) *** @@ -65,7 +70,7 @@ Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) *** @@ -75,7 +80,13 @@ Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. *** @@ -85,7 +96,7 @@ Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -117,7 +128,7 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) #### Parameters @@ -141,7 +152,7 @@ Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) #### Parameters @@ -177,7 +188,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) +Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) #### Parameters @@ -209,7 +220,14 @@ Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) + +If `false`, failed mutations will not retry by default. +If `true`, failed mutations will retry infinitely. +If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. +If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + +Defaults to `0`. *** @@ -219,7 +237,12 @@ Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/ optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) +Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +Defaults to a function that applies exponential backoff, capped at 30 seconds. *** @@ -229,4 +252,4 @@ Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/ optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) +Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) diff --git a/docs/framework/lit/reference/interfaces/NotifyEvent.md b/docs/framework/lit/reference/interfaces/NotifyEvent.md index 17b3241654f..5e7875d41b8 100644 --- a/docs/framework/lit/reference/interfaces/NotifyEvent.md +++ b/docs/framework/lit/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) +Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1519) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1485) +Defined in: [packages/query-core/src/types.ts:1520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1520) diff --git a/docs/framework/lit/reference/interfaces/QueriesObserverOptions.md b/docs/framework/lit/reference/interfaces/QueriesObserverOptions.md index 16035c45714..68e7913885d 100644 --- a/docs/framework/lit/reference/interfaces/QueriesObserverOptions.md +++ b/docs/framework/lit/reference/interfaces/QueriesObserverOptions.md @@ -19,9 +19,11 @@ Defined in: [packages/query-core/src/queriesObserver.ts:23](https://github.com/T optional combine: CombineFn; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L32) +Defined in: [packages/query-core/src/queriesObserver.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L34) A function that combines the array of `QueryObserverResult`s (one per observed query) into a single value. The combined value is memoized and only recomputed when one of the underlying results, the query hashes, or the `combine` function itself changes. + +Defaults to returning the array of `QueryObserverResult`s unchanged. diff --git a/docs/framework/lit/reference/interfaces/QueryClientConfig.md b/docs/framework/lit/reference/interfaces/QueryClientConfig.md index b04dadba88c..411eb0b2fb2 100644 --- a/docs/framework/lit/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/lit/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/ optional defaultOptions: DefaultOptions; ``` -Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) Default options for all queries and mutations created through this client. @@ -25,7 +25,7 @@ Default options for all queries and mutations created through this client. optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1447](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1447) +Defined in: [packages/query-core/src/types.ts:1482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1482) The mutation cache this client is connected to. A new `MutationCache` is created if not provided. @@ -38,6 +38,6 @@ provided. optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) +Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/lit/reference/interfaces/QueryExecuteOptions.md b/docs/framework/lit/reference/interfaces/QueryExecuteOptions.md index 87335ca1648..388889fb6e7 100644 --- a/docs/framework/lit/reference/interfaces/QueryExecuteOptions.md +++ b/docs/framework/lit/reference/interfaces/QueryExecuteOptions.md @@ -3,7 +3,7 @@ id: QueryExecuteOptions title: QueryExecuteOptions --- -Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L555) +Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) ## Extends @@ -43,7 +43,7 @@ Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -70,7 +70,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -93,7 +93,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -111,7 +111,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) +Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L577) *** @@ -121,7 +121,7 @@ Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -139,7 +139,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -158,7 +158,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -180,7 +180,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -201,7 +201,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -223,7 +223,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -242,7 +242,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -265,7 +265,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -283,12 +283,13 @@ WithRequired.queryKeyHashFn optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -305,7 +306,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -329,7 +330,7 @@ WithRequired.retryDelay optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L567) +Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L578) #### Parameters @@ -349,7 +350,7 @@ Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:572](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L572) +Defined in: [packages/query-core/src/types.ts:583](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L583) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -362,10 +363,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/lit/reference/interfaces/QueryFilters.md b/docs/framework/lit/reference/interfaces/QueryFilters.md index 6b177d93aa5..749e4283d0d 100644 --- a/docs/framework/lit/reference/interfaces/QueryFilters.md +++ b/docs/framework/lit/reference/interfaces/QueryFilters.md @@ -27,7 +27,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -39,7 +39,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -51,7 +51,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -73,7 +73,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -85,7 +85,7 @@ Include queries matching this query key optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -97,6 +97,8 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries + +Defaults to `'all'`. diff --git a/docs/framework/lit/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/lit/reference/interfaces/QueryObserverBaseResult.md index 4689d9d661a..1b54d6f8041 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L743) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) +Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) +Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) +Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) +Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) +Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/lit/reference/interfaces/QueryObserverLoadingErrorResult.md index 86ae34b80ab..7a4f855305f 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) +Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) +Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/lit/reference/interfaces/QueryObserverLoadingResult.md index a0024077883..8f94574bcca 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) +Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) +Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverOptions.md b/docs/framework/lit/reference/interfaces/QueryObserverOptions.md index ca8d2126d97..c5c6bb0a300 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverOptions.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverOptions.md @@ -3,7 +3,7 @@ id: QueryObserverOptions title: QueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L373) +Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L375) ## Extends @@ -47,11 +47,12 @@ Defined in: [packages/query-core/src/types.ts:373](https://github.com/TanStack/q optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. *** @@ -62,7 +63,7 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -89,7 +90,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -112,7 +113,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -130,7 +131,7 @@ WithRequired.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -148,7 +149,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -167,7 +168,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -189,7 +190,7 @@ WithRequired.networkMode optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -205,7 +206,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -226,7 +227,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -240,7 +241,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -262,7 +263,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -281,7 +282,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -304,7 +305,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -322,10 +323,11 @@ WithRequired.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. *** @@ -336,7 +338,7 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -349,12 +351,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. *** @@ -365,12 +368,13 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. *** @@ -381,12 +385,13 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. *** @@ -397,12 +402,13 @@ Defaults to `true`. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -419,7 +425,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -443,10 +449,11 @@ WithRequired.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. *** @@ -457,7 +464,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -482,12 +489,13 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. *** @@ -498,10 +506,11 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -518,10 +527,11 @@ WithRequired.structuralSharing optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. *** @@ -532,10 +542,11 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. diff --git a/docs/framework/lit/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/lit/reference/interfaces/QueryObserverPendingResult.md index 21fab248a7c..41a101c7c8c 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:875](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L875) +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:876](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L876) +Defined in: [packages/query-core/src/types.ts:887](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L887) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) +Defined in: [packages/query-core/src/types.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L888) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) +Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/lit/reference/interfaces/QueryObserverPlaceholderResult.md index 89af2502c11..cce7cffcc9b 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) +Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) +Defined in: [packages/query-core/src/types.ts:969](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L969) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) +Defined in: [packages/query-core/src/types.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L970) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) +Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) +Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) +Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) +Defined in: [packages/query-core/src/types.ts:972](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L972) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/lit/reference/interfaces/QueryObserverRefetchErrorResult.md index dab5586fdc1..8486e8cf4cb 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) +Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) +Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/lit/reference/interfaces/QueryObserverSuccessResult.md index b180b89ca62..f126bea0f70 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) +Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) +Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) +Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) +Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryOptions.md b/docs/framework/lit/reference/interfaces/QueryOptions.md index 790971f72b6..93fe7ee24b9 100644 --- a/docs/framework/lit/reference/interfaces/QueryOptions.md +++ b/docs/framework/lit/reference/interfaces/QueryOptions.md @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:231](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -56,7 +56,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -73,7 +73,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -85,7 +85,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -97,7 +97,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -110,7 +110,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -126,7 +126,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -141,7 +141,7 @@ optional queryFn: | typeof skipToken; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -157,7 +157,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -170,7 +170,7 @@ as the actual cache key internally. optional queryKey: TQueryKey; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -187,7 +187,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -199,12 +199,13 @@ If specified, this function is used to hash the `queryKey` to a string. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. *** @@ -215,7 +216,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -233,8 +234,9 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. diff --git a/docs/framework/lit/reference/interfaces/RefetchOptions.md b/docs/framework/lit/reference/interfaces/RefetchOptions.md index b502dcd3492..104412c5bac 100644 --- a/docs/framework/lit/reference/interfaces/RefetchOptions.md +++ b/docs/framework/lit/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L684) +Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,7 +38,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/lit/reference/interfaces/RefetchQueryFilters.md b/docs/framework/lit/reference/interfaces/RefetchQueryFilters.md index 84f917c6201..bde28360fa1 100644 --- a/docs/framework/lit/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/lit/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:709](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L709) +Defined in: [packages/query-core/src/types.ts:720](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L720) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -26,7 +26,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -42,7 +42,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -58,7 +58,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -84,7 +84,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -100,7 +100,7 @@ Include queries matching this query key optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -116,10 +116,12 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries +Defaults to `'all'`. + #### Inherited from [`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/lit/reference/interfaces/ResetOptions.md b/docs/framework/lit/reference/interfaces/ResetOptions.md index 1855fef3064..6d3a8398fbb 100644 --- a/docs/framework/lit/reference/interfaces/ResetOptions.md +++ b/docs/framework/lit/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L714) +Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/lit/reference/interfaces/ResultOptions.md b/docs/framework/lit/reference/interfaces/ResultOptions.md index 9766c56d1a6..f3da151a3ec 100644 --- a/docs/framework/lit/reference/interfaces/ResultOptions.md +++ b/docs/framework/lit/reference/interfaces/ResultOptions.md @@ -3,7 +3,7 @@ id: ResultOptions title: ResultOptions --- -Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) +Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L686) ## Extended by @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/lit/reference/interfaces/SetDataOptions.md b/docs/framework/lit/reference/interfaces/SetDataOptions.md index 4262e781b05..cac83e9312a 100644 --- a/docs/framework/lit/reference/interfaces/SetDataOptions.md +++ b/docs/framework/lit/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1471) +Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1506) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1472](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1472) +Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) diff --git a/docs/framework/lit/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/lit/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md index 733a1a5ad75..4412ad00c8e 100644 --- a/docs/framework/lit/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md +++ b/docs/framework/lit/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedInfiniteQueryObserverOptions type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:538](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L538) +Defined in: [packages/query-core/src/types.ts:549](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L549) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/lit/reference/type-aliases/DefaultedQueryObserverOptions.md index 1b4309f150c..9ce8401b128 100644 --- a/docs/framework/lit/reference/type-aliases/DefaultedQueryObserverOptions.md +++ b/docs/framework/lit/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedQueryObserverOptions type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L509) +Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index 0b7be77eb7d..b39c86d6d91 100644 --- a/docs/framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) +Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/lit/reference/type-aliases/DefinedQueryObserverResult.md index f8d52177d06..98eef146e62 100644 --- a/docs/framework/lit/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/lit/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) +Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/lit/reference/type-aliases/EnsureInfiniteQueryDataOptions.md index 305eef94893..ff75b1c3449 100644 --- a/docs/framework/lit/reference/type-aliases/EnsureInfiniteQueryDataOptions.md +++ b/docs/framework/lit/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -7,7 +7,7 @@ title: EnsureInfiniteQueryDataOptions type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; ``` -Defined in: [packages/query-core/src/types.ts:612](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L612) +Defined in: [packages/query-core/src/types.ts:623](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L623) ## Type Declaration diff --git a/docs/framework/lit/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/lit/reference/type-aliases/FetchInfiniteQueryOptions.md index 1ee1470b14a..c926bbd3ae5 100644 --- a/docs/framework/lit/reference/type-aliases/FetchInfiniteQueryOptions.md +++ b/docs/framework/lit/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: FetchInfiniteQueryOptions type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L656) +Defined in: [packages/query-core/src/types.ts:667](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L667) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/FetchStatus.md b/docs/framework/lit/reference/type-aliases/FetchStatus.md index 7b71e54eacd..b347069e97e 100644 --- a/docs/framework/lit/reference/type-aliases/FetchStatus.md +++ b/docs/framework/lit/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:752](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L752) diff --git a/docs/framework/lit/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/lit/reference/type-aliases/InfiniteQueryExecuteOptions.md index 29c974cfddf..c198662a319 100644 --- a/docs/framework/lit/reference/type-aliases/InfiniteQueryExecuteOptions.md +++ b/docs/framework/lit/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -7,7 +7,7 @@ title: InfiniteQueryExecuteOptions type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:635](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L635) +Defined in: [packages/query-core/src/types.ts:646](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L646) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/lit/reference/type-aliases/InfiniteQueryObserverResult.md index e7822e69448..10b04a8ef45 100644 --- a/docs/framework/lit/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/lit/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) +Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/MutateFunction.md b/docs/framework/lit/reference/type-aliases/MutateFunction.md index 284bd0fc270..558040d3439 100644 --- a/docs/framework/lit/reference/type-aliases/MutateFunction.md +++ b/docs/framework/lit/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1271) +Defined in: [packages/query-core/src/types.ts:1306](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1306) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/MutateFunctionRest.md b/docs/framework/lit/reference/type-aliases/MutateFunctionRest.md index a2f16ea5302..3e7a5217482 100644 --- a/docs/framework/lit/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/lit/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1256) +Defined in: [packages/query-core/src/types.ts:1291](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1291) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/MutationFunction.md b/docs/framework/lit/reference/type-aliases/MutationFunction.md index 4c8c7aed384..330af1ef65a 100644 --- a/docs/framework/lit/reference/type-aliases/MutationFunction.md +++ b/docs/framework/lit/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/MutationFunctionContext.md b/docs/framework/lit/reference/type-aliases/MutationFunctionContext.md index ef228cc53d3..97de2f1c220 100644 --- a/docs/framework/lit/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/lit/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) +Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1169) +Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1180) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1170) +Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) +Defined in: [packages/query-core/src/types.ts:1182](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1182) diff --git a/docs/framework/lit/reference/type-aliases/MutationKey.md b/docs/framework/lit/reference/type-aliases/MutationKey.md index 7157d6052fd..8e9d3bc3b3a 100644 --- a/docs/framework/lit/reference/type-aliases/MutationKey.md +++ b/docs/framework/lit/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) diff --git a/docs/framework/lit/reference/type-aliases/MutationMeta.md b/docs/framework/lit/reference/type-aliases/MutationMeta.md index f3bf9984fab..474c593e206 100644 --- a/docs/framework/lit/reference/type-aliases/MutationMeta.md +++ b/docs/framework/lit/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1160](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1160) +Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) diff --git a/docs/framework/lit/reference/type-aliases/MutationObserverResult.md b/docs/framework/lit/reference/type-aliases/MutationObserverResult.md index ad7dab33719..9e77b88ccb5 100644 --- a/docs/framework/lit/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/lit/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) +Defined in: [packages/query-core/src/types.ts:1464](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1464) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/MutationScope.md b/docs/framework/lit/reference/type-aliases/MutationScope.md index a2511c903d9..feac9d9d17a 100644 --- a/docs/framework/lit/reference/type-aliases/MutationScope.md +++ b/docs/framework/lit/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) +Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1167) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) +Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) diff --git a/docs/framework/lit/reference/type-aliases/MutationStatus.md b/docs/framework/lit/reference/type-aliases/MutationStatus.md index d9b58cdd26f..4cd2d3c9535 100644 --- a/docs/framework/lit/reference/type-aliases/MutationStatus.md +++ b/docs/framework/lit/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1154](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1154) +Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) diff --git a/docs/framework/lit/reference/type-aliases/NotifyEventType.md b/docs/framework/lit/reference/type-aliases/NotifyEventType.md index 57d44fb7b0b..86fc4759cca 100644 --- a/docs/framework/lit/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/lit/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) +Defined in: [packages/query-core/src/types.ts:1510](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1510) diff --git a/docs/framework/lit/reference/type-aliases/QueryObserverResult.md b/docs/framework/lit/reference/type-aliases/QueryObserverResult.md index 6ee9c323535..fb68f3c291a 100644 --- a/docs/framework/lit/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/lit/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) +Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/QueryStatus.md b/docs/framework/lit/reference/type-aliases/QueryStatus.md index 3fc872e604b..6679b8b17c6 100644 --- a/docs/framework/lit/reference/type-aliases/QueryStatus.md +++ b/docs/framework/lit/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:740](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L740) +Defined in: [packages/query-core/src/types.ts:751](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L751) diff --git a/docs/framework/lit/reference/type-aliases/SkipToken.md b/docs/framework/lit/reference/type-aliases/SkipToken.md index 176c23830d2..3a5791b982e 100644 --- a/docs/framework/lit/reference/type-aliases/SkipToken.md +++ b/docs/framework/lit/reference/type-aliases/SkipToken.md @@ -7,6 +7,6 @@ title: SkipToken type SkipToken = typeof skipToken; ``` -Defined in: [packages/query-core/src/utils.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L524) +Defined in: [packages/query-core/src/utils.ts:526](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L526) The type of the [skipToken](../variables/skipToken.md) sentinel value. diff --git a/docs/framework/lit/reference/type-aliases/ThrowOnError.md b/docs/framework/lit/reference/type-aliases/ThrowOnError.md index 60ad44c1cd1..613549e4d52 100644 --- a/docs/framework/lit/reference/type-aliases/ThrowOnError.md +++ b/docs/framework/lit/reference/type-aliases/ThrowOnError.md @@ -7,7 +7,7 @@ title: ThrowOnError type ThrowOnError = boolean | (error, query) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L361) +Defined in: [packages/query-core/src/types.ts:363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L363) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/Updater.md b/docs/framework/lit/reference/type-aliases/Updater.md index b6a29ccc5fc..7a0c2f30503 100644 --- a/docs/framework/lit/reference/type-aliases/Updater.md +++ b/docs/framework/lit/reference/type-aliases/Updater.md @@ -7,7 +7,7 @@ title: Updater type Updater = TOutput | (input) => TOutput; ``` -Defined in: [packages/query-core/src/utils.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L103) +Defined in: [packages/query-core/src/utils.ts:105](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L105) Either a plain value of type `TOutput`, or a function that receives `TInput` and returns `TOutput`. Used for example by `setQueryData`-style updaters, which accept either the new data directly or a diff --git a/docs/framework/lit/reference/type-aliases/WithRequired.md b/docs/framework/lit/reference/type-aliases/WithRequired.md index c8ef831db3c..deb87dfe4a4 100644 --- a/docs/framework/lit/reference/type-aliases/WithRequired.md +++ b/docs/framework/lit/reference/type-aliases/WithRequired.md @@ -7,7 +7,7 @@ title: WithRequired type WithRequired = TTarget & { [_ in TKey]: {} }; ``` -Defined in: [packages/query-core/src/types.ts:505](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L505) +Defined in: [packages/query-core/src/types.ts:516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L516) ## Type Parameters diff --git a/docs/framework/lit/reference/variables/isServer.md b/docs/framework/lit/reference/variables/isServer.md index 28956d55cbf..16aa39d1244 100644 --- a/docs/framework/lit/reference/variables/isServer.md +++ b/docs/framework/lit/reference/variables/isServer.md @@ -7,7 +7,7 @@ title: isServer const isServer: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L112) +Defined in: [packages/query-core/src/utils.ts:114](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L114) ## Deprecated diff --git a/docs/framework/lit/reference/variables/skipToken.md b/docs/framework/lit/reference/variables/skipToken.md index 3163e91c1c2..a390d0b7b66 100644 --- a/docs/framework/lit/reference/variables/skipToken.md +++ b/docs/framework/lit/reference/variables/skipToken.md @@ -7,7 +7,7 @@ title: skipToken const skipToken: typeof skipToken; ``` -Defined in: [packages/query-core/src/utils.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L520) +Defined in: [packages/query-core/src/utils.ts:522](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L522) Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`, diff --git a/docs/framework/preact/reference/classes/QueriesObserver.md b/docs/framework/preact/reference/classes/QueriesObserver.md index a40f2d2bef6..379e6fc95ee 100644 --- a/docs/framework/preact/reference/classes/QueriesObserver.md +++ b/docs/framework/preact/reference/classes/QueriesObserver.md @@ -3,7 +3,7 @@ id: QueriesObserver title: QueriesObserver --- -Defined in: [packages/query-core/src/queriesObserver.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L54) +Defined in: [packages/query-core/src/queriesObserver.ts:56](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L56) A `QueriesObserver` watches an array of queries at once, exposing them as a single array of `QueryObserverResult`s (or, when a `combine` option is @@ -45,7 +45,7 @@ new QueriesObserver( options?): QueriesObserver; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L68) +Defined in: [packages/query-core/src/queriesObserver.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L70) #### Parameters @@ -95,7 +95,7 @@ Subscribable.listeners destroy(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L104) +Defined in: [packages/query-core/src/queriesObserver.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L106) Stops observing all queries: clears all listeners and destroys every underlying `QueryObserver` this observer manages. @@ -112,7 +112,7 @@ underlying `QueryObserver` this observer manages. getCurrentResult(): QueryObserverResult[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L208) +Defined in: [packages/query-core/src/queriesObserver.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L210) Returns the most recently computed array of `QueryObserverResult`s, one per observed query, in the same order as the queries passed to the @@ -137,7 +137,7 @@ const data = results.map((result) => result.data) getObservers(): QueryObserver[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L225) +Defined in: [packages/query-core/src/queriesObserver.ts:227](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L227) Returns the underlying `QueryObserver` instances this observer manages, in the same order as the queries passed to the constructor or @@ -155,7 +155,7 @@ in the same order as the queries passed to the constructor or getOptimisticResult(queries, combine): [QueryObserverResult[], (r?) => TCombinedResult, () => QueryObserverResult[]]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L236) +Defined in: [packages/query-core/src/queriesObserver.ts:238](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L238) The `QueriesObserver` counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult) — computes the result for the given (already-defaulted) queries right now, synchronously. Called by @@ -185,7 +185,7 @@ wrap the results for property-access tracking. getQueries(): Query[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:216](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L216) +Defined in: [packages/query-core/src/queriesObserver.ts:218](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L218) Returns the underlying `Query` instances currently being observed, in the same order as the queries passed to the constructor or `setQueries`. @@ -222,7 +222,7 @@ Subscribable.hasListeners protected onSubscribe(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L84) +Defined in: [packages/query-core/src/queriesObserver.ts:86](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L86) #### Returns @@ -242,7 +242,7 @@ Subscribable.onSubscribe protected onUnsubscribe(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L94) +Defined in: [packages/query-core/src/queriesObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L96) #### Returns @@ -262,7 +262,7 @@ Subscribable.onUnsubscribe setQueries(queries, options?): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:125](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L125) +Defined in: [packages/query-core/src/queriesObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L127) Replaces the set of queries being observed. Existing `QueryObserver`s are reused for queries that match an already-observed query hash; diff --git a/docs/framework/preact/reference/functions/hashKey.md b/docs/framework/preact/reference/functions/hashKey.md index 9e7844aa09d..dc774c032ce 100644 --- a/docs/framework/preact/reference/functions/hashKey.md +++ b/docs/framework/preact/reference/functions/hashKey.md @@ -7,7 +7,7 @@ title: hashKey function hashKey(queryKey): string; ``` -Defined in: [packages/query-core/src/utils.ts:282](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L282) +Defined in: [packages/query-core/src/utils.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L284) Default query & mutation keys hash function. Hashes the value into a stable hash. diff --git a/docs/framework/preact/reference/functions/keepPreviousData.md b/docs/framework/preact/reference/functions/keepPreviousData.md index d41c7d7c726..6a84f4c5970 100644 --- a/docs/framework/preact/reference/functions/keepPreviousData.md +++ b/docs/framework/preact/reference/functions/keepPreviousData.md @@ -7,7 +7,7 @@ title: keepPreviousData function keepPreviousData(previousData): T | undefined; ``` -Defined in: [packages/query-core/src/utils.ts:491](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L491) +Defined in: [packages/query-core/src/utils.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L493) Intended to be passed as a query's `placeholderData` option, for example `placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new diff --git a/docs/framework/preact/reference/functions/matchMutation.md b/docs/framework/preact/reference/functions/matchMutation.md index 79468dcfad9..40210da4cf1 100644 --- a/docs/framework/preact/reference/functions/matchMutation.md +++ b/docs/framework/preact/reference/functions/matchMutation.md @@ -7,7 +7,7 @@ title: matchMutation function matchMutation(filters, mutation): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:235](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L235) +Defined in: [packages/query-core/src/utils.ts:237](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L237) Checks whether a mutation matches the given [MutationFilters](../interfaces/MutationFilters.md). Every filter that is specified must match; filters that are left unspecified are ignored. diff --git a/docs/framework/preact/reference/functions/matchQuery.md b/docs/framework/preact/reference/functions/matchQuery.md index f98fe5f3537..4c54b2df995 100644 --- a/docs/framework/preact/reference/functions/matchQuery.md +++ b/docs/framework/preact/reference/functions/matchQuery.md @@ -7,7 +7,7 @@ title: matchQuery function matchQuery(filters, query): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L173) +Defined in: [packages/query-core/src/utils.ts:175](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L175) Checks whether a query matches the given [QueryFilters](../interfaces/QueryFilters.md). Every filter that is specified must match; filters that are left unspecified are ignored. diff --git a/docs/framework/preact/reference/functions/noop.md b/docs/framework/preact/reference/functions/noop.md index fd1b8dc2ad0..01fb409f4e9 100644 --- a/docs/framework/preact/reference/functions/noop.md +++ b/docs/framework/preact/reference/functions/noop.md @@ -9,7 +9,7 @@ title: noop function noop(): void; ``` -Defined in: [packages/query-core/src/utils.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L117) +Defined in: [packages/query-core/src/utils.ts:119](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L119) A function that does nothing. @@ -23,7 +23,7 @@ A function that does nothing. function noop(): undefined; ``` -Defined in: [packages/query-core/src/utils.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L118) +Defined in: [packages/query-core/src/utils.ts:120](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L120) A function that does nothing. diff --git a/docs/framework/preact/reference/functions/partialMatchKey.md b/docs/framework/preact/reference/functions/partialMatchKey.md index 3795de85b95..4db67323e9b 100644 --- a/docs/framework/preact/reference/functions/partialMatchKey.md +++ b/docs/framework/preact/reference/functions/partialMatchKey.md @@ -7,7 +7,7 @@ title: partialMatchKey function partialMatchKey(a, b): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L298) +Defined in: [packages/query-core/src/utils.ts:300](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L300) Checks if key `b` partially matches with key `a`. diff --git a/docs/framework/preact/reference/functions/replaceEqualDeep.md b/docs/framework/preact/reference/functions/replaceEqualDeep.md index 77a393196ef..6a81c3907fb 100644 --- a/docs/framework/preact/reference/functions/replaceEqualDeep.md +++ b/docs/framework/preact/reference/functions/replaceEqualDeep.md @@ -10,7 +10,7 @@ function replaceEqualDeep( depth?): T; ``` -Defined in: [packages/query-core/src/utils.ts:337](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L337) +Defined in: [packages/query-core/src/utils.ts:339](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L339) This function returns `a` if `b` is deeply equal. If not, it will replace any deeply equal children of `b` with those of `a`. diff --git a/docs/framework/preact/reference/functions/shouldThrowError.md b/docs/framework/preact/reference/functions/shouldThrowError.md index 3146617391e..1f1e62a8d0e 100644 --- a/docs/framework/preact/reference/functions/shouldThrowError.md +++ b/docs/framework/preact/reference/functions/shouldThrowError.md @@ -7,7 +7,7 @@ title: shouldThrowError function shouldThrowError(throwOnError, params): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L574) +Defined in: [packages/query-core/src/utils.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L576) Resolves a `throwOnError` option to a boolean. If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller, diff --git a/docs/framework/preact/reference/interfaces/CancelOptions.md b/docs/framework/preact/reference/interfaces/CancelOptions.md index 14394c18533..f52c729f3b1 100644 --- a/docs/framework/preact/reference/interfaces/CancelOptions.md +++ b/docs/framework/preact/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1466) +Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1501) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1467) +Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1468) +Defined in: [packages/query-core/src/types.ts:1503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1503) diff --git a/docs/framework/preact/reference/interfaces/DefaultOptions.md b/docs/framework/preact/reference/interfaces/DefaultOptions.md index 026116d11db..67ae012f9ee 100644 --- a/docs/framework/preact/reference/interfaces/DefaultOptions.md +++ b/docs/framework/preact/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) +Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1487) ## Type Parameters @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/ optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) +Defined in: [packages/query-core/src/types.ts:1498](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1498) Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). @@ -31,7 +31,7 @@ Default options used when dehydrating the client's caches; see [DehydrateOptions optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1496](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1496) Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). @@ -67,7 +67,7 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) +Defined in: [packages/query-core/src/types.ts:1494](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1494) Default options applied to every mutation, unless overridden per-mutation. @@ -79,6 +79,6 @@ Default options applied to every mutation, unless overridden per-mutation. optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) +Defined in: [packages/query-core/src/types.ts:1489](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1489) Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/preact/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/preact/reference/interfaces/EnsureQueryDataOptions.md index d7b4751a9d3..d71a60902e6 100644 --- a/docs/framework/preact/reference/interfaces/EnsureQueryDataOptions.md +++ b/docs/framework/preact/reference/interfaces/EnsureQueryDataOptions.md @@ -3,7 +3,7 @@ id: EnsureQueryDataOptions title: EnsureQueryDataOptions --- -Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) +Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L606) ## Deprecated @@ -41,7 +41,7 @@ Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -66,7 +66,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -87,7 +87,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -103,7 +103,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) +Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) #### Inherited from @@ -117,7 +117,7 @@ Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -133,7 +133,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -150,7 +150,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -170,7 +170,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -189,7 +189,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -209,7 +209,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -226,7 +226,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -247,7 +247,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -263,12 +263,13 @@ If specified, this function is used to hash the `queryKey` to a string. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -283,7 +284,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -305,7 +306,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional revalidateIfStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L608) +Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L619) *** @@ -315,7 +316,7 @@ Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) +Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -332,10 +333,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/FetchNextPageOptions.md b/docs/framework/preact/reference/interfaces/FetchNextPageOptions.md index d12afe35fe1..2c0be977140 100644 --- a/docs/framework/preact/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/preact/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L716) +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) +Defined in: [packages/query-core/src/types.ts:736](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L736) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/preact/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/preact/reference/interfaces/FetchPreviousPageOptions.md index 93ca92088f1..683e789ee52 100644 --- a/docs/framework/preact/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/preact/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) +Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L739) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:748](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L748) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/preact/reference/interfaces/FetchQueryOptions.md b/docs/framework/preact/reference/interfaces/FetchQueryOptions.md index 3b9347e06ea..634ae0e09f9 100644 --- a/docs/framework/preact/reference/interfaces/FetchQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/FetchQueryOptions.md @@ -3,7 +3,7 @@ id: FetchQueryOptions title: FetchQueryOptions --- -Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L576) +Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L587) ## Deprecated @@ -45,7 +45,7 @@ Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -72,7 +72,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -95,7 +95,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -113,7 +113,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) +Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) *** @@ -123,7 +123,7 @@ Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -141,7 +141,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -160,7 +160,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -182,7 +182,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -203,7 +203,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -225,7 +225,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -244,7 +244,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -267,7 +267,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -285,12 +285,13 @@ WithRequired.queryKeyHashFn optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -307,7 +308,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -331,7 +332,7 @@ WithRequired.retryDelay optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) +Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -344,10 +345,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult.md index f1443c39625..9195e0727f8 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L991) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) +Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) +Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) +Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) +Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) +Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 7c55201c028..2841b5ab116 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) +Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) +Defined in: [packages/query-core/src/types.ts:1076](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1076) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) +Defined in: [packages/query-core/src/types.ts:1077](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1077) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) +Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult.md index f9541ebd73b..95ff84b3ef3 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) +Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) +Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) +Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) +Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverOptions.md index db1ca7f18fe..7d5b0dd1a4d 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverOptions.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverOptions title: InfiniteQueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) +Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L531) ## Extends @@ -39,11 +39,12 @@ Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/q optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -58,7 +59,7 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -81,7 +82,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -98,7 +99,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -117,7 +118,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -138,7 +139,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -154,7 +155,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from @@ -168,7 +169,7 @@ Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -184,7 +185,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -201,7 +202,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -221,7 +222,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -241,7 +242,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -260,7 +261,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -278,7 +279,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -298,7 +299,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -315,7 +316,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -336,7 +337,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -352,10 +353,11 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -370,7 +372,7 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -387,12 +389,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -407,12 +410,13 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -427,12 +431,13 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -447,12 +452,13 @@ Defaults to `true`. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -467,7 +473,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -489,10 +495,11 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -507,7 +514,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -536,12 +543,13 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -556,10 +564,11 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -574,10 +583,11 @@ Defaults to `true`. optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. #### Inherited from @@ -592,12 +602,13 @@ Defaults to `false`. optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult.md index 1bab3233ec9..c3e8b022cdb 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1027](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1027) +Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1029](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1029) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) +Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) +Defined in: [packages/query-core/src/types.ts:1042](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1042) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) +Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index 58310e1af49..e62579744ba 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) +Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) +Defined in: [packages/query-core/src/types.ts:1133](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1133) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) +Defined in: [packages/query-core/src/types.ts:1128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1128) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) +Defined in: [packages/query-core/src/types.ts:1129](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1129) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) +Defined in: [packages/query-core/src/types.ts:1132](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1132) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) +Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) +Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) +Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index 22ed760c153..a67e877f083 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1094](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1094) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) +Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) +Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) +Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 732c882f86f..0b875662cbc 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) +Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) +Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) +Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) +Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/preact/reference/interfaces/InfiniteQueryPageParamsOptions.md index bfab8bfc319..afe27785edc 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryPageParamsOptions.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryPageParamsOptions title: InfiniteQueryPageParamsOptions --- -Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) +Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L347) ## Extends @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/q getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -44,7 +44,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -57,7 +57,7 @@ The result will also be used to determine the value of `hasPreviousPage`. initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/InitialPageParam.md b/docs/framework/preact/reference/interfaces/InitialPageParam.md index ffbf32ae0d6..2d42bf029a4 100644 --- a/docs/framework/preact/reference/interfaces/InitialPageParam.md +++ b/docs/framework/preact/reference/interfaces/InitialPageParam.md @@ -3,7 +3,7 @@ id: InitialPageParam title: InitialPageParam --- -Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) +Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L343) ## Extended by @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/q initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) diff --git a/docs/framework/preact/reference/interfaces/InvalidateOptions.md b/docs/framework/preact/reference/interfaces/InvalidateOptions.md index 1cd96c88165..d83ecd43ec0 100644 --- a/docs/framework/preact/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/preact/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L713) +Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/preact/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/preact/reference/interfaces/InvalidateQueryFilters.md index 35fd04b9378..36eb3f27998 100644 --- a/docs/framework/preact/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/preact/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) +Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -26,7 +26,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -42,7 +42,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -58,7 +58,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -84,7 +84,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -100,7 +100,7 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) +Defined in: [packages/query-core/src/types.ts:717](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L717) Controls which of the matched (now-invalidated) queries are refetched in the background. Defaults to `'active'`. @@ -117,7 +117,7 @@ Defaults to `'active'`. optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -133,10 +133,12 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries +Defaults to `'all'`. + #### Inherited from [`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/preact/reference/interfaces/MutateOptions.md b/docs/framework/preact/reference/interfaces/MutateOptions.md index 6e27e4e6d29..b12b3b29ec2 100644 --- a/docs/framework/preact/reference/interfaces/MutateOptions.md +++ b/docs/framework/preact/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1247) +Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1282) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1235](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1235) +Defined in: [packages/query-core/src/types.ts:1270](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1270) #### Parameters diff --git a/docs/framework/preact/reference/interfaces/MutationFilters.md b/docs/framework/preact/reference/interfaces/MutationFilters.md index 378a411bfe5..fbc0208e8e1 100644 --- a/docs/framework/preact/reference/interfaces/MutationFilters.md +++ b/docs/framework/preact/reference/interfaces/MutationFilters.md @@ -3,7 +3,7 @@ id: MutationFilters title: MutationFilters --- -Defined in: [packages/query-core/src/utils.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L62) +Defined in: [packages/query-core/src/utils.ts:64](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L64) Filters used to select mutations, for example in `mutationCache.findAll` or `queryClient.isMutating`. All provided filters must match; filters that are left unspecified are ignored. @@ -34,7 +34,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L71) +Defined in: [packages/query-core/src/utils.ts:73](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L73) Match mutation key exactly @@ -46,7 +46,7 @@ Match mutation key exactly optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/utils.ts:81](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L81) +Defined in: [packages/query-core/src/utils.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L83) Include mutations matching this mutation key @@ -58,7 +58,7 @@ Include mutations matching this mutation key optional predicate: (mutation) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L75) +Defined in: [packages/query-core/src/utils.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L77) Include mutations matching this predicate function @@ -80,6 +80,6 @@ Include mutations matching this predicate function optional status: MutationStatus; ``` -Defined in: [packages/query-core/src/utils.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L85) +Defined in: [packages/query-core/src/utils.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L87) Filter by mutation status diff --git a/docs/framework/preact/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/preact/reference/interfaces/MutationObserverBaseResult.md index 190d4d4d3b6..e1c09a56737 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) +Defined in: [packages/query-core/src/types.ts:1315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1315) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1289) +Defined in: [packages/query-core/src/types.ts:1324](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1324) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1298) +Defined in: [packages/query-core/src/types.ts:1333](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1333) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1303) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1308) +Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1313](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1313) +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1318](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1318) +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1327](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1327) +Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1293](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1293) +Defined in: [packages/query-core/src/types.ts:1328](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1328) The variables object passed to the `mutationFn`. diff --git a/docs/framework/preact/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/preact/reference/interfaces/MutationObserverErrorResult.md index 03af3a33d12..cce591e3465 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) +Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1399](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1399) +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) +Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1402) +Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1403](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1403) +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1404) +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1405](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1405) +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) +Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) The variables object passed to the `mutationFn`. diff --git a/docs/framework/preact/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/preact/reference/interfaces/MutationObserverIdleResult.md index 833db327a04..b7892846a6c 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) +Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1356](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1356) +Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1359](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1359) +Defined in: [packages/query-core/src/types.ts:1394](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1394) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1360) +Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1361) +Defined in: [packages/query-core/src/types.ts:1396](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1396) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) +Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1357](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1357) +Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) The variables object passed to the `mutationFn`. diff --git a/docs/framework/preact/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/preact/reference/interfaces/MutationObserverLoadingResult.md index 6732628f444..d4368822213 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) +Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1379](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1379) +Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) +Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1381](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1381) +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) +Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1383](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1383) +Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1384](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1384) +Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1378](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1378) +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) The variables object passed to the `mutationFn`. diff --git a/docs/framework/preact/reference/interfaces/MutationObserverOptions.md b/docs/framework/preact/reference/interfaces/MutationObserverOptions.md index be502d19332..1e609be9bf1 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1220) +Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1255) ## Extends @@ -35,7 +35,12 @@ Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) + +The time in milliseconds that an unused/inactive mutation remains in memory before it is +garbage collected. + +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. #### Inherited from @@ -49,7 +54,7 @@ Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) #### Inherited from @@ -63,7 +68,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) #### Inherited from @@ -77,7 +82,7 @@ Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Inherited from @@ -91,7 +96,13 @@ Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. #### Inherited from @@ -105,7 +116,7 @@ Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -141,7 +152,7 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) #### Parameters @@ -169,7 +180,7 @@ Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) #### Parameters @@ -209,7 +220,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) +Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) #### Parameters @@ -245,7 +256,14 @@ Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) + +If `false`, failed mutations will not retry by default. +If `true`, failed mutations will retry infinitely. +If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. +If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + +Defaults to `0`. #### Inherited from @@ -259,7 +277,12 @@ Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/ optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) +Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +Defaults to a function that applies exponential backoff, capped at 30 seconds. #### Inherited from @@ -273,7 +296,7 @@ Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/ optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) +Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) #### Inherited from @@ -287,4 +310,4 @@ Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) +Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) diff --git a/docs/framework/preact/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/preact/reference/interfaces/MutationObserverSuccessResult.md index 89e8c2739cc..52cdcc4883e 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) +Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1420](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1420) +Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) +Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1423](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1423) +Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1424](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1424) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1425) +Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1426](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1426) +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) +Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) The variables object passed to the `mutationFn`. diff --git a/docs/framework/preact/reference/interfaces/MutationOptions.md b/docs/framework/preact/reference/interfaces/MutationOptions.md index 8721b62d099..49f2b8f4f19 100644 --- a/docs/framework/preact/reference/interfaces/MutationOptions.md +++ b/docs/framework/preact/reference/interfaces/MutationOptions.md @@ -3,7 +3,7 @@ id: MutationOptions title: MutationOptions --- -Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) ## Extended by @@ -35,7 +35,12 @@ Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) + +The time in milliseconds that an unused/inactive mutation remains in memory before it is +garbage collected. + +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. *** @@ -45,7 +50,7 @@ Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) *** @@ -55,7 +60,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) *** @@ -65,7 +70,7 @@ Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) *** @@ -75,7 +80,13 @@ Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. *** @@ -85,7 +96,7 @@ Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -117,7 +128,7 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) #### Parameters @@ -141,7 +152,7 @@ Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) #### Parameters @@ -177,7 +188,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) +Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) #### Parameters @@ -209,7 +220,14 @@ Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) + +If `false`, failed mutations will not retry by default. +If `true`, failed mutations will retry infinitely. +If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. +If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + +Defaults to `0`. *** @@ -219,7 +237,12 @@ Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/ optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) +Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +Defaults to a function that applies exponential backoff, capped at 30 seconds. *** @@ -229,4 +252,4 @@ Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/ optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) +Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) diff --git a/docs/framework/preact/reference/interfaces/NotifyEvent.md b/docs/framework/preact/reference/interfaces/NotifyEvent.md index 17b3241654f..5e7875d41b8 100644 --- a/docs/framework/preact/reference/interfaces/NotifyEvent.md +++ b/docs/framework/preact/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) +Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1519) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1485) +Defined in: [packages/query-core/src/types.ts:1520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1520) diff --git a/docs/framework/preact/reference/interfaces/QueriesObserverOptions.md b/docs/framework/preact/reference/interfaces/QueriesObserverOptions.md index 16035c45714..68e7913885d 100644 --- a/docs/framework/preact/reference/interfaces/QueriesObserverOptions.md +++ b/docs/framework/preact/reference/interfaces/QueriesObserverOptions.md @@ -19,9 +19,11 @@ Defined in: [packages/query-core/src/queriesObserver.ts:23](https://github.com/T optional combine: CombineFn; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L32) +Defined in: [packages/query-core/src/queriesObserver.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L34) A function that combines the array of `QueryObserverResult`s (one per observed query) into a single value. The combined value is memoized and only recomputed when one of the underlying results, the query hashes, or the `combine` function itself changes. + +Defaults to returning the array of `QueryObserverResult`s unchanged. diff --git a/docs/framework/preact/reference/interfaces/QueryClientConfig.md b/docs/framework/preact/reference/interfaces/QueryClientConfig.md index b04dadba88c..411eb0b2fb2 100644 --- a/docs/framework/preact/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/preact/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/ optional defaultOptions: DefaultOptions; ``` -Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) Default options for all queries and mutations created through this client. @@ -25,7 +25,7 @@ Default options for all queries and mutations created through this client. optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1447](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1447) +Defined in: [packages/query-core/src/types.ts:1482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1482) The mutation cache this client is connected to. A new `MutationCache` is created if not provided. @@ -38,6 +38,6 @@ provided. optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) +Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/preact/reference/interfaces/QueryExecuteOptions.md b/docs/framework/preact/reference/interfaces/QueryExecuteOptions.md index 5a055675308..1e844c5ba10 100644 --- a/docs/framework/preact/reference/interfaces/QueryExecuteOptions.md +++ b/docs/framework/preact/reference/interfaces/QueryExecuteOptions.md @@ -3,7 +3,7 @@ id: QueryExecuteOptions title: QueryExecuteOptions --- -Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L555) +Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) ## Extends @@ -43,7 +43,7 @@ Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -70,7 +70,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -93,7 +93,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -111,7 +111,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) +Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L577) *** @@ -121,7 +121,7 @@ Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -139,7 +139,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -158,7 +158,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -180,7 +180,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -201,7 +201,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -223,7 +223,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -242,7 +242,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -265,7 +265,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -283,12 +283,13 @@ WithRequired.queryKeyHashFn optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -305,7 +306,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -329,7 +330,7 @@ WithRequired.retryDelay optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L567) +Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L578) #### Parameters @@ -349,7 +350,7 @@ Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:572](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L572) +Defined in: [packages/query-core/src/types.ts:583](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L583) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -362,10 +363,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/QueryFilters.md b/docs/framework/preact/reference/interfaces/QueryFilters.md index 6b177d93aa5..749e4283d0d 100644 --- a/docs/framework/preact/reference/interfaces/QueryFilters.md +++ b/docs/framework/preact/reference/interfaces/QueryFilters.md @@ -27,7 +27,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -39,7 +39,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -51,7 +51,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -73,7 +73,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -85,7 +85,7 @@ Include queries matching this query key optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -97,6 +97,8 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries + +Defaults to `'all'`. diff --git a/docs/framework/preact/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/preact/reference/interfaces/QueryObserverBaseResult.md index 4689d9d661a..1b54d6f8041 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L743) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) +Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) +Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) +Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) +Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) +Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/preact/reference/interfaces/QueryObserverLoadingErrorResult.md index 86ae34b80ab..7a4f855305f 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) +Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) +Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/preact/reference/interfaces/QueryObserverLoadingResult.md index a0024077883..8f94574bcca 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) +Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) +Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverOptions.md b/docs/framework/preact/reference/interfaces/QueryObserverOptions.md index 6d3cf82607b..77849c1a546 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverOptions.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverOptions.md @@ -3,7 +3,7 @@ id: QueryObserverOptions title: QueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L373) +Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L375) ## Extends @@ -48,11 +48,12 @@ Defined in: [packages/query-core/src/types.ts:373](https://github.com/TanStack/q optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. *** @@ -63,7 +64,7 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -90,7 +91,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -113,7 +114,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -131,7 +132,7 @@ WithRequired.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -149,7 +150,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -168,7 +169,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -190,7 +191,7 @@ WithRequired.networkMode optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -206,7 +207,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -227,7 +228,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -241,7 +242,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -263,7 +264,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -282,7 +283,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -305,7 +306,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -323,10 +324,11 @@ WithRequired.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. *** @@ -337,7 +339,7 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -350,12 +352,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. *** @@ -366,12 +369,13 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. *** @@ -382,12 +386,13 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. *** @@ -398,12 +403,13 @@ Defaults to `true`. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -420,7 +426,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -444,10 +450,11 @@ WithRequired.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. *** @@ -458,7 +465,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -483,12 +490,13 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. *** @@ -499,10 +507,11 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -519,10 +528,11 @@ WithRequired.structuralSharing optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. *** @@ -533,10 +543,11 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. diff --git a/docs/framework/preact/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/preact/reference/interfaces/QueryObserverPendingResult.md index 21fab248a7c..41a101c7c8c 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:875](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L875) +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:876](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L876) +Defined in: [packages/query-core/src/types.ts:887](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L887) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) +Defined in: [packages/query-core/src/types.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L888) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) +Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/preact/reference/interfaces/QueryObserverPlaceholderResult.md index 89af2502c11..cce7cffcc9b 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) +Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) +Defined in: [packages/query-core/src/types.ts:969](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L969) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) +Defined in: [packages/query-core/src/types.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L970) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) +Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) +Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) +Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) +Defined in: [packages/query-core/src/types.ts:972](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L972) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/preact/reference/interfaces/QueryObserverRefetchErrorResult.md index dab5586fdc1..8486e8cf4cb 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) +Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) +Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/preact/reference/interfaces/QueryObserverSuccessResult.md index b180b89ca62..f126bea0f70 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) +Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) +Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) +Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) +Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryOptions.md b/docs/framework/preact/reference/interfaces/QueryOptions.md index ba603a4332f..bb82dd0f56a 100644 --- a/docs/framework/preact/reference/interfaces/QueryOptions.md +++ b/docs/framework/preact/reference/interfaces/QueryOptions.md @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:231](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -56,7 +56,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -73,7 +73,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -85,7 +85,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -97,7 +97,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -110,7 +110,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -126,7 +126,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -141,7 +141,7 @@ optional queryFn: | typeof skipToken; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -157,7 +157,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -170,7 +170,7 @@ as the actual cache key internally. optional queryKey: TQueryKey; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -187,7 +187,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -199,12 +199,13 @@ If specified, this function is used to hash the `queryKey` to a string. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. *** @@ -215,7 +216,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -233,8 +234,9 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. diff --git a/docs/framework/preact/reference/interfaces/RefetchOptions.md b/docs/framework/preact/reference/interfaces/RefetchOptions.md index b502dcd3492..104412c5bac 100644 --- a/docs/framework/preact/reference/interfaces/RefetchOptions.md +++ b/docs/framework/preact/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L684) +Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,7 +38,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/preact/reference/interfaces/RefetchQueryFilters.md b/docs/framework/preact/reference/interfaces/RefetchQueryFilters.md index 84f917c6201..bde28360fa1 100644 --- a/docs/framework/preact/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/preact/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:709](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L709) +Defined in: [packages/query-core/src/types.ts:720](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L720) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -26,7 +26,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -42,7 +42,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -58,7 +58,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -84,7 +84,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -100,7 +100,7 @@ Include queries matching this query key optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -116,10 +116,12 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries +Defaults to `'all'`. + #### Inherited from [`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/preact/reference/interfaces/ResetOptions.md b/docs/framework/preact/reference/interfaces/ResetOptions.md index 1855fef3064..6d3a8398fbb 100644 --- a/docs/framework/preact/reference/interfaces/ResetOptions.md +++ b/docs/framework/preact/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L714) +Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/preact/reference/interfaces/ResultOptions.md b/docs/framework/preact/reference/interfaces/ResultOptions.md index 9766c56d1a6..f3da151a3ec 100644 --- a/docs/framework/preact/reference/interfaces/ResultOptions.md +++ b/docs/framework/preact/reference/interfaces/ResultOptions.md @@ -3,7 +3,7 @@ id: ResultOptions title: ResultOptions --- -Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) +Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L686) ## Extended by @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/preact/reference/interfaces/SetDataOptions.md b/docs/framework/preact/reference/interfaces/SetDataOptions.md index 4262e781b05..cac83e9312a 100644 --- a/docs/framework/preact/reference/interfaces/SetDataOptions.md +++ b/docs/framework/preact/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1471) +Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1506) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1472](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1472) +Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) diff --git a/docs/framework/preact/reference/interfaces/UseBaseQueryOptions.md b/docs/framework/preact/reference/interfaces/UseBaseQueryOptions.md index f9e68ee7510..c459d58b581 100644 --- a/docs/framework/preact/reference/interfaces/UseBaseQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/UseBaseQueryOptions.md @@ -54,11 +54,12 @@ The type of your `queryKey`. optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -73,7 +74,7 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -98,7 +99,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -119,7 +120,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -135,7 +136,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -151,7 +152,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -168,7 +169,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -188,7 +189,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -208,7 +209,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -271,7 +272,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -289,7 +290,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -309,7 +310,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -326,7 +327,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -347,7 +348,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -363,10 +364,11 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -381,7 +383,7 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -398,12 +400,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -418,12 +421,13 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -438,12 +442,13 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -458,12 +463,13 @@ Defaults to `true`. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -478,7 +484,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -500,10 +506,11 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -518,7 +525,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -547,12 +554,13 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -567,10 +575,11 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -603,10 +612,11 @@ true optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. #### Inherited from @@ -621,12 +631,13 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/UseInfiniteQueryOptions.md b/docs/framework/preact/reference/interfaces/UseInfiniteQueryOptions.md index 42ff42bbdc5..be3fe9609bf 100644 --- a/docs/framework/preact/reference/interfaces/UseInfiniteQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/UseInfiniteQueryOptions.md @@ -54,11 +54,12 @@ The type of the parameter passed to `queryFn` to fetch a given page. optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -75,7 +76,7 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -98,7 +99,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -117,7 +118,7 @@ OmitKeyof.getNextPageParam optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -138,7 +139,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -161,7 +162,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -179,7 +180,7 @@ OmitKeyof.initialDataUpdatedAt initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from @@ -195,7 +196,7 @@ OmitKeyof.initialPageParam optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -211,7 +212,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -228,7 +229,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -248,7 +249,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -268,7 +269,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -289,7 +290,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -309,7 +310,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -331,7 +332,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -348,7 +349,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -371,7 +372,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -389,10 +390,11 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -409,7 +411,7 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -426,12 +428,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -448,12 +451,13 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -470,12 +474,13 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -492,12 +497,13 @@ OmitKeyof.refetchOnWindowFocus optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -514,7 +520,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -538,10 +544,11 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -558,7 +565,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -589,12 +596,13 @@ OmitKeyof.select optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -611,10 +619,11 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -649,12 +658,13 @@ true optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/UseMutationOptions.md b/docs/framework/preact/reference/interfaces/UseMutationOptions.md index 247d3411401..fce42d39801 100644 --- a/docs/framework/preact/reference/interfaces/UseMutationOptions.md +++ b/docs/framework/preact/reference/interfaces/UseMutationOptions.md @@ -47,7 +47,12 @@ their `onMutateResult` parameter — useful for optimistic-update rollback data. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) + +The time in milliseconds that an unused/inactive mutation remains in memory before it is +garbage collected. + +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. #### Inherited from @@ -61,7 +66,7 @@ Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) #### Inherited from @@ -75,7 +80,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) #### Inherited from @@ -91,7 +96,7 @@ OmitKeyof.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Inherited from @@ -105,7 +110,13 @@ Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. #### Inherited from @@ -119,7 +130,7 @@ Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -157,7 +168,7 @@ OmitKeyof.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) #### Parameters @@ -187,7 +198,7 @@ OmitKeyof.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) #### Parameters @@ -229,7 +240,7 @@ OmitKeyof.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) +Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) #### Parameters @@ -267,7 +278,14 @@ OmitKeyof.onSuccess optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) + +If `false`, failed mutations will not retry by default. +If `true`, failed mutations will retry infinitely. +If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. +If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + +Defaults to `0`. #### Inherited from @@ -283,7 +301,12 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) +Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +Defaults to a function that applies exponential backoff, capped at 30 seconds. #### Inherited from @@ -299,7 +322,7 @@ OmitKeyof.retryDelay optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) +Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) #### Inherited from @@ -313,7 +336,7 @@ Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) +Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/UseQueryOptions.md b/docs/framework/preact/reference/interfaces/UseQueryOptions.md index b200cf05d99..dc451fd6dae 100644 --- a/docs/framework/preact/reference/interfaces/UseQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/UseQueryOptions.md @@ -47,11 +47,12 @@ The type of your `queryKey`. optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -68,7 +69,7 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -93,7 +94,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -116,7 +117,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -134,7 +135,7 @@ OmitKeyof.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -150,7 +151,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -167,7 +168,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -187,7 +188,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -207,7 +208,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -272,7 +273,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -292,7 +293,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -314,7 +315,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -331,7 +332,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -354,7 +355,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -372,10 +373,11 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -392,7 +394,7 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -409,12 +411,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -431,12 +434,13 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -453,12 +457,13 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -475,12 +480,13 @@ OmitKeyof.refetchOnWindowFocus optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -497,7 +503,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -521,10 +527,11 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -541,7 +548,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -572,12 +579,13 @@ OmitKeyof.select optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -594,10 +602,11 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -638,12 +647,13 @@ OmitKeyof.subscribed optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/UseSuspenseInfiniteQueryOptions.md b/docs/framework/preact/reference/interfaces/UseSuspenseInfiniteQueryOptions.md index 51692370924..aec0a45c130 100644 --- a/docs/framework/preact/reference/interfaces/UseSuspenseInfiniteQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/UseSuspenseInfiniteQueryOptions.md @@ -54,7 +54,7 @@ The type of the parameter passed to `queryFn` to fetch a given page. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -77,7 +77,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -96,7 +96,7 @@ OmitKeyof.getNextPageParam optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -117,7 +117,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -140,7 +140,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -158,7 +158,7 @@ OmitKeyof.initialDataUpdatedAt initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from @@ -174,7 +174,7 @@ OmitKeyof.initialPageParam optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -190,7 +190,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -207,7 +207,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -227,7 +227,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -247,7 +247,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -279,7 +279,7 @@ must always be provided, unless a default query function has been defined. optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -296,7 +296,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -319,7 +319,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -337,10 +337,11 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -357,7 +358,7 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -374,12 +375,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -396,12 +398,13 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -418,12 +421,13 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -440,12 +444,13 @@ OmitKeyof.refetchOnWindowFocus optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -462,7 +467,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -486,10 +491,11 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -506,7 +512,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -537,12 +543,13 @@ OmitKeyof.select optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -559,10 +566,11 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/UseSuspenseQueryOptions.md b/docs/framework/preact/reference/interfaces/UseSuspenseQueryOptions.md index bbe163863e6..06f31822e13 100644 --- a/docs/framework/preact/reference/interfaces/UseSuspenseQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/UseSuspenseQueryOptions.md @@ -48,7 +48,7 @@ The type of your `queryKey`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -73,7 +73,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -96,7 +96,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -114,7 +114,7 @@ OmitKeyof.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -130,7 +130,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -147,7 +147,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -167,7 +167,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -187,7 +187,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -263,7 +263,7 @@ must always be provided, unless a default query function has been defined. optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -280,7 +280,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -303,7 +303,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -321,10 +321,11 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -341,7 +342,7 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -358,12 +359,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -380,12 +382,13 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -402,12 +405,13 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -424,12 +428,13 @@ OmitKeyof.refetchOnWindowFocus optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -446,7 +451,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -470,10 +475,11 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -490,7 +496,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -521,12 +527,13 @@ OmitKeyof.select optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -543,10 +550,11 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/preact/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/preact/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md index 733a1a5ad75..4412ad00c8e 100644 --- a/docs/framework/preact/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md +++ b/docs/framework/preact/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedInfiniteQueryObserverOptions type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:538](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L538) +Defined in: [packages/query-core/src/types.ts:549](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L549) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/preact/reference/type-aliases/DefaultedQueryObserverOptions.md index 1b4309f150c..9ce8401b128 100644 --- a/docs/framework/preact/reference/type-aliases/DefaultedQueryObserverOptions.md +++ b/docs/framework/preact/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedQueryObserverOptions type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L509) +Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index d82cfa37d51..cec33b142b7 100644 --- a/docs/framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) +Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/preact/reference/type-aliases/DefinedQueryObserverResult.md index 97fcae175a9..b4480af3810 100644 --- a/docs/framework/preact/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/preact/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) +Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/preact/reference/type-aliases/EnsureInfiniteQueryDataOptions.md index 305eef94893..ff75b1c3449 100644 --- a/docs/framework/preact/reference/type-aliases/EnsureInfiniteQueryDataOptions.md +++ b/docs/framework/preact/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -7,7 +7,7 @@ title: EnsureInfiniteQueryDataOptions type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; ``` -Defined in: [packages/query-core/src/types.ts:612](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L612) +Defined in: [packages/query-core/src/types.ts:623](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L623) ## Type Declaration diff --git a/docs/framework/preact/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/preact/reference/type-aliases/FetchInfiniteQueryOptions.md index 1ee1470b14a..c926bbd3ae5 100644 --- a/docs/framework/preact/reference/type-aliases/FetchInfiniteQueryOptions.md +++ b/docs/framework/preact/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: FetchInfiniteQueryOptions type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L656) +Defined in: [packages/query-core/src/types.ts:667](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L667) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/FetchStatus.md b/docs/framework/preact/reference/type-aliases/FetchStatus.md index 7b71e54eacd..b347069e97e 100644 --- a/docs/framework/preact/reference/type-aliases/FetchStatus.md +++ b/docs/framework/preact/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:752](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L752) diff --git a/docs/framework/preact/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/preact/reference/type-aliases/InfiniteQueryExecuteOptions.md index 29c974cfddf..c198662a319 100644 --- a/docs/framework/preact/reference/type-aliases/InfiniteQueryExecuteOptions.md +++ b/docs/framework/preact/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -7,7 +7,7 @@ title: InfiniteQueryExecuteOptions type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:635](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L635) +Defined in: [packages/query-core/src/types.ts:646](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L646) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/preact/reference/type-aliases/InfiniteQueryObserverResult.md index 7a646bc1c38..42279b19c00 100644 --- a/docs/framework/preact/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/preact/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) +Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/MutateFunction.md b/docs/framework/preact/reference/type-aliases/MutateFunction.md index 284bd0fc270..558040d3439 100644 --- a/docs/framework/preact/reference/type-aliases/MutateFunction.md +++ b/docs/framework/preact/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1271) +Defined in: [packages/query-core/src/types.ts:1306](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1306) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/MutateFunctionRest.md b/docs/framework/preact/reference/type-aliases/MutateFunctionRest.md index a2f16ea5302..3e7a5217482 100644 --- a/docs/framework/preact/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/preact/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1256) +Defined in: [packages/query-core/src/types.ts:1291](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1291) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/MutationFunction.md b/docs/framework/preact/reference/type-aliases/MutationFunction.md index 4c8c7aed384..330af1ef65a 100644 --- a/docs/framework/preact/reference/type-aliases/MutationFunction.md +++ b/docs/framework/preact/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/MutationFunctionContext.md b/docs/framework/preact/reference/type-aliases/MutationFunctionContext.md index ef228cc53d3..97de2f1c220 100644 --- a/docs/framework/preact/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/preact/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) +Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1169) +Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1180) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1170) +Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) +Defined in: [packages/query-core/src/types.ts:1182](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1182) diff --git a/docs/framework/preact/reference/type-aliases/MutationKey.md b/docs/framework/preact/reference/type-aliases/MutationKey.md index 7157d6052fd..8e9d3bc3b3a 100644 --- a/docs/framework/preact/reference/type-aliases/MutationKey.md +++ b/docs/framework/preact/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) diff --git a/docs/framework/preact/reference/type-aliases/MutationMeta.md b/docs/framework/preact/reference/type-aliases/MutationMeta.md index f3bf9984fab..474c593e206 100644 --- a/docs/framework/preact/reference/type-aliases/MutationMeta.md +++ b/docs/framework/preact/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1160](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1160) +Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) diff --git a/docs/framework/preact/reference/type-aliases/MutationObserverResult.md b/docs/framework/preact/reference/type-aliases/MutationObserverResult.md index 3390192e071..21e43836bf6 100644 --- a/docs/framework/preact/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/preact/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) +Defined in: [packages/query-core/src/types.ts:1464](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1464) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/MutationScope.md b/docs/framework/preact/reference/type-aliases/MutationScope.md index a2511c903d9..feac9d9d17a 100644 --- a/docs/framework/preact/reference/type-aliases/MutationScope.md +++ b/docs/framework/preact/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) +Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1167) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) +Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) diff --git a/docs/framework/preact/reference/type-aliases/MutationStatus.md b/docs/framework/preact/reference/type-aliases/MutationStatus.md index d9b58cdd26f..4cd2d3c9535 100644 --- a/docs/framework/preact/reference/type-aliases/MutationStatus.md +++ b/docs/framework/preact/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1154](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1154) +Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) diff --git a/docs/framework/preact/reference/type-aliases/NotifyEventType.md b/docs/framework/preact/reference/type-aliases/NotifyEventType.md index 94912df6c6b..9bbc85e4ce8 100644 --- a/docs/framework/preact/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/preact/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) +Defined in: [packages/query-core/src/types.ts:1510](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1510) diff --git a/docs/framework/preact/reference/type-aliases/QueryObserverResult.md b/docs/framework/preact/reference/type-aliases/QueryObserverResult.md index f5c6c95d5f2..4fc661a6c9d 100644 --- a/docs/framework/preact/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/preact/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) +Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/QueryStatus.md b/docs/framework/preact/reference/type-aliases/QueryStatus.md index 3fc872e604b..6679b8b17c6 100644 --- a/docs/framework/preact/reference/type-aliases/QueryStatus.md +++ b/docs/framework/preact/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:740](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L740) +Defined in: [packages/query-core/src/types.ts:751](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L751) diff --git a/docs/framework/preact/reference/type-aliases/SkipToken.md b/docs/framework/preact/reference/type-aliases/SkipToken.md index 176c23830d2..3a5791b982e 100644 --- a/docs/framework/preact/reference/type-aliases/SkipToken.md +++ b/docs/framework/preact/reference/type-aliases/SkipToken.md @@ -7,6 +7,6 @@ title: SkipToken type SkipToken = typeof skipToken; ``` -Defined in: [packages/query-core/src/utils.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L524) +Defined in: [packages/query-core/src/utils.ts:526](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L526) The type of the [skipToken](../variables/skipToken.md) sentinel value. diff --git a/docs/framework/preact/reference/type-aliases/ThrowOnError.md b/docs/framework/preact/reference/type-aliases/ThrowOnError.md index 60ad44c1cd1..613549e4d52 100644 --- a/docs/framework/preact/reference/type-aliases/ThrowOnError.md +++ b/docs/framework/preact/reference/type-aliases/ThrowOnError.md @@ -7,7 +7,7 @@ title: ThrowOnError type ThrowOnError = boolean | (error, query) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L361) +Defined in: [packages/query-core/src/types.ts:363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L363) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/Updater.md b/docs/framework/preact/reference/type-aliases/Updater.md index b6a29ccc5fc..7a0c2f30503 100644 --- a/docs/framework/preact/reference/type-aliases/Updater.md +++ b/docs/framework/preact/reference/type-aliases/Updater.md @@ -7,7 +7,7 @@ title: Updater type Updater = TOutput | (input) => TOutput; ``` -Defined in: [packages/query-core/src/utils.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L103) +Defined in: [packages/query-core/src/utils.ts:105](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L105) Either a plain value of type `TOutput`, or a function that receives `TInput` and returns `TOutput`. Used for example by `setQueryData`-style updaters, which accept either the new data directly or a diff --git a/docs/framework/preact/reference/type-aliases/WithRequired.md b/docs/framework/preact/reference/type-aliases/WithRequired.md index c8ef831db3c..deb87dfe4a4 100644 --- a/docs/framework/preact/reference/type-aliases/WithRequired.md +++ b/docs/framework/preact/reference/type-aliases/WithRequired.md @@ -7,7 +7,7 @@ title: WithRequired type WithRequired = TTarget & { [_ in TKey]: {} }; ``` -Defined in: [packages/query-core/src/types.ts:505](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L505) +Defined in: [packages/query-core/src/types.ts:516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L516) ## Type Parameters diff --git a/docs/framework/preact/reference/variables/isServer.md b/docs/framework/preact/reference/variables/isServer.md index 28956d55cbf..16aa39d1244 100644 --- a/docs/framework/preact/reference/variables/isServer.md +++ b/docs/framework/preact/reference/variables/isServer.md @@ -7,7 +7,7 @@ title: isServer const isServer: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L112) +Defined in: [packages/query-core/src/utils.ts:114](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L114) ## Deprecated diff --git a/docs/framework/preact/reference/variables/skipToken.md b/docs/framework/preact/reference/variables/skipToken.md index 3163e91c1c2..a390d0b7b66 100644 --- a/docs/framework/preact/reference/variables/skipToken.md +++ b/docs/framework/preact/reference/variables/skipToken.md @@ -7,7 +7,7 @@ title: skipToken const skipToken: typeof skipToken; ``` -Defined in: [packages/query-core/src/utils.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L520) +Defined in: [packages/query-core/src/utils.ts:522](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L522) Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`, diff --git a/docs/framework/react/reference/classes/QueriesObserver.md b/docs/framework/react/reference/classes/QueriesObserver.md index 80067b16446..4f07d3b3382 100644 --- a/docs/framework/react/reference/classes/QueriesObserver.md +++ b/docs/framework/react/reference/classes/QueriesObserver.md @@ -6,7 +6,7 @@ redirect_from: - framework/react/reference/QueriesObserver --- -Defined in: [packages/query-core/src/queriesObserver.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L54) +Defined in: [packages/query-core/src/queriesObserver.ts:56](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L56) A `QueriesObserver` watches an array of queries at once, exposing them as a single array of `QueryObserverResult`s (or, when a `combine` option is @@ -48,7 +48,7 @@ new QueriesObserver( options?): QueriesObserver; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L68) +Defined in: [packages/query-core/src/queriesObserver.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L70) #### Parameters @@ -98,7 +98,7 @@ Subscribable.listeners destroy(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L104) +Defined in: [packages/query-core/src/queriesObserver.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L106) Stops observing all queries: clears all listeners and destroys every underlying `QueryObserver` this observer manages. @@ -115,7 +115,7 @@ underlying `QueryObserver` this observer manages. getCurrentResult(): QueryObserverResult[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L208) +Defined in: [packages/query-core/src/queriesObserver.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L210) Returns the most recently computed array of `QueryObserverResult`s, one per observed query, in the same order as the queries passed to the @@ -140,7 +140,7 @@ const data = results.map((result) => result.data) getObservers(): QueryObserver[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L225) +Defined in: [packages/query-core/src/queriesObserver.ts:227](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L227) Returns the underlying `QueryObserver` instances this observer manages, in the same order as the queries passed to the constructor or @@ -158,7 +158,7 @@ in the same order as the queries passed to the constructor or getOptimisticResult(queries, combine): [QueryObserverResult[], (r?) => TCombinedResult, () => QueryObserverResult[]]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L236) +Defined in: [packages/query-core/src/queriesObserver.ts:238](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L238) The `QueriesObserver` counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult) — computes the result for the given (already-defaulted) queries right now, synchronously. Called by @@ -188,7 +188,7 @@ wrap the results for property-access tracking. getQueries(): Query[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:216](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L216) +Defined in: [packages/query-core/src/queriesObserver.ts:218](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L218) Returns the underlying `Query` instances currently being observed, in the same order as the queries passed to the constructor or `setQueries`. @@ -225,7 +225,7 @@ Subscribable.hasListeners protected onSubscribe(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L84) +Defined in: [packages/query-core/src/queriesObserver.ts:86](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L86) #### Returns @@ -245,7 +245,7 @@ Subscribable.onSubscribe protected onUnsubscribe(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L94) +Defined in: [packages/query-core/src/queriesObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L96) #### Returns @@ -265,7 +265,7 @@ Subscribable.onUnsubscribe setQueries(queries, options?): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:125](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L125) +Defined in: [packages/query-core/src/queriesObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L127) Replaces the set of queries being observed. Existing `QueryObserver`s are reused for queries that match an already-observed query hash; diff --git a/docs/framework/react/reference/functions/hashKey.md b/docs/framework/react/reference/functions/hashKey.md index 9e7844aa09d..dc774c032ce 100644 --- a/docs/framework/react/reference/functions/hashKey.md +++ b/docs/framework/react/reference/functions/hashKey.md @@ -7,7 +7,7 @@ title: hashKey function hashKey(queryKey): string; ``` -Defined in: [packages/query-core/src/utils.ts:282](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L282) +Defined in: [packages/query-core/src/utils.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L284) Default query & mutation keys hash function. Hashes the value into a stable hash. diff --git a/docs/framework/react/reference/functions/keepPreviousData.md b/docs/framework/react/reference/functions/keepPreviousData.md index d41c7d7c726..6a84f4c5970 100644 --- a/docs/framework/react/reference/functions/keepPreviousData.md +++ b/docs/framework/react/reference/functions/keepPreviousData.md @@ -7,7 +7,7 @@ title: keepPreviousData function keepPreviousData(previousData): T | undefined; ``` -Defined in: [packages/query-core/src/utils.ts:491](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L491) +Defined in: [packages/query-core/src/utils.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L493) Intended to be passed as a query's `placeholderData` option, for example `placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new diff --git a/docs/framework/react/reference/functions/matchMutation.md b/docs/framework/react/reference/functions/matchMutation.md index 79468dcfad9..40210da4cf1 100644 --- a/docs/framework/react/reference/functions/matchMutation.md +++ b/docs/framework/react/reference/functions/matchMutation.md @@ -7,7 +7,7 @@ title: matchMutation function matchMutation(filters, mutation): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:235](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L235) +Defined in: [packages/query-core/src/utils.ts:237](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L237) Checks whether a mutation matches the given [MutationFilters](../interfaces/MutationFilters.md). Every filter that is specified must match; filters that are left unspecified are ignored. diff --git a/docs/framework/react/reference/functions/matchQuery.md b/docs/framework/react/reference/functions/matchQuery.md index f98fe5f3537..4c54b2df995 100644 --- a/docs/framework/react/reference/functions/matchQuery.md +++ b/docs/framework/react/reference/functions/matchQuery.md @@ -7,7 +7,7 @@ title: matchQuery function matchQuery(filters, query): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L173) +Defined in: [packages/query-core/src/utils.ts:175](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L175) Checks whether a query matches the given [QueryFilters](../interfaces/QueryFilters.md). Every filter that is specified must match; filters that are left unspecified are ignored. diff --git a/docs/framework/react/reference/functions/noop.md b/docs/framework/react/reference/functions/noop.md index fd1b8dc2ad0..01fb409f4e9 100644 --- a/docs/framework/react/reference/functions/noop.md +++ b/docs/framework/react/reference/functions/noop.md @@ -9,7 +9,7 @@ title: noop function noop(): void; ``` -Defined in: [packages/query-core/src/utils.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L117) +Defined in: [packages/query-core/src/utils.ts:119](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L119) A function that does nothing. @@ -23,7 +23,7 @@ A function that does nothing. function noop(): undefined; ``` -Defined in: [packages/query-core/src/utils.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L118) +Defined in: [packages/query-core/src/utils.ts:120](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L120) A function that does nothing. diff --git a/docs/framework/react/reference/functions/partialMatchKey.md b/docs/framework/react/reference/functions/partialMatchKey.md index 3795de85b95..4db67323e9b 100644 --- a/docs/framework/react/reference/functions/partialMatchKey.md +++ b/docs/framework/react/reference/functions/partialMatchKey.md @@ -7,7 +7,7 @@ title: partialMatchKey function partialMatchKey(a, b): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L298) +Defined in: [packages/query-core/src/utils.ts:300](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L300) Checks if key `b` partially matches with key `a`. diff --git a/docs/framework/react/reference/functions/replaceEqualDeep.md b/docs/framework/react/reference/functions/replaceEqualDeep.md index 77a393196ef..6a81c3907fb 100644 --- a/docs/framework/react/reference/functions/replaceEqualDeep.md +++ b/docs/framework/react/reference/functions/replaceEqualDeep.md @@ -10,7 +10,7 @@ function replaceEqualDeep( depth?): T; ``` -Defined in: [packages/query-core/src/utils.ts:337](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L337) +Defined in: [packages/query-core/src/utils.ts:339](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L339) This function returns `a` if `b` is deeply equal. If not, it will replace any deeply equal children of `b` with those of `a`. diff --git a/docs/framework/react/reference/functions/shouldThrowError.md b/docs/framework/react/reference/functions/shouldThrowError.md index 3146617391e..1f1e62a8d0e 100644 --- a/docs/framework/react/reference/functions/shouldThrowError.md +++ b/docs/framework/react/reference/functions/shouldThrowError.md @@ -7,7 +7,7 @@ title: shouldThrowError function shouldThrowError(throwOnError, params): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L574) +Defined in: [packages/query-core/src/utils.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L576) Resolves a `throwOnError` option to a boolean. If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller, diff --git a/docs/framework/react/reference/interfaces/CancelOptions.md b/docs/framework/react/reference/interfaces/CancelOptions.md index 14394c18533..f52c729f3b1 100644 --- a/docs/framework/react/reference/interfaces/CancelOptions.md +++ b/docs/framework/react/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1466) +Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1501) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1467) +Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1468) +Defined in: [packages/query-core/src/types.ts:1503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1503) diff --git a/docs/framework/react/reference/interfaces/DefaultOptions.md b/docs/framework/react/reference/interfaces/DefaultOptions.md index 026116d11db..67ae012f9ee 100644 --- a/docs/framework/react/reference/interfaces/DefaultOptions.md +++ b/docs/framework/react/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) +Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1487) ## Type Parameters @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/ optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) +Defined in: [packages/query-core/src/types.ts:1498](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1498) Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). @@ -31,7 +31,7 @@ Default options used when dehydrating the client's caches; see [DehydrateOptions optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1496](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1496) Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). @@ -67,7 +67,7 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) +Defined in: [packages/query-core/src/types.ts:1494](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1494) Default options applied to every mutation, unless overridden per-mutation. @@ -79,6 +79,6 @@ Default options applied to every mutation, unless overridden per-mutation. optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) +Defined in: [packages/query-core/src/types.ts:1489](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1489) Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/react/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/react/reference/interfaces/EnsureQueryDataOptions.md index d7b4751a9d3..d71a60902e6 100644 --- a/docs/framework/react/reference/interfaces/EnsureQueryDataOptions.md +++ b/docs/framework/react/reference/interfaces/EnsureQueryDataOptions.md @@ -3,7 +3,7 @@ id: EnsureQueryDataOptions title: EnsureQueryDataOptions --- -Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) +Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L606) ## Deprecated @@ -41,7 +41,7 @@ Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -66,7 +66,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -87,7 +87,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -103,7 +103,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) +Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) #### Inherited from @@ -117,7 +117,7 @@ Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -133,7 +133,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -150,7 +150,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -170,7 +170,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -189,7 +189,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -209,7 +209,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -226,7 +226,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -247,7 +247,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -263,12 +263,13 @@ If specified, this function is used to hash the `queryKey` to a string. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -283,7 +284,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -305,7 +306,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional revalidateIfStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L608) +Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L619) *** @@ -315,7 +316,7 @@ Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) +Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -332,10 +333,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/react/reference/interfaces/FetchNextPageOptions.md b/docs/framework/react/reference/interfaces/FetchNextPageOptions.md index d12afe35fe1..2c0be977140 100644 --- a/docs/framework/react/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/react/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L716) +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) +Defined in: [packages/query-core/src/types.ts:736](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L736) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/react/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/react/reference/interfaces/FetchPreviousPageOptions.md index 93ca92088f1..683e789ee52 100644 --- a/docs/framework/react/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/react/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) +Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L739) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:748](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L748) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/react/reference/interfaces/FetchQueryOptions.md b/docs/framework/react/reference/interfaces/FetchQueryOptions.md index 3b9347e06ea..634ae0e09f9 100644 --- a/docs/framework/react/reference/interfaces/FetchQueryOptions.md +++ b/docs/framework/react/reference/interfaces/FetchQueryOptions.md @@ -3,7 +3,7 @@ id: FetchQueryOptions title: FetchQueryOptions --- -Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L576) +Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L587) ## Deprecated @@ -45,7 +45,7 @@ Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -72,7 +72,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -95,7 +95,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -113,7 +113,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) +Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) *** @@ -123,7 +123,7 @@ Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -141,7 +141,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -160,7 +160,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -182,7 +182,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -203,7 +203,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -225,7 +225,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -244,7 +244,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -267,7 +267,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -285,12 +285,13 @@ WithRequired.queryKeyHashFn optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -307,7 +308,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -331,7 +332,7 @@ WithRequired.retryDelay optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) +Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -344,10 +345,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverBaseResult.md index f1443c39625..9195e0727f8 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L991) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) +Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) +Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) +Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) +Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) +Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 7c55201c028..2841b5ab116 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) +Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) +Defined in: [packages/query-core/src/types.ts:1076](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1076) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) +Defined in: [packages/query-core/src/types.ts:1077](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1077) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) +Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult.md index f9541ebd73b..95ff84b3ef3 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) +Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) +Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) +Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) +Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverOptions.md index db1ca7f18fe..7d5b0dd1a4d 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverOptions.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverOptions title: InfiniteQueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) +Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L531) ## Extends @@ -39,11 +39,12 @@ Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/q optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -58,7 +59,7 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -81,7 +82,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -98,7 +99,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -117,7 +118,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -138,7 +139,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -154,7 +155,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from @@ -168,7 +169,7 @@ Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -184,7 +185,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -201,7 +202,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -221,7 +222,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -241,7 +242,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -260,7 +261,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -278,7 +279,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -298,7 +299,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -315,7 +316,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -336,7 +337,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -352,10 +353,11 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -370,7 +372,7 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -387,12 +389,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -407,12 +410,13 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -427,12 +431,13 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -447,12 +452,13 @@ Defaults to `true`. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -467,7 +473,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -489,10 +495,11 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -507,7 +514,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -536,12 +543,13 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -556,10 +564,11 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -574,10 +583,11 @@ Defaults to `true`. optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. #### Inherited from @@ -592,12 +602,13 @@ Defaults to `false`. optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverPendingResult.md index 1bab3233ec9..c3e8b022cdb 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1027](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1027) +Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1029](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1029) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) +Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) +Defined in: [packages/query-core/src/types.ts:1042](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1042) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) +Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index 58310e1af49..e62579744ba 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) +Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) +Defined in: [packages/query-core/src/types.ts:1133](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1133) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) +Defined in: [packages/query-core/src/types.ts:1128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1128) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) +Defined in: [packages/query-core/src/types.ts:1129](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1129) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) +Defined in: [packages/query-core/src/types.ts:1132](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1132) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) +Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) +Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) +Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index 22ed760c153..a67e877f083 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1094](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1094) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) +Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) +Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) +Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 732c882f86f..0b875662cbc 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) +Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) +Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) +Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) +Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/react/reference/interfaces/InfiniteQueryPageParamsOptions.md index bfab8bfc319..afe27785edc 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryPageParamsOptions.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryPageParamsOptions title: InfiniteQueryPageParamsOptions --- -Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) +Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L347) ## Extends @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/q getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -44,7 +44,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -57,7 +57,7 @@ The result will also be used to determine the value of `hasPreviousPage`. initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from diff --git a/docs/framework/react/reference/interfaces/InitialPageParam.md b/docs/framework/react/reference/interfaces/InitialPageParam.md index ffbf32ae0d6..2d42bf029a4 100644 --- a/docs/framework/react/reference/interfaces/InitialPageParam.md +++ b/docs/framework/react/reference/interfaces/InitialPageParam.md @@ -3,7 +3,7 @@ id: InitialPageParam title: InitialPageParam --- -Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) +Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L343) ## Extended by @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/q initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) diff --git a/docs/framework/react/reference/interfaces/InvalidateOptions.md b/docs/framework/react/reference/interfaces/InvalidateOptions.md index 1cd96c88165..d83ecd43ec0 100644 --- a/docs/framework/react/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/react/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L713) +Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/react/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/react/reference/interfaces/InvalidateQueryFilters.md index 35fd04b9378..36eb3f27998 100644 --- a/docs/framework/react/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/react/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) +Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -26,7 +26,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -42,7 +42,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -58,7 +58,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -84,7 +84,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -100,7 +100,7 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) +Defined in: [packages/query-core/src/types.ts:717](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L717) Controls which of the matched (now-invalidated) queries are refetched in the background. Defaults to `'active'`. @@ -117,7 +117,7 @@ Defaults to `'active'`. optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -133,10 +133,12 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries +Defaults to `'all'`. + #### Inherited from [`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/react/reference/interfaces/MutateOptions.md b/docs/framework/react/reference/interfaces/MutateOptions.md index 6e27e4e6d29..b12b3b29ec2 100644 --- a/docs/framework/react/reference/interfaces/MutateOptions.md +++ b/docs/framework/react/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1247) +Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1282) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1235](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1235) +Defined in: [packages/query-core/src/types.ts:1270](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1270) #### Parameters diff --git a/docs/framework/react/reference/interfaces/MutationFilters.md b/docs/framework/react/reference/interfaces/MutationFilters.md index 378a411bfe5..fbc0208e8e1 100644 --- a/docs/framework/react/reference/interfaces/MutationFilters.md +++ b/docs/framework/react/reference/interfaces/MutationFilters.md @@ -3,7 +3,7 @@ id: MutationFilters title: MutationFilters --- -Defined in: [packages/query-core/src/utils.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L62) +Defined in: [packages/query-core/src/utils.ts:64](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L64) Filters used to select mutations, for example in `mutationCache.findAll` or `queryClient.isMutating`. All provided filters must match; filters that are left unspecified are ignored. @@ -34,7 +34,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L71) +Defined in: [packages/query-core/src/utils.ts:73](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L73) Match mutation key exactly @@ -46,7 +46,7 @@ Match mutation key exactly optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/utils.ts:81](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L81) +Defined in: [packages/query-core/src/utils.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L83) Include mutations matching this mutation key @@ -58,7 +58,7 @@ Include mutations matching this mutation key optional predicate: (mutation) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L75) +Defined in: [packages/query-core/src/utils.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L77) Include mutations matching this predicate function @@ -80,6 +80,6 @@ Include mutations matching this predicate function optional status: MutationStatus; ``` -Defined in: [packages/query-core/src/utils.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L85) +Defined in: [packages/query-core/src/utils.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L87) Filter by mutation status diff --git a/docs/framework/react/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/react/reference/interfaces/MutationObserverBaseResult.md index 190d4d4d3b6..e1c09a56737 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/react/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) +Defined in: [packages/query-core/src/types.ts:1315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1315) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1289) +Defined in: [packages/query-core/src/types.ts:1324](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1324) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1298) +Defined in: [packages/query-core/src/types.ts:1333](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1333) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1303) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1308) +Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1313](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1313) +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1318](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1318) +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1327](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1327) +Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1293](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1293) +Defined in: [packages/query-core/src/types.ts:1328](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1328) The variables object passed to the `mutationFn`. diff --git a/docs/framework/react/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/react/reference/interfaces/MutationObserverErrorResult.md index 03af3a33d12..cce591e3465 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/react/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) +Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1399](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1399) +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) +Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1402) +Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1403](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1403) +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1404) +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1405](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1405) +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) +Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) The variables object passed to the `mutationFn`. diff --git a/docs/framework/react/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/react/reference/interfaces/MutationObserverIdleResult.md index 833db327a04..b7892846a6c 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/react/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) +Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1356](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1356) +Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1359](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1359) +Defined in: [packages/query-core/src/types.ts:1394](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1394) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1360) +Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1361) +Defined in: [packages/query-core/src/types.ts:1396](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1396) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) +Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1357](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1357) +Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) The variables object passed to the `mutationFn`. diff --git a/docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md index 6732628f444..d4368822213 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) +Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1379](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1379) +Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) +Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1381](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1381) +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) +Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1383](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1383) +Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1384](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1384) +Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1378](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1378) +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) The variables object passed to the `mutationFn`. diff --git a/docs/framework/react/reference/interfaces/MutationObserverOptions.md b/docs/framework/react/reference/interfaces/MutationObserverOptions.md index be502d19332..1e609be9bf1 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/react/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1220) +Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1255) ## Extends @@ -35,7 +35,12 @@ Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) + +The time in milliseconds that an unused/inactive mutation remains in memory before it is +garbage collected. + +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. #### Inherited from @@ -49,7 +54,7 @@ Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) #### Inherited from @@ -63,7 +68,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) #### Inherited from @@ -77,7 +82,7 @@ Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Inherited from @@ -91,7 +96,13 @@ Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. #### Inherited from @@ -105,7 +116,7 @@ Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -141,7 +152,7 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) #### Parameters @@ -169,7 +180,7 @@ Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) #### Parameters @@ -209,7 +220,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) +Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) #### Parameters @@ -245,7 +256,14 @@ Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) + +If `false`, failed mutations will not retry by default. +If `true`, failed mutations will retry infinitely. +If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. +If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + +Defaults to `0`. #### Inherited from @@ -259,7 +277,12 @@ Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/ optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) +Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +Defaults to a function that applies exponential backoff, capped at 30 seconds. #### Inherited from @@ -273,7 +296,7 @@ Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/ optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) +Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) #### Inherited from @@ -287,4 +310,4 @@ Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) +Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) diff --git a/docs/framework/react/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/react/reference/interfaces/MutationObserverSuccessResult.md index 89e8c2739cc..52cdcc4883e 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/react/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) +Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1420](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1420) +Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) +Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1423](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1423) +Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1424](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1424) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1425) +Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1426](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1426) +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) +Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) The variables object passed to the `mutationFn`. diff --git a/docs/framework/react/reference/interfaces/MutationOptions.md b/docs/framework/react/reference/interfaces/MutationOptions.md index 8721b62d099..49f2b8f4f19 100644 --- a/docs/framework/react/reference/interfaces/MutationOptions.md +++ b/docs/framework/react/reference/interfaces/MutationOptions.md @@ -3,7 +3,7 @@ id: MutationOptions title: MutationOptions --- -Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) ## Extended by @@ -35,7 +35,12 @@ Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) + +The time in milliseconds that an unused/inactive mutation remains in memory before it is +garbage collected. + +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. *** @@ -45,7 +50,7 @@ Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) *** @@ -55,7 +60,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) *** @@ -65,7 +70,7 @@ Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) *** @@ -75,7 +80,13 @@ Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. *** @@ -85,7 +96,7 @@ Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -117,7 +128,7 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) #### Parameters @@ -141,7 +152,7 @@ Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) #### Parameters @@ -177,7 +188,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) +Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) #### Parameters @@ -209,7 +220,14 @@ Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) + +If `false`, failed mutations will not retry by default. +If `true`, failed mutations will retry infinitely. +If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. +If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + +Defaults to `0`. *** @@ -219,7 +237,12 @@ Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/ optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) +Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +Defaults to a function that applies exponential backoff, capped at 30 seconds. *** @@ -229,4 +252,4 @@ Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/ optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) +Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) diff --git a/docs/framework/react/reference/interfaces/NotifyEvent.md b/docs/framework/react/reference/interfaces/NotifyEvent.md index 17b3241654f..5e7875d41b8 100644 --- a/docs/framework/react/reference/interfaces/NotifyEvent.md +++ b/docs/framework/react/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) +Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1519) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1485) +Defined in: [packages/query-core/src/types.ts:1520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1520) diff --git a/docs/framework/react/reference/interfaces/QueriesObserverOptions.md b/docs/framework/react/reference/interfaces/QueriesObserverOptions.md index 16035c45714..68e7913885d 100644 --- a/docs/framework/react/reference/interfaces/QueriesObserverOptions.md +++ b/docs/framework/react/reference/interfaces/QueriesObserverOptions.md @@ -19,9 +19,11 @@ Defined in: [packages/query-core/src/queriesObserver.ts:23](https://github.com/T optional combine: CombineFn; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L32) +Defined in: [packages/query-core/src/queriesObserver.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L34) A function that combines the array of `QueryObserverResult`s (one per observed query) into a single value. The combined value is memoized and only recomputed when one of the underlying results, the query hashes, or the `combine` function itself changes. + +Defaults to returning the array of `QueryObserverResult`s unchanged. diff --git a/docs/framework/react/reference/interfaces/QueryClientConfig.md b/docs/framework/react/reference/interfaces/QueryClientConfig.md index b04dadba88c..411eb0b2fb2 100644 --- a/docs/framework/react/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/react/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/ optional defaultOptions: DefaultOptions; ``` -Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) Default options for all queries and mutations created through this client. @@ -25,7 +25,7 @@ Default options for all queries and mutations created through this client. optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1447](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1447) +Defined in: [packages/query-core/src/types.ts:1482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1482) The mutation cache this client is connected to. A new `MutationCache` is created if not provided. @@ -38,6 +38,6 @@ provided. optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) +Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/react/reference/interfaces/QueryExecuteOptions.md b/docs/framework/react/reference/interfaces/QueryExecuteOptions.md index 5a055675308..1e844c5ba10 100644 --- a/docs/framework/react/reference/interfaces/QueryExecuteOptions.md +++ b/docs/framework/react/reference/interfaces/QueryExecuteOptions.md @@ -3,7 +3,7 @@ id: QueryExecuteOptions title: QueryExecuteOptions --- -Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L555) +Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) ## Extends @@ -43,7 +43,7 @@ Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -70,7 +70,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -93,7 +93,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -111,7 +111,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) +Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L577) *** @@ -121,7 +121,7 @@ Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -139,7 +139,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -158,7 +158,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -180,7 +180,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -201,7 +201,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -223,7 +223,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -242,7 +242,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -265,7 +265,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -283,12 +283,13 @@ WithRequired.queryKeyHashFn optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -305,7 +306,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -329,7 +330,7 @@ WithRequired.retryDelay optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L567) +Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L578) #### Parameters @@ -349,7 +350,7 @@ Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:572](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L572) +Defined in: [packages/query-core/src/types.ts:583](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L583) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -362,10 +363,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/react/reference/interfaces/QueryFilters.md b/docs/framework/react/reference/interfaces/QueryFilters.md index 6b177d93aa5..749e4283d0d 100644 --- a/docs/framework/react/reference/interfaces/QueryFilters.md +++ b/docs/framework/react/reference/interfaces/QueryFilters.md @@ -27,7 +27,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -39,7 +39,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -51,7 +51,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -73,7 +73,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -85,7 +85,7 @@ Include queries matching this query key optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -97,6 +97,8 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries + +Defaults to `'all'`. diff --git a/docs/framework/react/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/react/reference/interfaces/QueryObserverBaseResult.md index 4689d9d661a..1b54d6f8041 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L743) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) +Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) +Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) +Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) +Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) +Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/react/reference/interfaces/QueryObserverLoadingErrorResult.md index 86ae34b80ab..7a4f855305f 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) +Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) +Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/react/reference/interfaces/QueryObserverLoadingResult.md index a0024077883..8f94574bcca 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) +Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) +Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverOptions.md b/docs/framework/react/reference/interfaces/QueryObserverOptions.md index 6d3cf82607b..77849c1a546 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverOptions.md +++ b/docs/framework/react/reference/interfaces/QueryObserverOptions.md @@ -3,7 +3,7 @@ id: QueryObserverOptions title: QueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L373) +Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L375) ## Extends @@ -48,11 +48,12 @@ Defined in: [packages/query-core/src/types.ts:373](https://github.com/TanStack/q optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. *** @@ -63,7 +64,7 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -90,7 +91,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -113,7 +114,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -131,7 +132,7 @@ WithRequired.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -149,7 +150,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -168,7 +169,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -190,7 +191,7 @@ WithRequired.networkMode optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -206,7 +207,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -227,7 +228,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -241,7 +242,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -263,7 +264,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -282,7 +283,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -305,7 +306,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -323,10 +324,11 @@ WithRequired.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. *** @@ -337,7 +339,7 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -350,12 +352,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. *** @@ -366,12 +369,13 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. *** @@ -382,12 +386,13 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. *** @@ -398,12 +403,13 @@ Defaults to `true`. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -420,7 +426,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -444,10 +450,11 @@ WithRequired.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. *** @@ -458,7 +465,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -483,12 +490,13 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. *** @@ -499,10 +507,11 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -519,10 +528,11 @@ WithRequired.structuralSharing optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. *** @@ -533,10 +543,11 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. diff --git a/docs/framework/react/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/react/reference/interfaces/QueryObserverPendingResult.md index 21fab248a7c..41a101c7c8c 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:875](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L875) +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:876](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L876) +Defined in: [packages/query-core/src/types.ts:887](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L887) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) +Defined in: [packages/query-core/src/types.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L888) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) +Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/react/reference/interfaces/QueryObserverPlaceholderResult.md index 89af2502c11..cce7cffcc9b 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) +Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) +Defined in: [packages/query-core/src/types.ts:969](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L969) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) +Defined in: [packages/query-core/src/types.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L970) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) +Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) +Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) +Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) +Defined in: [packages/query-core/src/types.ts:972](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L972) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/react/reference/interfaces/QueryObserverRefetchErrorResult.md index dab5586fdc1..8486e8cf4cb 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) +Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) +Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/react/reference/interfaces/QueryObserverSuccessResult.md index b180b89ca62..f126bea0f70 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) +Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) +Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) +Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) +Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryOptions.md b/docs/framework/react/reference/interfaces/QueryOptions.md index ba603a4332f..bb82dd0f56a 100644 --- a/docs/framework/react/reference/interfaces/QueryOptions.md +++ b/docs/framework/react/reference/interfaces/QueryOptions.md @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:231](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -56,7 +56,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -73,7 +73,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -85,7 +85,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -97,7 +97,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -110,7 +110,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -126,7 +126,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -141,7 +141,7 @@ optional queryFn: | typeof skipToken; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -157,7 +157,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -170,7 +170,7 @@ as the actual cache key internally. optional queryKey: TQueryKey; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -187,7 +187,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -199,12 +199,13 @@ If specified, this function is used to hash the `queryKey` to a string. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. *** @@ -215,7 +216,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -233,8 +234,9 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. diff --git a/docs/framework/react/reference/interfaces/RefetchOptions.md b/docs/framework/react/reference/interfaces/RefetchOptions.md index b502dcd3492..104412c5bac 100644 --- a/docs/framework/react/reference/interfaces/RefetchOptions.md +++ b/docs/framework/react/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L684) +Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,7 +38,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/react/reference/interfaces/RefetchQueryFilters.md b/docs/framework/react/reference/interfaces/RefetchQueryFilters.md index 84f917c6201..bde28360fa1 100644 --- a/docs/framework/react/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/react/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:709](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L709) +Defined in: [packages/query-core/src/types.ts:720](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L720) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -26,7 +26,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -42,7 +42,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -58,7 +58,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -84,7 +84,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -100,7 +100,7 @@ Include queries matching this query key optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -116,10 +116,12 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries +Defaults to `'all'`. + #### Inherited from [`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/react/reference/interfaces/ResetOptions.md b/docs/framework/react/reference/interfaces/ResetOptions.md index 1855fef3064..6d3a8398fbb 100644 --- a/docs/framework/react/reference/interfaces/ResetOptions.md +++ b/docs/framework/react/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L714) +Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/react/reference/interfaces/ResultOptions.md b/docs/framework/react/reference/interfaces/ResultOptions.md index 9766c56d1a6..f3da151a3ec 100644 --- a/docs/framework/react/reference/interfaces/ResultOptions.md +++ b/docs/framework/react/reference/interfaces/ResultOptions.md @@ -3,7 +3,7 @@ id: ResultOptions title: ResultOptions --- -Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) +Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L686) ## Extended by @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/react/reference/interfaces/SetDataOptions.md b/docs/framework/react/reference/interfaces/SetDataOptions.md index 4262e781b05..cac83e9312a 100644 --- a/docs/framework/react/reference/interfaces/SetDataOptions.md +++ b/docs/framework/react/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1471) +Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1506) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1472](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1472) +Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) diff --git a/docs/framework/react/reference/interfaces/UseBaseQueryOptions.md b/docs/framework/react/reference/interfaces/UseBaseQueryOptions.md index f9e18e09b4d..2b0c81d672c 100644 --- a/docs/framework/react/reference/interfaces/UseBaseQueryOptions.md +++ b/docs/framework/react/reference/interfaces/UseBaseQueryOptions.md @@ -54,11 +54,12 @@ The type of your `queryKey`. optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -73,7 +74,7 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -98,7 +99,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -119,7 +120,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -135,7 +136,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -151,7 +152,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -168,7 +169,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -188,7 +189,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -208,7 +209,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -271,7 +272,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -289,7 +290,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -309,7 +310,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -326,7 +327,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -347,7 +348,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -363,10 +364,11 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -381,7 +383,7 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -398,12 +400,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -418,12 +421,13 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -438,12 +442,13 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -458,12 +463,13 @@ Defaults to `true`. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -478,7 +484,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -500,10 +506,11 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -518,7 +525,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -547,12 +554,13 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -567,10 +575,11 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -603,10 +612,11 @@ true optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. #### Inherited from @@ -621,12 +631,13 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/react/reference/interfaces/UseInfiniteQueryOptions.md b/docs/framework/react/reference/interfaces/UseInfiniteQueryOptions.md index 2ced6a93c53..193d05117d3 100644 --- a/docs/framework/react/reference/interfaces/UseInfiniteQueryOptions.md +++ b/docs/framework/react/reference/interfaces/UseInfiniteQueryOptions.md @@ -54,11 +54,12 @@ The type of the parameter passed to `queryFn` to fetch a given page. optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -75,7 +76,7 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -98,7 +99,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -117,7 +118,7 @@ OmitKeyof.getNextPageParam optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -138,7 +139,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -161,7 +162,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -179,7 +180,7 @@ OmitKeyof.initialDataUpdatedAt initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from @@ -195,7 +196,7 @@ OmitKeyof.initialPageParam optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -211,7 +212,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -228,7 +229,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -248,7 +249,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -268,7 +269,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -289,7 +290,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -309,7 +310,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -331,7 +332,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -348,7 +349,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -371,7 +372,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -389,10 +390,11 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -409,7 +411,7 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -426,12 +428,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -448,12 +451,13 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -470,12 +474,13 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -492,12 +497,13 @@ OmitKeyof.refetchOnWindowFocus optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -514,7 +520,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -538,10 +544,11 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -558,7 +565,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -589,12 +596,13 @@ OmitKeyof.select optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -611,10 +619,11 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -649,12 +658,13 @@ true optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/react/reference/interfaces/UseMutationOptions.md b/docs/framework/react/reference/interfaces/UseMutationOptions.md index 78d7b495793..50b64e42f25 100644 --- a/docs/framework/react/reference/interfaces/UseMutationOptions.md +++ b/docs/framework/react/reference/interfaces/UseMutationOptions.md @@ -47,7 +47,12 @@ their `onMutateResult` parameter — useful for optimistic-update rollback data. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) + +The time in milliseconds that an unused/inactive mutation remains in memory before it is +garbage collected. + +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. #### Inherited from @@ -61,7 +66,7 @@ Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) #### Inherited from @@ -75,7 +80,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) #### Inherited from @@ -91,7 +96,7 @@ OmitKeyof.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Inherited from @@ -105,7 +110,13 @@ Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. #### Inherited from @@ -119,7 +130,7 @@ Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -157,7 +168,7 @@ OmitKeyof.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) #### Parameters @@ -187,7 +198,7 @@ OmitKeyof.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) #### Parameters @@ -229,7 +240,7 @@ OmitKeyof.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) +Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) #### Parameters @@ -267,7 +278,14 @@ OmitKeyof.onSuccess optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) + +If `false`, failed mutations will not retry by default. +If `true`, failed mutations will retry infinitely. +If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. +If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + +Defaults to `0`. #### Inherited from @@ -283,7 +301,12 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) +Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +Defaults to a function that applies exponential backoff, capped at 30 seconds. #### Inherited from @@ -299,7 +322,7 @@ OmitKeyof.retryDelay optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) +Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) #### Inherited from @@ -313,7 +336,7 @@ Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) +Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) #### Inherited from diff --git a/docs/framework/react/reference/interfaces/UseQueryOptions.md b/docs/framework/react/reference/interfaces/UseQueryOptions.md index c110ade2f3d..e37277d8715 100644 --- a/docs/framework/react/reference/interfaces/UseQueryOptions.md +++ b/docs/framework/react/reference/interfaces/UseQueryOptions.md @@ -47,11 +47,12 @@ The type of your `queryKey`. optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -68,7 +69,7 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -93,7 +94,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -116,7 +117,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -134,7 +135,7 @@ OmitKeyof.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -150,7 +151,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -167,7 +168,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -187,7 +188,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -207,7 +208,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -272,7 +273,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -292,7 +293,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -314,7 +315,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -331,7 +332,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -354,7 +355,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -372,10 +373,11 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -392,7 +394,7 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -409,12 +411,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -431,12 +434,13 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -453,12 +457,13 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -475,12 +480,13 @@ OmitKeyof.refetchOnWindowFocus optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -497,7 +503,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -521,10 +527,11 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -541,7 +548,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -572,12 +579,13 @@ OmitKeyof.select optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -594,10 +602,11 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -638,12 +647,13 @@ OmitKeyof.subscribed optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/react/reference/interfaces/UseSuspenseInfiniteQueryOptions.md b/docs/framework/react/reference/interfaces/UseSuspenseInfiniteQueryOptions.md index fc153462fe5..0a53f387d46 100644 --- a/docs/framework/react/reference/interfaces/UseSuspenseInfiniteQueryOptions.md +++ b/docs/framework/react/reference/interfaces/UseSuspenseInfiniteQueryOptions.md @@ -54,7 +54,7 @@ The type of the parameter passed to `queryFn` to fetch a given page. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -77,7 +77,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -96,7 +96,7 @@ OmitKeyof.getNextPageParam optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -117,7 +117,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -140,7 +140,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -158,7 +158,7 @@ OmitKeyof.initialDataUpdatedAt initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from @@ -174,7 +174,7 @@ OmitKeyof.initialPageParam optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -190,7 +190,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -207,7 +207,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -227,7 +227,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -247,7 +247,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -279,7 +279,7 @@ must always be provided, unless a default query function has been defined. optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -296,7 +296,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -319,7 +319,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -337,10 +337,11 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -357,7 +358,7 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -374,12 +375,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -396,12 +398,13 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -418,12 +421,13 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -440,12 +444,13 @@ OmitKeyof.refetchOnWindowFocus optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -462,7 +467,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -486,10 +491,11 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -506,7 +512,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -537,12 +543,13 @@ OmitKeyof.select optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -559,10 +566,11 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/react/reference/interfaces/UseSuspenseQueryOptions.md b/docs/framework/react/reference/interfaces/UseSuspenseQueryOptions.md index 28978d06d35..a114596fd93 100644 --- a/docs/framework/react/reference/interfaces/UseSuspenseQueryOptions.md +++ b/docs/framework/react/reference/interfaces/UseSuspenseQueryOptions.md @@ -48,7 +48,7 @@ The type of your `queryKey`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -73,7 +73,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -96,7 +96,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -114,7 +114,7 @@ OmitKeyof.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -130,7 +130,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -147,7 +147,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -167,7 +167,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -187,7 +187,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -263,7 +263,7 @@ must always be provided, unless a default query function has been defined. optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -280,7 +280,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -303,7 +303,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -321,10 +321,11 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -341,7 +342,7 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -358,12 +359,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -380,12 +382,13 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -402,12 +405,13 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -424,12 +428,13 @@ OmitKeyof.refetchOnWindowFocus optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -446,7 +451,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -470,10 +475,11 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -490,7 +496,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -521,12 +527,13 @@ OmitKeyof.select optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -543,10 +550,11 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/react/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/react/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md index 733a1a5ad75..4412ad00c8e 100644 --- a/docs/framework/react/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md +++ b/docs/framework/react/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedInfiniteQueryObserverOptions type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:538](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L538) +Defined in: [packages/query-core/src/types.ts:549](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L549) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/react/reference/type-aliases/DefaultedQueryObserverOptions.md index 1b4309f150c..9ce8401b128 100644 --- a/docs/framework/react/reference/type-aliases/DefaultedQueryObserverOptions.md +++ b/docs/framework/react/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedQueryObserverOptions type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L509) +Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index d82cfa37d51..cec33b142b7 100644 --- a/docs/framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) +Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/react/reference/type-aliases/DefinedQueryObserverResult.md index 97fcae175a9..b4480af3810 100644 --- a/docs/framework/react/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/react/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) +Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/react/reference/type-aliases/EnsureInfiniteQueryDataOptions.md index 305eef94893..ff75b1c3449 100644 --- a/docs/framework/react/reference/type-aliases/EnsureInfiniteQueryDataOptions.md +++ b/docs/framework/react/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -7,7 +7,7 @@ title: EnsureInfiniteQueryDataOptions type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; ``` -Defined in: [packages/query-core/src/types.ts:612](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L612) +Defined in: [packages/query-core/src/types.ts:623](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L623) ## Type Declaration diff --git a/docs/framework/react/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/react/reference/type-aliases/FetchInfiniteQueryOptions.md index 1ee1470b14a..c926bbd3ae5 100644 --- a/docs/framework/react/reference/type-aliases/FetchInfiniteQueryOptions.md +++ b/docs/framework/react/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: FetchInfiniteQueryOptions type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L656) +Defined in: [packages/query-core/src/types.ts:667](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L667) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/FetchStatus.md b/docs/framework/react/reference/type-aliases/FetchStatus.md index 7b71e54eacd..b347069e97e 100644 --- a/docs/framework/react/reference/type-aliases/FetchStatus.md +++ b/docs/framework/react/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:752](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L752) diff --git a/docs/framework/react/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/react/reference/type-aliases/InfiniteQueryExecuteOptions.md index 29c974cfddf..c198662a319 100644 --- a/docs/framework/react/reference/type-aliases/InfiniteQueryExecuteOptions.md +++ b/docs/framework/react/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -7,7 +7,7 @@ title: InfiniteQueryExecuteOptions type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:635](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L635) +Defined in: [packages/query-core/src/types.ts:646](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L646) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/react/reference/type-aliases/InfiniteQueryObserverResult.md index 7a646bc1c38..42279b19c00 100644 --- a/docs/framework/react/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/react/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) +Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/MutateFunction.md b/docs/framework/react/reference/type-aliases/MutateFunction.md index 284bd0fc270..558040d3439 100644 --- a/docs/framework/react/reference/type-aliases/MutateFunction.md +++ b/docs/framework/react/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1271) +Defined in: [packages/query-core/src/types.ts:1306](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1306) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/MutateFunctionRest.md b/docs/framework/react/reference/type-aliases/MutateFunctionRest.md index a2f16ea5302..3e7a5217482 100644 --- a/docs/framework/react/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/react/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1256) +Defined in: [packages/query-core/src/types.ts:1291](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1291) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/MutationFunction.md b/docs/framework/react/reference/type-aliases/MutationFunction.md index 4c8c7aed384..330af1ef65a 100644 --- a/docs/framework/react/reference/type-aliases/MutationFunction.md +++ b/docs/framework/react/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/MutationFunctionContext.md b/docs/framework/react/reference/type-aliases/MutationFunctionContext.md index ef228cc53d3..97de2f1c220 100644 --- a/docs/framework/react/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/react/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) +Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1169) +Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1180) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1170) +Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) +Defined in: [packages/query-core/src/types.ts:1182](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1182) diff --git a/docs/framework/react/reference/type-aliases/MutationKey.md b/docs/framework/react/reference/type-aliases/MutationKey.md index 7157d6052fd..8e9d3bc3b3a 100644 --- a/docs/framework/react/reference/type-aliases/MutationKey.md +++ b/docs/framework/react/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) diff --git a/docs/framework/react/reference/type-aliases/MutationMeta.md b/docs/framework/react/reference/type-aliases/MutationMeta.md index f3bf9984fab..474c593e206 100644 --- a/docs/framework/react/reference/type-aliases/MutationMeta.md +++ b/docs/framework/react/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1160](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1160) +Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) diff --git a/docs/framework/react/reference/type-aliases/MutationObserverResult.md b/docs/framework/react/reference/type-aliases/MutationObserverResult.md index 3390192e071..21e43836bf6 100644 --- a/docs/framework/react/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/react/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) +Defined in: [packages/query-core/src/types.ts:1464](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1464) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/MutationScope.md b/docs/framework/react/reference/type-aliases/MutationScope.md index a2511c903d9..feac9d9d17a 100644 --- a/docs/framework/react/reference/type-aliases/MutationScope.md +++ b/docs/framework/react/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) +Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1167) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) +Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) diff --git a/docs/framework/react/reference/type-aliases/MutationStatus.md b/docs/framework/react/reference/type-aliases/MutationStatus.md index d9b58cdd26f..4cd2d3c9535 100644 --- a/docs/framework/react/reference/type-aliases/MutationStatus.md +++ b/docs/framework/react/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1154](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1154) +Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) diff --git a/docs/framework/react/reference/type-aliases/NotifyEventType.md b/docs/framework/react/reference/type-aliases/NotifyEventType.md index 94912df6c6b..9bbc85e4ce8 100644 --- a/docs/framework/react/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/react/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) +Defined in: [packages/query-core/src/types.ts:1510](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1510) diff --git a/docs/framework/react/reference/type-aliases/QueryObserverResult.md b/docs/framework/react/reference/type-aliases/QueryObserverResult.md index f5c6c95d5f2..4fc661a6c9d 100644 --- a/docs/framework/react/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/react/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) +Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/QueryStatus.md b/docs/framework/react/reference/type-aliases/QueryStatus.md index 3fc872e604b..6679b8b17c6 100644 --- a/docs/framework/react/reference/type-aliases/QueryStatus.md +++ b/docs/framework/react/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:740](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L740) +Defined in: [packages/query-core/src/types.ts:751](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L751) diff --git a/docs/framework/react/reference/type-aliases/SkipToken.md b/docs/framework/react/reference/type-aliases/SkipToken.md index 176c23830d2..3a5791b982e 100644 --- a/docs/framework/react/reference/type-aliases/SkipToken.md +++ b/docs/framework/react/reference/type-aliases/SkipToken.md @@ -7,6 +7,6 @@ title: SkipToken type SkipToken = typeof skipToken; ``` -Defined in: [packages/query-core/src/utils.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L524) +Defined in: [packages/query-core/src/utils.ts:526](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L526) The type of the [skipToken](../variables/skipToken.md) sentinel value. diff --git a/docs/framework/react/reference/type-aliases/ThrowOnError.md b/docs/framework/react/reference/type-aliases/ThrowOnError.md index 60ad44c1cd1..613549e4d52 100644 --- a/docs/framework/react/reference/type-aliases/ThrowOnError.md +++ b/docs/framework/react/reference/type-aliases/ThrowOnError.md @@ -7,7 +7,7 @@ title: ThrowOnError type ThrowOnError = boolean | (error, query) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L361) +Defined in: [packages/query-core/src/types.ts:363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L363) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/Updater.md b/docs/framework/react/reference/type-aliases/Updater.md index b6a29ccc5fc..7a0c2f30503 100644 --- a/docs/framework/react/reference/type-aliases/Updater.md +++ b/docs/framework/react/reference/type-aliases/Updater.md @@ -7,7 +7,7 @@ title: Updater type Updater = TOutput | (input) => TOutput; ``` -Defined in: [packages/query-core/src/utils.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L103) +Defined in: [packages/query-core/src/utils.ts:105](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L105) Either a plain value of type `TOutput`, or a function that receives `TInput` and returns `TOutput`. Used for example by `setQueryData`-style updaters, which accept either the new data directly or a diff --git a/docs/framework/react/reference/type-aliases/WithRequired.md b/docs/framework/react/reference/type-aliases/WithRequired.md index c8ef831db3c..deb87dfe4a4 100644 --- a/docs/framework/react/reference/type-aliases/WithRequired.md +++ b/docs/framework/react/reference/type-aliases/WithRequired.md @@ -7,7 +7,7 @@ title: WithRequired type WithRequired = TTarget & { [_ in TKey]: {} }; ``` -Defined in: [packages/query-core/src/types.ts:505](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L505) +Defined in: [packages/query-core/src/types.ts:516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L516) ## Type Parameters diff --git a/docs/framework/react/reference/variables/isServer.md b/docs/framework/react/reference/variables/isServer.md index 28956d55cbf..16aa39d1244 100644 --- a/docs/framework/react/reference/variables/isServer.md +++ b/docs/framework/react/reference/variables/isServer.md @@ -7,7 +7,7 @@ title: isServer const isServer: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L112) +Defined in: [packages/query-core/src/utils.ts:114](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L114) ## Deprecated diff --git a/docs/framework/react/reference/variables/skipToken.md b/docs/framework/react/reference/variables/skipToken.md index 3163e91c1c2..a390d0b7b66 100644 --- a/docs/framework/react/reference/variables/skipToken.md +++ b/docs/framework/react/reference/variables/skipToken.md @@ -7,7 +7,7 @@ title: skipToken const skipToken: typeof skipToken; ``` -Defined in: [packages/query-core/src/utils.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L520) +Defined in: [packages/query-core/src/utils.ts:522](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L522) Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`, diff --git a/docs/framework/solid/reference/classes/QueriesObserver.md b/docs/framework/solid/reference/classes/QueriesObserver.md index 6d696bfa87a..7f0839a42fb 100644 --- a/docs/framework/solid/reference/classes/QueriesObserver.md +++ b/docs/framework/solid/reference/classes/QueriesObserver.md @@ -3,7 +3,7 @@ id: QueriesObserver title: QueriesObserver --- -Defined in: [packages/query-core/src/queriesObserver.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L54) +Defined in: [packages/query-core/src/queriesObserver.ts:56](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L56) A `QueriesObserver` watches an array of queries at once, exposing them as a single array of `QueryObserverResult`s (or, when a `combine` option is @@ -45,7 +45,7 @@ new QueriesObserver( options?): QueriesObserver; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L68) +Defined in: [packages/query-core/src/queriesObserver.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L70) #### Parameters @@ -95,7 +95,7 @@ Subscribable.listeners destroy(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L104) +Defined in: [packages/query-core/src/queriesObserver.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L106) Stops observing all queries: clears all listeners and destroys every underlying `QueryObserver` this observer manages. @@ -112,7 +112,7 @@ underlying `QueryObserver` this observer manages. getCurrentResult(): QueryObserverResult[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L208) +Defined in: [packages/query-core/src/queriesObserver.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L210) Returns the most recently computed array of `QueryObserverResult`s, one per observed query, in the same order as the queries passed to the @@ -137,7 +137,7 @@ const data = results.map((result) => result.data) getObservers(): QueryObserver[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L225) +Defined in: [packages/query-core/src/queriesObserver.ts:227](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L227) Returns the underlying `QueryObserver` instances this observer manages, in the same order as the queries passed to the constructor or @@ -155,7 +155,7 @@ in the same order as the queries passed to the constructor or getOptimisticResult(queries, combine): [QueryObserverResult[], (r?) => TCombinedResult, () => QueryObserverResult[]]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L236) +Defined in: [packages/query-core/src/queriesObserver.ts:238](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L238) The `QueriesObserver` counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult) — computes the result for the given (already-defaulted) queries right now, synchronously. Called by @@ -185,7 +185,7 @@ wrap the results for property-access tracking. getQueries(): Query[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:216](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L216) +Defined in: [packages/query-core/src/queriesObserver.ts:218](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L218) Returns the underlying `Query` instances currently being observed, in the same order as the queries passed to the constructor or `setQueries`. @@ -222,7 +222,7 @@ Subscribable.hasListeners protected onSubscribe(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L84) +Defined in: [packages/query-core/src/queriesObserver.ts:86](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L86) #### Returns @@ -242,7 +242,7 @@ Subscribable.onSubscribe protected onUnsubscribe(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L94) +Defined in: [packages/query-core/src/queriesObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L96) #### Returns @@ -262,7 +262,7 @@ Subscribable.onUnsubscribe setQueries(queries, options?): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:125](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L125) +Defined in: [packages/query-core/src/queriesObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L127) Replaces the set of queries being observed. Existing `QueryObserver`s are reused for queries that match an already-observed query hash; diff --git a/docs/framework/solid/reference/functions/hashKey.md b/docs/framework/solid/reference/functions/hashKey.md index 9e7844aa09d..dc774c032ce 100644 --- a/docs/framework/solid/reference/functions/hashKey.md +++ b/docs/framework/solid/reference/functions/hashKey.md @@ -7,7 +7,7 @@ title: hashKey function hashKey(queryKey): string; ``` -Defined in: [packages/query-core/src/utils.ts:282](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L282) +Defined in: [packages/query-core/src/utils.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L284) Default query & mutation keys hash function. Hashes the value into a stable hash. diff --git a/docs/framework/solid/reference/functions/keepPreviousData.md b/docs/framework/solid/reference/functions/keepPreviousData.md index d41c7d7c726..6a84f4c5970 100644 --- a/docs/framework/solid/reference/functions/keepPreviousData.md +++ b/docs/framework/solid/reference/functions/keepPreviousData.md @@ -7,7 +7,7 @@ title: keepPreviousData function keepPreviousData(previousData): T | undefined; ``` -Defined in: [packages/query-core/src/utils.ts:491](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L491) +Defined in: [packages/query-core/src/utils.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L493) Intended to be passed as a query's `placeholderData` option, for example `placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new diff --git a/docs/framework/solid/reference/functions/matchMutation.md b/docs/framework/solid/reference/functions/matchMutation.md index 79468dcfad9..40210da4cf1 100644 --- a/docs/framework/solid/reference/functions/matchMutation.md +++ b/docs/framework/solid/reference/functions/matchMutation.md @@ -7,7 +7,7 @@ title: matchMutation function matchMutation(filters, mutation): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:235](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L235) +Defined in: [packages/query-core/src/utils.ts:237](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L237) Checks whether a mutation matches the given [MutationFilters](../interfaces/MutationFilters.md). Every filter that is specified must match; filters that are left unspecified are ignored. diff --git a/docs/framework/solid/reference/functions/matchQuery.md b/docs/framework/solid/reference/functions/matchQuery.md index f98fe5f3537..4c54b2df995 100644 --- a/docs/framework/solid/reference/functions/matchQuery.md +++ b/docs/framework/solid/reference/functions/matchQuery.md @@ -7,7 +7,7 @@ title: matchQuery function matchQuery(filters, query): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L173) +Defined in: [packages/query-core/src/utils.ts:175](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L175) Checks whether a query matches the given [QueryFilters](../interfaces/QueryFilters.md). Every filter that is specified must match; filters that are left unspecified are ignored. diff --git a/docs/framework/solid/reference/functions/noop.md b/docs/framework/solid/reference/functions/noop.md index fd1b8dc2ad0..01fb409f4e9 100644 --- a/docs/framework/solid/reference/functions/noop.md +++ b/docs/framework/solid/reference/functions/noop.md @@ -9,7 +9,7 @@ title: noop function noop(): void; ``` -Defined in: [packages/query-core/src/utils.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L117) +Defined in: [packages/query-core/src/utils.ts:119](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L119) A function that does nothing. @@ -23,7 +23,7 @@ A function that does nothing. function noop(): undefined; ``` -Defined in: [packages/query-core/src/utils.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L118) +Defined in: [packages/query-core/src/utils.ts:120](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L120) A function that does nothing. diff --git a/docs/framework/solid/reference/functions/partialMatchKey.md b/docs/framework/solid/reference/functions/partialMatchKey.md index 3795de85b95..4db67323e9b 100644 --- a/docs/framework/solid/reference/functions/partialMatchKey.md +++ b/docs/framework/solid/reference/functions/partialMatchKey.md @@ -7,7 +7,7 @@ title: partialMatchKey function partialMatchKey(a, b): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L298) +Defined in: [packages/query-core/src/utils.ts:300](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L300) Checks if key `b` partially matches with key `a`. diff --git a/docs/framework/solid/reference/functions/replaceEqualDeep.md b/docs/framework/solid/reference/functions/replaceEqualDeep.md index 77a393196ef..6a81c3907fb 100644 --- a/docs/framework/solid/reference/functions/replaceEqualDeep.md +++ b/docs/framework/solid/reference/functions/replaceEqualDeep.md @@ -10,7 +10,7 @@ function replaceEqualDeep( depth?): T; ``` -Defined in: [packages/query-core/src/utils.ts:337](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L337) +Defined in: [packages/query-core/src/utils.ts:339](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L339) This function returns `a` if `b` is deeply equal. If not, it will replace any deeply equal children of `b` with those of `a`. diff --git a/docs/framework/solid/reference/functions/shouldThrowError.md b/docs/framework/solid/reference/functions/shouldThrowError.md index 3146617391e..1f1e62a8d0e 100644 --- a/docs/framework/solid/reference/functions/shouldThrowError.md +++ b/docs/framework/solid/reference/functions/shouldThrowError.md @@ -7,7 +7,7 @@ title: shouldThrowError function shouldThrowError(throwOnError, params): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L574) +Defined in: [packages/query-core/src/utils.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L576) Resolves a `throwOnError` option to a boolean. If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller, diff --git a/docs/framework/solid/reference/interfaces/CancelOptions.md b/docs/framework/solid/reference/interfaces/CancelOptions.md index 14394c18533..f52c729f3b1 100644 --- a/docs/framework/solid/reference/interfaces/CancelOptions.md +++ b/docs/framework/solid/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1466) +Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1501) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1467) +Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1468) +Defined in: [packages/query-core/src/types.ts:1503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1503) diff --git a/docs/framework/solid/reference/interfaces/DefaultOptions.md b/docs/framework/solid/reference/interfaces/DefaultOptions.md index 277707f674c..5ebc9ffe6fc 100644 --- a/docs/framework/solid/reference/interfaces/DefaultOptions.md +++ b/docs/framework/solid/reference/interfaces/DefaultOptions.md @@ -28,7 +28,7 @@ The default type of errors thrown by queries and mutations using this `QueryClie optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) +Defined in: [packages/query-core/src/types.ts:1498](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1498) Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). @@ -46,7 +46,7 @@ CoreDefaultOptions.dehydrate optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1496](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1496) Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). @@ -88,7 +88,7 @@ CoreDefaultOptions.hydrate optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) +Defined in: [packages/query-core/src/types.ts:1494](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1494) Default options applied to every mutation, unless overridden per-mutation. diff --git a/docs/framework/solid/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/solid/reference/interfaces/EnsureQueryDataOptions.md index d7b4751a9d3..d71a60902e6 100644 --- a/docs/framework/solid/reference/interfaces/EnsureQueryDataOptions.md +++ b/docs/framework/solid/reference/interfaces/EnsureQueryDataOptions.md @@ -3,7 +3,7 @@ id: EnsureQueryDataOptions title: EnsureQueryDataOptions --- -Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) +Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L606) ## Deprecated @@ -41,7 +41,7 @@ Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -66,7 +66,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -87,7 +87,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -103,7 +103,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) +Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) #### Inherited from @@ -117,7 +117,7 @@ Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -133,7 +133,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -150,7 +150,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -170,7 +170,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -189,7 +189,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -209,7 +209,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -226,7 +226,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -247,7 +247,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -263,12 +263,13 @@ If specified, this function is used to hash the `queryKey` to a string. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -283,7 +284,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -305,7 +306,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional revalidateIfStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L608) +Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L619) *** @@ -315,7 +316,7 @@ Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) +Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -332,10 +333,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/solid/reference/interfaces/FetchNextPageOptions.md b/docs/framework/solid/reference/interfaces/FetchNextPageOptions.md index d12afe35fe1..2c0be977140 100644 --- a/docs/framework/solid/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/solid/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L716) +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) +Defined in: [packages/query-core/src/types.ts:736](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L736) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/solid/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/solid/reference/interfaces/FetchPreviousPageOptions.md index 93ca92088f1..683e789ee52 100644 --- a/docs/framework/solid/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/solid/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) +Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L739) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:748](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L748) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/solid/reference/interfaces/FetchQueryOptions.md b/docs/framework/solid/reference/interfaces/FetchQueryOptions.md index 27d7aa63d3d..0820a2a87b7 100644 --- a/docs/framework/solid/reference/interfaces/FetchQueryOptions.md +++ b/docs/framework/solid/reference/interfaces/FetchQueryOptions.md @@ -3,7 +3,7 @@ id: FetchQueryOptions title: FetchQueryOptions --- -Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L576) +Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L587) ## Deprecated @@ -45,7 +45,7 @@ Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -72,7 +72,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -95,7 +95,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -113,7 +113,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) +Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) *** @@ -123,7 +123,7 @@ Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -141,7 +141,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -160,7 +160,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -182,7 +182,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -203,7 +203,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -225,7 +225,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -244,7 +244,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -267,7 +267,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -285,12 +285,13 @@ WithRequired.queryKeyHashFn optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -307,7 +308,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -331,7 +332,7 @@ WithRequired.retryDelay optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) +Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -344,10 +345,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverBaseResult.md index f1443c39625..9195e0727f8 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L991) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) +Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) +Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) +Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) +Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) +Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 7c55201c028..2841b5ab116 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) +Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) +Defined in: [packages/query-core/src/types.ts:1076](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1076) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) +Defined in: [packages/query-core/src/types.ts:1077](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1077) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) +Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult.md index f9541ebd73b..95ff84b3ef3 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) +Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) +Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) +Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) +Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverOptions.md index 0427ea694eb..2cee726829b 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverOptions.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverOptions.md @@ -51,11 +51,12 @@ The type of the parameter passed to `queryFn` to fetch a given page. optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -72,7 +73,7 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -95,7 +96,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -114,7 +115,7 @@ OmitKeyof.getNextPageParam optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -135,7 +136,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -158,7 +159,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -176,7 +177,7 @@ OmitKeyof.initialDataUpdatedAt initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from @@ -192,7 +193,7 @@ OmitKeyof.initialPageParam optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -208,7 +209,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -225,7 +226,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -245,7 +246,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -267,7 +268,7 @@ OmitKeyof.notifyOnChangeProps optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -288,7 +289,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -308,7 +309,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -330,7 +331,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -347,7 +348,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -370,7 +371,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -403,10 +404,11 @@ Defaults reconciliation to false. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -423,7 +425,7 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -442,12 +444,13 @@ OmitKeyof.refetchIntervalInBackground optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -464,12 +467,13 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -486,12 +490,13 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -508,12 +513,13 @@ OmitKeyof.refetchOnWindowFocus optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -530,7 +536,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -554,10 +560,11 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -574,7 +581,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -605,12 +612,13 @@ OmitKeyof.select optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -627,10 +635,11 @@ OmitKeyof.staleTime optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. #### Inherited from @@ -647,12 +656,13 @@ OmitKeyof.suspense optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult.md index 1bab3233ec9..c3e8b022cdb 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1027](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1027) +Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1029](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1029) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) +Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) +Defined in: [packages/query-core/src/types.ts:1042](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1042) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) +Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index 58310e1af49..e62579744ba 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) +Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) +Defined in: [packages/query-core/src/types.ts:1133](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1133) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) +Defined in: [packages/query-core/src/types.ts:1128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1128) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) +Defined in: [packages/query-core/src/types.ts:1129](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1129) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) +Defined in: [packages/query-core/src/types.ts:1132](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1132) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) +Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) +Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) +Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index 22ed760c153..a67e877f083 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1094](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1094) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) +Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) +Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) +Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 732c882f86f..0b875662cbc 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) +Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) +Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) +Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) +Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryOptions.md b/docs/framework/solid/reference/interfaces/InfiniteQueryOptions.md index 5b5270a618d..a262c993309 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryOptions.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryOptions.md @@ -66,11 +66,12 @@ Defaults to `false`. optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -87,7 +88,7 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -110,7 +111,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -129,7 +130,7 @@ OmitKeyof.getNextPageParam optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -150,7 +151,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -173,7 +174,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -191,7 +192,7 @@ OmitKeyof.initialDataUpdatedAt initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from @@ -207,7 +208,7 @@ OmitKeyof.initialPageParam optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -223,7 +224,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -240,7 +241,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -260,7 +261,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -282,7 +283,7 @@ OmitKeyof.notifyOnChangeProps optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -303,7 +304,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -323,7 +324,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -345,7 +346,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -372,7 +373,7 @@ Defined in: [packages/solid-query/src/types.ts:173](https://github.com/TanStack/ optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -411,10 +412,11 @@ OmitKeyof.reconcile optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -431,7 +433,7 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -450,12 +452,13 @@ OmitKeyof.refetchIntervalInBackground optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -472,12 +475,13 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -494,12 +498,13 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -516,12 +521,13 @@ OmitKeyof.refetchOnWindowFocus optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -538,7 +544,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -562,10 +568,11 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -582,7 +589,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -613,12 +620,13 @@ OmitKeyof.select optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -651,12 +659,13 @@ Setting `suspense` to `false` will be a no-op. optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/solid/reference/interfaces/InfiniteQueryPageParamsOptions.md index fe9de05a51e..b22eacacbd4 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryPageParamsOptions.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryPageParamsOptions title: InfiniteQueryPageParamsOptions --- -Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) +Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L347) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/q getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -40,7 +40,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -53,7 +53,7 @@ The result will also be used to determine the value of `hasPreviousPage`. initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from diff --git a/docs/framework/solid/reference/interfaces/InitialPageParam.md b/docs/framework/solid/reference/interfaces/InitialPageParam.md index ffbf32ae0d6..2d42bf029a4 100644 --- a/docs/framework/solid/reference/interfaces/InitialPageParam.md +++ b/docs/framework/solid/reference/interfaces/InitialPageParam.md @@ -3,7 +3,7 @@ id: InitialPageParam title: InitialPageParam --- -Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) +Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L343) ## Extended by @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/q initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) diff --git a/docs/framework/solid/reference/interfaces/InvalidateOptions.md b/docs/framework/solid/reference/interfaces/InvalidateOptions.md index 1cd96c88165..d83ecd43ec0 100644 --- a/docs/framework/solid/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/solid/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L713) +Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/solid/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/solid/reference/interfaces/InvalidateQueryFilters.md index 35fd04b9378..36eb3f27998 100644 --- a/docs/framework/solid/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/solid/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) +Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -26,7 +26,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -42,7 +42,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -58,7 +58,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -84,7 +84,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -100,7 +100,7 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) +Defined in: [packages/query-core/src/types.ts:717](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L717) Controls which of the matched (now-invalidated) queries are refetched in the background. Defaults to `'active'`. @@ -117,7 +117,7 @@ Defaults to `'active'`. optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -133,10 +133,12 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries +Defaults to `'all'`. + #### Inherited from [`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/solid/reference/interfaces/MutateOptions.md b/docs/framework/solid/reference/interfaces/MutateOptions.md index 6e27e4e6d29..b12b3b29ec2 100644 --- a/docs/framework/solid/reference/interfaces/MutateOptions.md +++ b/docs/framework/solid/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1247) +Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1282) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1235](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1235) +Defined in: [packages/query-core/src/types.ts:1270](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1270) #### Parameters diff --git a/docs/framework/solid/reference/interfaces/MutationFilters.md b/docs/framework/solid/reference/interfaces/MutationFilters.md index 378a411bfe5..fbc0208e8e1 100644 --- a/docs/framework/solid/reference/interfaces/MutationFilters.md +++ b/docs/framework/solid/reference/interfaces/MutationFilters.md @@ -3,7 +3,7 @@ id: MutationFilters title: MutationFilters --- -Defined in: [packages/query-core/src/utils.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L62) +Defined in: [packages/query-core/src/utils.ts:64](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L64) Filters used to select mutations, for example in `mutationCache.findAll` or `queryClient.isMutating`. All provided filters must match; filters that are left unspecified are ignored. @@ -34,7 +34,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L71) +Defined in: [packages/query-core/src/utils.ts:73](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L73) Match mutation key exactly @@ -46,7 +46,7 @@ Match mutation key exactly optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/utils.ts:81](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L81) +Defined in: [packages/query-core/src/utils.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L83) Include mutations matching this mutation key @@ -58,7 +58,7 @@ Include mutations matching this mutation key optional predicate: (mutation) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L75) +Defined in: [packages/query-core/src/utils.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L77) Include mutations matching this predicate function @@ -80,6 +80,6 @@ Include mutations matching this predicate function optional status: MutationStatus; ``` -Defined in: [packages/query-core/src/utils.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L85) +Defined in: [packages/query-core/src/utils.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L87) Filter by mutation status diff --git a/docs/framework/solid/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/solid/reference/interfaces/MutationObserverBaseResult.md index 190d4d4d3b6..e1c09a56737 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) +Defined in: [packages/query-core/src/types.ts:1315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1315) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1289) +Defined in: [packages/query-core/src/types.ts:1324](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1324) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1298) +Defined in: [packages/query-core/src/types.ts:1333](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1333) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1303) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1308) +Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1313](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1313) +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1318](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1318) +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1327](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1327) +Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1293](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1293) +Defined in: [packages/query-core/src/types.ts:1328](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1328) The variables object passed to the `mutationFn`. diff --git a/docs/framework/solid/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/solid/reference/interfaces/MutationObserverErrorResult.md index 03af3a33d12..cce591e3465 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) +Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1399](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1399) +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) +Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1402) +Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1403](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1403) +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1404) +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1405](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1405) +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) +Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) The variables object passed to the `mutationFn`. diff --git a/docs/framework/solid/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/solid/reference/interfaces/MutationObserverIdleResult.md index 833db327a04..b7892846a6c 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) +Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1356](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1356) +Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1359](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1359) +Defined in: [packages/query-core/src/types.ts:1394](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1394) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1360) +Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1361) +Defined in: [packages/query-core/src/types.ts:1396](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1396) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) +Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1357](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1357) +Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) The variables object passed to the `mutationFn`. diff --git a/docs/framework/solid/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/solid/reference/interfaces/MutationObserverLoadingResult.md index 6732628f444..d4368822213 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) +Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1379](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1379) +Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) +Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1381](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1381) +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) +Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1383](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1383) +Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1384](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1384) +Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1378](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1378) +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) The variables object passed to the `mutationFn`. diff --git a/docs/framework/solid/reference/interfaces/MutationObserverOptions.md b/docs/framework/solid/reference/interfaces/MutationObserverOptions.md index 6723cfd8f25..d21a77b5505 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1220) +Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1255) ## Extends @@ -35,7 +35,12 @@ Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) + +The time in milliseconds that an unused/inactive mutation remains in memory before it is +garbage collected. + +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. #### Inherited from @@ -51,7 +56,7 @@ MutationOptions.gcTime optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) #### Inherited from @@ -67,7 +72,7 @@ MutationOptions.meta optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) #### Inherited from @@ -83,7 +88,7 @@ MutationOptions.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Inherited from @@ -99,7 +104,13 @@ MutationOptions.mutationKey optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. #### Inherited from @@ -115,7 +126,7 @@ MutationOptions.networkMode optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -153,7 +164,7 @@ MutationOptions.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) #### Parameters @@ -183,7 +194,7 @@ MutationOptions.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) #### Parameters @@ -225,7 +236,7 @@ MutationOptions.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) +Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) #### Parameters @@ -263,7 +274,14 @@ MutationOptions.onSuccess optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) + +If `false`, failed mutations will not retry by default. +If `true`, failed mutations will retry infinitely. +If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. +If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + +Defaults to `0`. #### Inherited from @@ -279,7 +297,12 @@ MutationOptions.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) +Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +Defaults to a function that applies exponential backoff, capped at 30 seconds. #### Inherited from @@ -295,7 +318,7 @@ MutationOptions.retryDelay optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) +Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) #### Inherited from @@ -311,4 +334,4 @@ MutationOptions.scope optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) +Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) diff --git a/docs/framework/solid/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/solid/reference/interfaces/MutationObserverSuccessResult.md index 89e8c2739cc..52cdcc4883e 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) +Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1420](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1420) +Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) +Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1423](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1423) +Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1424](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1424) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1425) +Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1426](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1426) +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) +Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) The variables object passed to the `mutationFn`. diff --git a/docs/framework/solid/reference/interfaces/MutationOptions.md b/docs/framework/solid/reference/interfaces/MutationOptions.md index e6a95221aec..65bdaee667b 100644 --- a/docs/framework/solid/reference/interfaces/MutationOptions.md +++ b/docs/framework/solid/reference/interfaces/MutationOptions.md @@ -45,7 +45,12 @@ The type returned by `onMutate`, passed on to `onSuccess`/`onError`/`onSettled`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) + +The time in milliseconds that an unused/inactive mutation remains in memory before it is +garbage collected. + +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. #### Inherited from @@ -59,7 +64,7 @@ Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) #### Inherited from @@ -73,7 +78,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) #### Inherited from @@ -89,7 +94,7 @@ OmitKeyof.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Inherited from @@ -103,7 +108,13 @@ Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. #### Inherited from @@ -117,7 +128,7 @@ Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -155,7 +166,7 @@ OmitKeyof.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) #### Parameters @@ -185,7 +196,7 @@ OmitKeyof.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) #### Parameters @@ -227,7 +238,7 @@ OmitKeyof.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) +Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) #### Parameters @@ -265,7 +276,14 @@ OmitKeyof.onSuccess optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) + +If `false`, failed mutations will not retry by default. +If `true`, failed mutations will retry infinitely. +If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. +If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + +Defaults to `0`. #### Inherited from @@ -281,7 +299,12 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) +Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +Defaults to a function that applies exponential backoff, capped at 30 seconds. #### Inherited from @@ -297,7 +320,7 @@ OmitKeyof.retryDelay optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) +Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) #### Inherited from @@ -311,7 +334,7 @@ Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) +Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) #### Inherited from diff --git a/docs/framework/solid/reference/interfaces/NotifyEvent.md b/docs/framework/solid/reference/interfaces/NotifyEvent.md index 17b3241654f..5e7875d41b8 100644 --- a/docs/framework/solid/reference/interfaces/NotifyEvent.md +++ b/docs/framework/solid/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) +Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1519) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1485) +Defined in: [packages/query-core/src/types.ts:1520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1520) diff --git a/docs/framework/solid/reference/interfaces/QueriesObserverOptions.md b/docs/framework/solid/reference/interfaces/QueriesObserverOptions.md index 16035c45714..68e7913885d 100644 --- a/docs/framework/solid/reference/interfaces/QueriesObserverOptions.md +++ b/docs/framework/solid/reference/interfaces/QueriesObserverOptions.md @@ -19,9 +19,11 @@ Defined in: [packages/query-core/src/queriesObserver.ts:23](https://github.com/T optional combine: CombineFn; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L32) +Defined in: [packages/query-core/src/queriesObserver.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L34) A function that combines the array of `QueryObserverResult`s (one per observed query) into a single value. The combined value is memoized and only recomputed when one of the underlying results, the query hashes, or the `combine` function itself changes. + +Defaults to returning the array of `QueryObserverResult`s unchanged. diff --git a/docs/framework/solid/reference/interfaces/QueryClientConfig.md b/docs/framework/solid/reference/interfaces/QueryClientConfig.md index 3f56d75ffdd..c1d293540dc 100644 --- a/docs/framework/solid/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/solid/reference/interfaces/QueryClientConfig.md @@ -37,7 +37,7 @@ QueryCoreClientConfig.defaultOptions optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1447](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1447) +Defined in: [packages/query-core/src/types.ts:1482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1482) The mutation cache this client is connected to. A new `MutationCache` is created if not provided. @@ -56,7 +56,7 @@ QueryCoreClientConfig.mutationCache optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) +Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/solid/reference/interfaces/QueryExecuteOptions.md b/docs/framework/solid/reference/interfaces/QueryExecuteOptions.md index ce40aa09805..d2ebd296f94 100644 --- a/docs/framework/solid/reference/interfaces/QueryExecuteOptions.md +++ b/docs/framework/solid/reference/interfaces/QueryExecuteOptions.md @@ -3,7 +3,7 @@ id: QueryExecuteOptions title: QueryExecuteOptions --- -Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L555) +Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) ## Extends @@ -43,7 +43,7 @@ Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -70,7 +70,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -93,7 +93,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -111,7 +111,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) +Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L577) *** @@ -121,7 +121,7 @@ Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -139,7 +139,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -158,7 +158,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -180,7 +180,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -201,7 +201,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -223,7 +223,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -242,7 +242,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -265,7 +265,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -283,12 +283,13 @@ WithRequired.queryKeyHashFn optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -305,7 +306,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -329,7 +330,7 @@ WithRequired.retryDelay optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L567) +Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L578) #### Parameters @@ -349,7 +350,7 @@ Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:572](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L572) +Defined in: [packages/query-core/src/types.ts:583](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L583) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -362,10 +363,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/solid/reference/interfaces/QueryFilters.md b/docs/framework/solid/reference/interfaces/QueryFilters.md index 6b177d93aa5..749e4283d0d 100644 --- a/docs/framework/solid/reference/interfaces/QueryFilters.md +++ b/docs/framework/solid/reference/interfaces/QueryFilters.md @@ -27,7 +27,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -39,7 +39,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -51,7 +51,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -73,7 +73,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -85,7 +85,7 @@ Include queries matching this query key optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -97,6 +97,8 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries + +Defaults to `'all'`. diff --git a/docs/framework/solid/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/solid/reference/interfaces/QueryObserverBaseResult.md index 4689d9d661a..1b54d6f8041 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L743) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) +Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) +Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) +Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) +Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) +Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/solid/reference/interfaces/QueryObserverLoadingErrorResult.md index 86ae34b80ab..7a4f855305f 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) +Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) +Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/solid/reference/interfaces/QueryObserverLoadingResult.md index a0024077883..8f94574bcca 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) +Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) +Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverOptions.md b/docs/framework/solid/reference/interfaces/QueryObserverOptions.md index 6d15caaee3e..0b082b386e5 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverOptions.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverOptions.md @@ -58,11 +58,12 @@ is shared with an infinite query's observer options. Defaults to `never` for reg optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -79,7 +80,7 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -104,7 +105,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -127,7 +128,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -145,7 +146,7 @@ OmitKeyof.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -161,7 +162,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -178,7 +179,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -198,7 +199,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -220,7 +221,7 @@ OmitKeyof.notifyOnChangeProps optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -241,7 +242,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -261,7 +262,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -283,7 +284,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -300,7 +301,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -323,7 +324,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -356,10 +357,11 @@ Defaults reconciliation to false. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -376,7 +378,7 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -395,12 +397,13 @@ OmitKeyof.refetchIntervalInBackground optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -417,12 +420,13 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -439,12 +443,13 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -461,12 +466,13 @@ OmitKeyof.refetchOnWindowFocus optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -483,7 +489,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -507,10 +513,11 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -527,7 +534,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -558,12 +565,13 @@ OmitKeyof.select optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -580,10 +588,11 @@ OmitKeyof.staleTime optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. #### Inherited from @@ -600,12 +609,13 @@ OmitKeyof.suspense optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/solid/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/solid/reference/interfaces/QueryObserverPendingResult.md index 21fab248a7c..41a101c7c8c 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:875](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L875) +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:876](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L876) +Defined in: [packages/query-core/src/types.ts:887](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L887) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) +Defined in: [packages/query-core/src/types.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L888) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) +Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/solid/reference/interfaces/QueryObserverPlaceholderResult.md index 89af2502c11..cce7cffcc9b 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) +Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) +Defined in: [packages/query-core/src/types.ts:969](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L969) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) +Defined in: [packages/query-core/src/types.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L970) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) +Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) +Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) +Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) +Defined in: [packages/query-core/src/types.ts:972](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L972) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/solid/reference/interfaces/QueryObserverRefetchErrorResult.md index dab5586fdc1..8486e8cf4cb 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) +Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) +Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/solid/reference/interfaces/QueryObserverSuccessResult.md index b180b89ca62..f126bea0f70 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) +Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) +Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) +Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) +Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryOptions.md b/docs/framework/solid/reference/interfaces/QueryOptions.md index 0dfd58c29a3..ce20ed0bbd1 100644 --- a/docs/framework/solid/reference/interfaces/QueryOptions.md +++ b/docs/framework/solid/reference/interfaces/QueryOptions.md @@ -65,11 +65,12 @@ Defaults to `false`. optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -84,7 +85,7 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -109,7 +110,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -130,7 +131,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -146,7 +147,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -162,7 +163,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -179,7 +180,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -199,7 +200,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -219,7 +220,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -282,7 +283,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -300,7 +301,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -320,7 +321,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -337,7 +338,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -358,7 +359,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -393,10 +394,11 @@ Defaults reconciliation to false. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -411,7 +413,7 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -428,12 +430,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -448,12 +451,13 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -468,12 +472,13 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -488,12 +493,13 @@ Defaults to `true`. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -508,7 +514,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -530,10 +536,11 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -548,7 +555,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -577,12 +584,13 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -617,12 +625,13 @@ Setting `suspense` to `false` will be a no-op. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/solid/reference/interfaces/RefetchOptions.md b/docs/framework/solid/reference/interfaces/RefetchOptions.md index b502dcd3492..104412c5bac 100644 --- a/docs/framework/solid/reference/interfaces/RefetchOptions.md +++ b/docs/framework/solid/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L684) +Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,7 +38,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/solid/reference/interfaces/RefetchQueryFilters.md b/docs/framework/solid/reference/interfaces/RefetchQueryFilters.md index 84f917c6201..bde28360fa1 100644 --- a/docs/framework/solid/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/solid/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:709](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L709) +Defined in: [packages/query-core/src/types.ts:720](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L720) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -26,7 +26,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -42,7 +42,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -58,7 +58,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -84,7 +84,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -100,7 +100,7 @@ Include queries matching this query key optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -116,10 +116,12 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries +Defaults to `'all'`. + #### Inherited from [`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/solid/reference/interfaces/ResetOptions.md b/docs/framework/solid/reference/interfaces/ResetOptions.md index 1855fef3064..6d3a8398fbb 100644 --- a/docs/framework/solid/reference/interfaces/ResetOptions.md +++ b/docs/framework/solid/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L714) +Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/solid/reference/interfaces/ResultOptions.md b/docs/framework/solid/reference/interfaces/ResultOptions.md index 9766c56d1a6..f3da151a3ec 100644 --- a/docs/framework/solid/reference/interfaces/ResultOptions.md +++ b/docs/framework/solid/reference/interfaces/ResultOptions.md @@ -3,7 +3,7 @@ id: ResultOptions title: ResultOptions --- -Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) +Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L686) ## Extended by @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/solid/reference/interfaces/SetDataOptions.md b/docs/framework/solid/reference/interfaces/SetDataOptions.md index 4262e781b05..cac83e9312a 100644 --- a/docs/framework/solid/reference/interfaces/SetDataOptions.md +++ b/docs/framework/solid/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1471) +Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1506) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1472](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1472) +Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) diff --git a/docs/framework/solid/reference/interfaces/UseBaseQueryOptions.md b/docs/framework/solid/reference/interfaces/UseBaseQueryOptions.md index 6f68c56b4c3..299c55e9f67 100644 --- a/docs/framework/solid/reference/interfaces/UseBaseQueryOptions.md +++ b/docs/framework/solid/reference/interfaces/UseBaseQueryOptions.md @@ -73,11 +73,12 @@ Defaults to `false`. optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -94,7 +95,7 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -119,7 +120,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -142,7 +143,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -160,7 +161,7 @@ OmitKeyof.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -176,7 +177,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -193,7 +194,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -213,7 +214,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -235,7 +236,7 @@ OmitKeyof.notifyOnChangeProps optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -300,7 +301,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -320,7 +321,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -342,7 +343,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -359,7 +360,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -382,7 +383,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -421,10 +422,11 @@ OmitKeyof.reconcile optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -441,7 +443,7 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -460,12 +462,13 @@ OmitKeyof.refetchIntervalInBackground optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -482,12 +485,13 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -504,12 +508,13 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -526,12 +531,13 @@ OmitKeyof.refetchOnWindowFocus optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -548,7 +554,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -572,10 +578,11 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -592,7 +599,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -623,12 +630,13 @@ OmitKeyof.select optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -661,12 +669,13 @@ Setting `suspense` to `false` will be a no-op. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/solid/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/solid/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md index 733a1a5ad75..4412ad00c8e 100644 --- a/docs/framework/solid/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md +++ b/docs/framework/solid/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedInfiniteQueryObserverOptions type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:538](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L538) +Defined in: [packages/query-core/src/types.ts:549](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L549) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/solid/reference/type-aliases/DefaultedQueryObserverOptions.md index 1b4309f150c..9ce8401b128 100644 --- a/docs/framework/solid/reference/type-aliases/DefaultedQueryObserverOptions.md +++ b/docs/framework/solid/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedQueryObserverOptions type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L509) +Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index d82cfa37d51..cec33b142b7 100644 --- a/docs/framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) +Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/solid/reference/type-aliases/DefinedQueryObserverResult.md index 97fcae175a9..b4480af3810 100644 --- a/docs/framework/solid/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/solid/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) +Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/solid/reference/type-aliases/EnsureInfiniteQueryDataOptions.md index 305eef94893..ff75b1c3449 100644 --- a/docs/framework/solid/reference/type-aliases/EnsureInfiniteQueryDataOptions.md +++ b/docs/framework/solid/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -7,7 +7,7 @@ title: EnsureInfiniteQueryDataOptions type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; ``` -Defined in: [packages/query-core/src/types.ts:612](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L612) +Defined in: [packages/query-core/src/types.ts:623](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L623) ## Type Declaration diff --git a/docs/framework/solid/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/solid/reference/type-aliases/FetchInfiniteQueryOptions.md index 1ee1470b14a..c926bbd3ae5 100644 --- a/docs/framework/solid/reference/type-aliases/FetchInfiniteQueryOptions.md +++ b/docs/framework/solid/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: FetchInfiniteQueryOptions type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L656) +Defined in: [packages/query-core/src/types.ts:667](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L667) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/FetchStatus.md b/docs/framework/solid/reference/type-aliases/FetchStatus.md index 7b71e54eacd..b347069e97e 100644 --- a/docs/framework/solid/reference/type-aliases/FetchStatus.md +++ b/docs/framework/solid/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:752](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L752) diff --git a/docs/framework/solid/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/solid/reference/type-aliases/InfiniteQueryExecuteOptions.md index 29c974cfddf..c198662a319 100644 --- a/docs/framework/solid/reference/type-aliases/InfiniteQueryExecuteOptions.md +++ b/docs/framework/solid/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -7,7 +7,7 @@ title: InfiniteQueryExecuteOptions type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:635](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L635) +Defined in: [packages/query-core/src/types.ts:646](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L646) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/solid/reference/type-aliases/InfiniteQueryObserverResult.md index 7a646bc1c38..42279b19c00 100644 --- a/docs/framework/solid/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/solid/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) +Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/MutateFunction.md b/docs/framework/solid/reference/type-aliases/MutateFunction.md index 284bd0fc270..558040d3439 100644 --- a/docs/framework/solid/reference/type-aliases/MutateFunction.md +++ b/docs/framework/solid/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1271) +Defined in: [packages/query-core/src/types.ts:1306](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1306) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/MutateFunctionRest.md b/docs/framework/solid/reference/type-aliases/MutateFunctionRest.md index a2f16ea5302..3e7a5217482 100644 --- a/docs/framework/solid/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/solid/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1256) +Defined in: [packages/query-core/src/types.ts:1291](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1291) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/MutationFunction.md b/docs/framework/solid/reference/type-aliases/MutationFunction.md index 4c8c7aed384..330af1ef65a 100644 --- a/docs/framework/solid/reference/type-aliases/MutationFunction.md +++ b/docs/framework/solid/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/MutationFunctionContext.md b/docs/framework/solid/reference/type-aliases/MutationFunctionContext.md index ef228cc53d3..97de2f1c220 100644 --- a/docs/framework/solid/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/solid/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) +Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1169) +Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1180) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1170) +Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) +Defined in: [packages/query-core/src/types.ts:1182](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1182) diff --git a/docs/framework/solid/reference/type-aliases/MutationKey.md b/docs/framework/solid/reference/type-aliases/MutationKey.md index 7157d6052fd..8e9d3bc3b3a 100644 --- a/docs/framework/solid/reference/type-aliases/MutationKey.md +++ b/docs/framework/solid/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) diff --git a/docs/framework/solid/reference/type-aliases/MutationMeta.md b/docs/framework/solid/reference/type-aliases/MutationMeta.md index f3bf9984fab..474c593e206 100644 --- a/docs/framework/solid/reference/type-aliases/MutationMeta.md +++ b/docs/framework/solid/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1160](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1160) +Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) diff --git a/docs/framework/solid/reference/type-aliases/MutationObserverResult.md b/docs/framework/solid/reference/type-aliases/MutationObserverResult.md index 3390192e071..21e43836bf6 100644 --- a/docs/framework/solid/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/solid/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) +Defined in: [packages/query-core/src/types.ts:1464](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1464) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/MutationScope.md b/docs/framework/solid/reference/type-aliases/MutationScope.md index a2511c903d9..feac9d9d17a 100644 --- a/docs/framework/solid/reference/type-aliases/MutationScope.md +++ b/docs/framework/solid/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) +Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1167) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) +Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) diff --git a/docs/framework/solid/reference/type-aliases/MutationStatus.md b/docs/framework/solid/reference/type-aliases/MutationStatus.md index d9b58cdd26f..4cd2d3c9535 100644 --- a/docs/framework/solid/reference/type-aliases/MutationStatus.md +++ b/docs/framework/solid/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1154](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1154) +Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) diff --git a/docs/framework/solid/reference/type-aliases/NotifyEventType.md b/docs/framework/solid/reference/type-aliases/NotifyEventType.md index 94912df6c6b..9bbc85e4ce8 100644 --- a/docs/framework/solid/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/solid/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) +Defined in: [packages/query-core/src/types.ts:1510](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1510) diff --git a/docs/framework/solid/reference/type-aliases/QueryObserverResult.md b/docs/framework/solid/reference/type-aliases/QueryObserverResult.md index f5c6c95d5f2..4fc661a6c9d 100644 --- a/docs/framework/solid/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/solid/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) +Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/QueryStatus.md b/docs/framework/solid/reference/type-aliases/QueryStatus.md index 3fc872e604b..6679b8b17c6 100644 --- a/docs/framework/solid/reference/type-aliases/QueryStatus.md +++ b/docs/framework/solid/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:740](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L740) +Defined in: [packages/query-core/src/types.ts:751](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L751) diff --git a/docs/framework/solid/reference/type-aliases/SkipToken.md b/docs/framework/solid/reference/type-aliases/SkipToken.md index 176c23830d2..3a5791b982e 100644 --- a/docs/framework/solid/reference/type-aliases/SkipToken.md +++ b/docs/framework/solid/reference/type-aliases/SkipToken.md @@ -7,6 +7,6 @@ title: SkipToken type SkipToken = typeof skipToken; ``` -Defined in: [packages/query-core/src/utils.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L524) +Defined in: [packages/query-core/src/utils.ts:526](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L526) The type of the [skipToken](../variables/skipToken.md) sentinel value. diff --git a/docs/framework/solid/reference/type-aliases/ThrowOnError.md b/docs/framework/solid/reference/type-aliases/ThrowOnError.md index 60ad44c1cd1..613549e4d52 100644 --- a/docs/framework/solid/reference/type-aliases/ThrowOnError.md +++ b/docs/framework/solid/reference/type-aliases/ThrowOnError.md @@ -7,7 +7,7 @@ title: ThrowOnError type ThrowOnError = boolean | (error, query) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L361) +Defined in: [packages/query-core/src/types.ts:363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L363) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/Updater.md b/docs/framework/solid/reference/type-aliases/Updater.md index b6a29ccc5fc..7a0c2f30503 100644 --- a/docs/framework/solid/reference/type-aliases/Updater.md +++ b/docs/framework/solid/reference/type-aliases/Updater.md @@ -7,7 +7,7 @@ title: Updater type Updater = TOutput | (input) => TOutput; ``` -Defined in: [packages/query-core/src/utils.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L103) +Defined in: [packages/query-core/src/utils.ts:105](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L105) Either a plain value of type `TOutput`, or a function that receives `TInput` and returns `TOutput`. Used for example by `setQueryData`-style updaters, which accept either the new data directly or a diff --git a/docs/framework/solid/reference/type-aliases/WithRequired.md b/docs/framework/solid/reference/type-aliases/WithRequired.md index c8ef831db3c..deb87dfe4a4 100644 --- a/docs/framework/solid/reference/type-aliases/WithRequired.md +++ b/docs/framework/solid/reference/type-aliases/WithRequired.md @@ -7,7 +7,7 @@ title: WithRequired type WithRequired = TTarget & { [_ in TKey]: {} }; ``` -Defined in: [packages/query-core/src/types.ts:505](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L505) +Defined in: [packages/query-core/src/types.ts:516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L516) ## Type Parameters diff --git a/docs/framework/solid/reference/variables/isServer.md b/docs/framework/solid/reference/variables/isServer.md index 28956d55cbf..16aa39d1244 100644 --- a/docs/framework/solid/reference/variables/isServer.md +++ b/docs/framework/solid/reference/variables/isServer.md @@ -7,7 +7,7 @@ title: isServer const isServer: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L112) +Defined in: [packages/query-core/src/utils.ts:114](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L114) ## Deprecated diff --git a/docs/framework/solid/reference/variables/skipToken.md b/docs/framework/solid/reference/variables/skipToken.md index 3163e91c1c2..a390d0b7b66 100644 --- a/docs/framework/solid/reference/variables/skipToken.md +++ b/docs/framework/solid/reference/variables/skipToken.md @@ -7,7 +7,7 @@ title: skipToken const skipToken: typeof skipToken; ``` -Defined in: [packages/query-core/src/utils.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L520) +Defined in: [packages/query-core/src/utils.ts:522](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L522) Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`, diff --git a/docs/framework/svelte/reference/classes/QueriesObserver.md b/docs/framework/svelte/reference/classes/QueriesObserver.md index a40f2d2bef6..379e6fc95ee 100644 --- a/docs/framework/svelte/reference/classes/QueriesObserver.md +++ b/docs/framework/svelte/reference/classes/QueriesObserver.md @@ -3,7 +3,7 @@ id: QueriesObserver title: QueriesObserver --- -Defined in: [packages/query-core/src/queriesObserver.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L54) +Defined in: [packages/query-core/src/queriesObserver.ts:56](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L56) A `QueriesObserver` watches an array of queries at once, exposing them as a single array of `QueryObserverResult`s (or, when a `combine` option is @@ -45,7 +45,7 @@ new QueriesObserver( options?): QueriesObserver; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L68) +Defined in: [packages/query-core/src/queriesObserver.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L70) #### Parameters @@ -95,7 +95,7 @@ Subscribable.listeners destroy(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L104) +Defined in: [packages/query-core/src/queriesObserver.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L106) Stops observing all queries: clears all listeners and destroys every underlying `QueryObserver` this observer manages. @@ -112,7 +112,7 @@ underlying `QueryObserver` this observer manages. getCurrentResult(): QueryObserverResult[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L208) +Defined in: [packages/query-core/src/queriesObserver.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L210) Returns the most recently computed array of `QueryObserverResult`s, one per observed query, in the same order as the queries passed to the @@ -137,7 +137,7 @@ const data = results.map((result) => result.data) getObservers(): QueryObserver[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L225) +Defined in: [packages/query-core/src/queriesObserver.ts:227](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L227) Returns the underlying `QueryObserver` instances this observer manages, in the same order as the queries passed to the constructor or @@ -155,7 +155,7 @@ in the same order as the queries passed to the constructor or getOptimisticResult(queries, combine): [QueryObserverResult[], (r?) => TCombinedResult, () => QueryObserverResult[]]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L236) +Defined in: [packages/query-core/src/queriesObserver.ts:238](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L238) The `QueriesObserver` counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult) — computes the result for the given (already-defaulted) queries right now, synchronously. Called by @@ -185,7 +185,7 @@ wrap the results for property-access tracking. getQueries(): Query[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:216](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L216) +Defined in: [packages/query-core/src/queriesObserver.ts:218](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L218) Returns the underlying `Query` instances currently being observed, in the same order as the queries passed to the constructor or `setQueries`. @@ -222,7 +222,7 @@ Subscribable.hasListeners protected onSubscribe(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L84) +Defined in: [packages/query-core/src/queriesObserver.ts:86](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L86) #### Returns @@ -242,7 +242,7 @@ Subscribable.onSubscribe protected onUnsubscribe(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L94) +Defined in: [packages/query-core/src/queriesObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L96) #### Returns @@ -262,7 +262,7 @@ Subscribable.onUnsubscribe setQueries(queries, options?): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:125](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L125) +Defined in: [packages/query-core/src/queriesObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L127) Replaces the set of queries being observed. Existing `QueryObserver`s are reused for queries that match an already-observed query hash; diff --git a/docs/framework/svelte/reference/functions/hashKey.md b/docs/framework/svelte/reference/functions/hashKey.md index 9e7844aa09d..dc774c032ce 100644 --- a/docs/framework/svelte/reference/functions/hashKey.md +++ b/docs/framework/svelte/reference/functions/hashKey.md @@ -7,7 +7,7 @@ title: hashKey function hashKey(queryKey): string; ``` -Defined in: [packages/query-core/src/utils.ts:282](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L282) +Defined in: [packages/query-core/src/utils.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L284) Default query & mutation keys hash function. Hashes the value into a stable hash. diff --git a/docs/framework/svelte/reference/functions/keepPreviousData.md b/docs/framework/svelte/reference/functions/keepPreviousData.md index d41c7d7c726..6a84f4c5970 100644 --- a/docs/framework/svelte/reference/functions/keepPreviousData.md +++ b/docs/framework/svelte/reference/functions/keepPreviousData.md @@ -7,7 +7,7 @@ title: keepPreviousData function keepPreviousData(previousData): T | undefined; ``` -Defined in: [packages/query-core/src/utils.ts:491](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L491) +Defined in: [packages/query-core/src/utils.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L493) Intended to be passed as a query's `placeholderData` option, for example `placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new diff --git a/docs/framework/svelte/reference/functions/matchMutation.md b/docs/framework/svelte/reference/functions/matchMutation.md index 79468dcfad9..40210da4cf1 100644 --- a/docs/framework/svelte/reference/functions/matchMutation.md +++ b/docs/framework/svelte/reference/functions/matchMutation.md @@ -7,7 +7,7 @@ title: matchMutation function matchMutation(filters, mutation): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:235](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L235) +Defined in: [packages/query-core/src/utils.ts:237](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L237) Checks whether a mutation matches the given [MutationFilters](../interfaces/MutationFilters.md). Every filter that is specified must match; filters that are left unspecified are ignored. diff --git a/docs/framework/svelte/reference/functions/matchQuery.md b/docs/framework/svelte/reference/functions/matchQuery.md index f98fe5f3537..4c54b2df995 100644 --- a/docs/framework/svelte/reference/functions/matchQuery.md +++ b/docs/framework/svelte/reference/functions/matchQuery.md @@ -7,7 +7,7 @@ title: matchQuery function matchQuery(filters, query): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L173) +Defined in: [packages/query-core/src/utils.ts:175](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L175) Checks whether a query matches the given [QueryFilters](../interfaces/QueryFilters.md). Every filter that is specified must match; filters that are left unspecified are ignored. diff --git a/docs/framework/svelte/reference/functions/noop.md b/docs/framework/svelte/reference/functions/noop.md index fd1b8dc2ad0..01fb409f4e9 100644 --- a/docs/framework/svelte/reference/functions/noop.md +++ b/docs/framework/svelte/reference/functions/noop.md @@ -9,7 +9,7 @@ title: noop function noop(): void; ``` -Defined in: [packages/query-core/src/utils.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L117) +Defined in: [packages/query-core/src/utils.ts:119](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L119) A function that does nothing. @@ -23,7 +23,7 @@ A function that does nothing. function noop(): undefined; ``` -Defined in: [packages/query-core/src/utils.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L118) +Defined in: [packages/query-core/src/utils.ts:120](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L120) A function that does nothing. diff --git a/docs/framework/svelte/reference/functions/partialMatchKey.md b/docs/framework/svelte/reference/functions/partialMatchKey.md index 3795de85b95..4db67323e9b 100644 --- a/docs/framework/svelte/reference/functions/partialMatchKey.md +++ b/docs/framework/svelte/reference/functions/partialMatchKey.md @@ -7,7 +7,7 @@ title: partialMatchKey function partialMatchKey(a, b): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L298) +Defined in: [packages/query-core/src/utils.ts:300](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L300) Checks if key `b` partially matches with key `a`. diff --git a/docs/framework/svelte/reference/functions/replaceEqualDeep.md b/docs/framework/svelte/reference/functions/replaceEqualDeep.md index 77a393196ef..6a81c3907fb 100644 --- a/docs/framework/svelte/reference/functions/replaceEqualDeep.md +++ b/docs/framework/svelte/reference/functions/replaceEqualDeep.md @@ -10,7 +10,7 @@ function replaceEqualDeep( depth?): T; ``` -Defined in: [packages/query-core/src/utils.ts:337](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L337) +Defined in: [packages/query-core/src/utils.ts:339](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L339) This function returns `a` if `b` is deeply equal. If not, it will replace any deeply equal children of `b` with those of `a`. diff --git a/docs/framework/svelte/reference/functions/shouldThrowError.md b/docs/framework/svelte/reference/functions/shouldThrowError.md index 3146617391e..1f1e62a8d0e 100644 --- a/docs/framework/svelte/reference/functions/shouldThrowError.md +++ b/docs/framework/svelte/reference/functions/shouldThrowError.md @@ -7,7 +7,7 @@ title: shouldThrowError function shouldThrowError(throwOnError, params): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L574) +Defined in: [packages/query-core/src/utils.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L576) Resolves a `throwOnError` option to a boolean. If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller, diff --git a/docs/framework/svelte/reference/interfaces/CancelOptions.md b/docs/framework/svelte/reference/interfaces/CancelOptions.md index 14394c18533..f52c729f3b1 100644 --- a/docs/framework/svelte/reference/interfaces/CancelOptions.md +++ b/docs/framework/svelte/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1466) +Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1501) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1467) +Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1468) +Defined in: [packages/query-core/src/types.ts:1503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1503) diff --git a/docs/framework/svelte/reference/interfaces/DefaultOptions.md b/docs/framework/svelte/reference/interfaces/DefaultOptions.md index 026116d11db..67ae012f9ee 100644 --- a/docs/framework/svelte/reference/interfaces/DefaultOptions.md +++ b/docs/framework/svelte/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) +Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1487) ## Type Parameters @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/ optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) +Defined in: [packages/query-core/src/types.ts:1498](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1498) Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). @@ -31,7 +31,7 @@ Default options used when dehydrating the client's caches; see [DehydrateOptions optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1496](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1496) Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). @@ -67,7 +67,7 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) +Defined in: [packages/query-core/src/types.ts:1494](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1494) Default options applied to every mutation, unless overridden per-mutation. @@ -79,6 +79,6 @@ Default options applied to every mutation, unless overridden per-mutation. optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) +Defined in: [packages/query-core/src/types.ts:1489](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1489) Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/svelte/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/svelte/reference/interfaces/EnsureQueryDataOptions.md index d7b4751a9d3..d71a60902e6 100644 --- a/docs/framework/svelte/reference/interfaces/EnsureQueryDataOptions.md +++ b/docs/framework/svelte/reference/interfaces/EnsureQueryDataOptions.md @@ -3,7 +3,7 @@ id: EnsureQueryDataOptions title: EnsureQueryDataOptions --- -Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) +Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L606) ## Deprecated @@ -41,7 +41,7 @@ Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -66,7 +66,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -87,7 +87,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -103,7 +103,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) +Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) #### Inherited from @@ -117,7 +117,7 @@ Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -133,7 +133,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -150,7 +150,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -170,7 +170,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -189,7 +189,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -209,7 +209,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -226,7 +226,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -247,7 +247,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -263,12 +263,13 @@ If specified, this function is used to hash the `queryKey` to a string. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -283,7 +284,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -305,7 +306,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional revalidateIfStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L608) +Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L619) *** @@ -315,7 +316,7 @@ Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) +Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -332,10 +333,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/svelte/reference/interfaces/FetchNextPageOptions.md b/docs/framework/svelte/reference/interfaces/FetchNextPageOptions.md index d12afe35fe1..2c0be977140 100644 --- a/docs/framework/svelte/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/svelte/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L716) +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) +Defined in: [packages/query-core/src/types.ts:736](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L736) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/svelte/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/svelte/reference/interfaces/FetchPreviousPageOptions.md index 93ca92088f1..683e789ee52 100644 --- a/docs/framework/svelte/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/svelte/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) +Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L739) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:748](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L748) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/svelte/reference/interfaces/FetchQueryOptions.md b/docs/framework/svelte/reference/interfaces/FetchQueryOptions.md index 3b9347e06ea..634ae0e09f9 100644 --- a/docs/framework/svelte/reference/interfaces/FetchQueryOptions.md +++ b/docs/framework/svelte/reference/interfaces/FetchQueryOptions.md @@ -3,7 +3,7 @@ id: FetchQueryOptions title: FetchQueryOptions --- -Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L576) +Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L587) ## Deprecated @@ -45,7 +45,7 @@ Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -72,7 +72,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -95,7 +95,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -113,7 +113,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) +Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) *** @@ -123,7 +123,7 @@ Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -141,7 +141,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -160,7 +160,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -182,7 +182,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -203,7 +203,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -225,7 +225,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -244,7 +244,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -267,7 +267,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -285,12 +285,13 @@ WithRequired.queryKeyHashFn optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -307,7 +308,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -331,7 +332,7 @@ WithRequired.retryDelay optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) +Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -344,10 +345,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult.md index f1443c39625..9195e0727f8 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L991) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) +Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) +Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) +Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) +Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) +Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 7c55201c028..2841b5ab116 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) +Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) +Defined in: [packages/query-core/src/types.ts:1076](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1076) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) +Defined in: [packages/query-core/src/types.ts:1077](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1077) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) +Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult.md index f9541ebd73b..95ff84b3ef3 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) +Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) +Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) +Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) +Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverOptions.md index db1ca7f18fe..7d5b0dd1a4d 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverOptions.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverOptions title: InfiniteQueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) +Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L531) ## Extends @@ -39,11 +39,12 @@ Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/q optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -58,7 +59,7 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -81,7 +82,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -98,7 +99,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -117,7 +118,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -138,7 +139,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -154,7 +155,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from @@ -168,7 +169,7 @@ Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -184,7 +185,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -201,7 +202,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -221,7 +222,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -241,7 +242,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -260,7 +261,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -278,7 +279,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -298,7 +299,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -315,7 +316,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -336,7 +337,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -352,10 +353,11 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -370,7 +372,7 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -387,12 +389,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -407,12 +410,13 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -427,12 +431,13 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -447,12 +452,13 @@ Defaults to `true`. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -467,7 +473,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -489,10 +495,11 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -507,7 +514,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -536,12 +543,13 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -556,10 +564,11 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -574,10 +583,11 @@ Defaults to `true`. optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. #### Inherited from @@ -592,12 +602,13 @@ Defaults to `false`. optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult.md index 1bab3233ec9..c3e8b022cdb 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1027](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1027) +Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1029](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1029) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) +Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) +Defined in: [packages/query-core/src/types.ts:1042](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1042) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) +Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index 58310e1af49..e62579744ba 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) +Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) +Defined in: [packages/query-core/src/types.ts:1133](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1133) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) +Defined in: [packages/query-core/src/types.ts:1128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1128) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) +Defined in: [packages/query-core/src/types.ts:1129](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1129) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) +Defined in: [packages/query-core/src/types.ts:1132](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1132) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) +Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) +Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) +Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index 22ed760c153..a67e877f083 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1094](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1094) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) +Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) +Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) +Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 732c882f86f..0b875662cbc 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) +Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) +Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) +Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) +Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryPageParamsOptions.md index bfab8bfc319..afe27785edc 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryPageParamsOptions.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryPageParamsOptions title: InfiniteQueryPageParamsOptions --- -Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) +Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L347) ## Extends @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/q getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -44,7 +44,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -57,7 +57,7 @@ The result will also be used to determine the value of `hasPreviousPage`. initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from diff --git a/docs/framework/svelte/reference/interfaces/InitialPageParam.md b/docs/framework/svelte/reference/interfaces/InitialPageParam.md index ffbf32ae0d6..2d42bf029a4 100644 --- a/docs/framework/svelte/reference/interfaces/InitialPageParam.md +++ b/docs/framework/svelte/reference/interfaces/InitialPageParam.md @@ -3,7 +3,7 @@ id: InitialPageParam title: InitialPageParam --- -Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) +Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L343) ## Extended by @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/q initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) diff --git a/docs/framework/svelte/reference/interfaces/InvalidateOptions.md b/docs/framework/svelte/reference/interfaces/InvalidateOptions.md index 1cd96c88165..d83ecd43ec0 100644 --- a/docs/framework/svelte/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/svelte/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L713) +Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/svelte/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/svelte/reference/interfaces/InvalidateQueryFilters.md index 35fd04b9378..36eb3f27998 100644 --- a/docs/framework/svelte/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/svelte/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) +Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -26,7 +26,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -42,7 +42,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -58,7 +58,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -84,7 +84,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -100,7 +100,7 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) +Defined in: [packages/query-core/src/types.ts:717](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L717) Controls which of the matched (now-invalidated) queries are refetched in the background. Defaults to `'active'`. @@ -117,7 +117,7 @@ Defaults to `'active'`. optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -133,10 +133,12 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries +Defaults to `'all'`. + #### Inherited from [`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/svelte/reference/interfaces/MutateOptions.md b/docs/framework/svelte/reference/interfaces/MutateOptions.md index 6e27e4e6d29..b12b3b29ec2 100644 --- a/docs/framework/svelte/reference/interfaces/MutateOptions.md +++ b/docs/framework/svelte/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1247) +Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1282) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1235](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1235) +Defined in: [packages/query-core/src/types.ts:1270](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1270) #### Parameters diff --git a/docs/framework/svelte/reference/interfaces/MutationFilters.md b/docs/framework/svelte/reference/interfaces/MutationFilters.md index 378a411bfe5..fbc0208e8e1 100644 --- a/docs/framework/svelte/reference/interfaces/MutationFilters.md +++ b/docs/framework/svelte/reference/interfaces/MutationFilters.md @@ -3,7 +3,7 @@ id: MutationFilters title: MutationFilters --- -Defined in: [packages/query-core/src/utils.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L62) +Defined in: [packages/query-core/src/utils.ts:64](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L64) Filters used to select mutations, for example in `mutationCache.findAll` or `queryClient.isMutating`. All provided filters must match; filters that are left unspecified are ignored. @@ -34,7 +34,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L71) +Defined in: [packages/query-core/src/utils.ts:73](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L73) Match mutation key exactly @@ -46,7 +46,7 @@ Match mutation key exactly optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/utils.ts:81](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L81) +Defined in: [packages/query-core/src/utils.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L83) Include mutations matching this mutation key @@ -58,7 +58,7 @@ Include mutations matching this mutation key optional predicate: (mutation) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L75) +Defined in: [packages/query-core/src/utils.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L77) Include mutations matching this predicate function @@ -80,6 +80,6 @@ Include mutations matching this predicate function optional status: MutationStatus; ``` -Defined in: [packages/query-core/src/utils.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L85) +Defined in: [packages/query-core/src/utils.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L87) Filter by mutation status diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverBaseResult.md index 190d4d4d3b6..e1c09a56737 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) +Defined in: [packages/query-core/src/types.ts:1315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1315) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1289) +Defined in: [packages/query-core/src/types.ts:1324](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1324) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1298) +Defined in: [packages/query-core/src/types.ts:1333](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1333) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1303) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1308) +Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1313](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1313) +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1318](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1318) +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1327](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1327) +Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1293](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1293) +Defined in: [packages/query-core/src/types.ts:1328](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1328) The variables object passed to the `mutationFn`. diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverErrorResult.md index 03af3a33d12..cce591e3465 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) +Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1399](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1399) +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) +Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1402) +Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1403](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1403) +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1404) +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1405](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1405) +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) +Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) The variables object passed to the `mutationFn`. diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverIdleResult.md index 833db327a04..b7892846a6c 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) +Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1356](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1356) +Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1359](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1359) +Defined in: [packages/query-core/src/types.ts:1394](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1394) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1360) +Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1361) +Defined in: [packages/query-core/src/types.ts:1396](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1396) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) +Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1357](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1357) +Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) The variables object passed to the `mutationFn`. diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverLoadingResult.md index 6732628f444..d4368822213 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) +Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1379](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1379) +Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) +Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1381](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1381) +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) +Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1383](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1383) +Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1384](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1384) +Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1378](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1378) +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) The variables object passed to the `mutationFn`. diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverOptions.md b/docs/framework/svelte/reference/interfaces/MutationObserverOptions.md index be502d19332..1e609be9bf1 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1220) +Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1255) ## Extends @@ -35,7 +35,12 @@ Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) + +The time in milliseconds that an unused/inactive mutation remains in memory before it is +garbage collected. + +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. #### Inherited from @@ -49,7 +54,7 @@ Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) #### Inherited from @@ -63,7 +68,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) #### Inherited from @@ -77,7 +82,7 @@ Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Inherited from @@ -91,7 +96,13 @@ Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. #### Inherited from @@ -105,7 +116,7 @@ Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -141,7 +152,7 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) #### Parameters @@ -169,7 +180,7 @@ Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) #### Parameters @@ -209,7 +220,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) +Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) #### Parameters @@ -245,7 +256,14 @@ Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) + +If `false`, failed mutations will not retry by default. +If `true`, failed mutations will retry infinitely. +If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. +If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + +Defaults to `0`. #### Inherited from @@ -259,7 +277,12 @@ Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/ optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) +Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +Defaults to a function that applies exponential backoff, capped at 30 seconds. #### Inherited from @@ -273,7 +296,7 @@ Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/ optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) +Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) #### Inherited from @@ -287,4 +310,4 @@ Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) +Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverSuccessResult.md index 89e8c2739cc..52cdcc4883e 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) +Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1420](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1420) +Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) +Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1423](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1423) +Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1424](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1424) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1425) +Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1426](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1426) +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) +Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) The variables object passed to the `mutationFn`. diff --git a/docs/framework/svelte/reference/interfaces/MutationOptions.md b/docs/framework/svelte/reference/interfaces/MutationOptions.md index 8721b62d099..49f2b8f4f19 100644 --- a/docs/framework/svelte/reference/interfaces/MutationOptions.md +++ b/docs/framework/svelte/reference/interfaces/MutationOptions.md @@ -3,7 +3,7 @@ id: MutationOptions title: MutationOptions --- -Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) ## Extended by @@ -35,7 +35,12 @@ Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) + +The time in milliseconds that an unused/inactive mutation remains in memory before it is +garbage collected. + +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. *** @@ -45,7 +50,7 @@ Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/ optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) *** @@ -55,7 +60,7 @@ Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) *** @@ -65,7 +70,7 @@ Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) *** @@ -75,7 +80,13 @@ Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. *** @@ -85,7 +96,7 @@ Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -117,7 +128,7 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) #### Parameters @@ -141,7 +152,7 @@ Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) #### Parameters @@ -177,7 +188,7 @@ Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) +Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) #### Parameters @@ -209,7 +220,14 @@ Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) + +If `false`, failed mutations will not retry by default. +If `true`, failed mutations will retry infinitely. +If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. +If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + +Defaults to `0`. *** @@ -219,7 +237,12 @@ Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/ optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) +Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +Defaults to a function that applies exponential backoff, capped at 30 seconds. *** @@ -229,4 +252,4 @@ Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/ optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) +Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) diff --git a/docs/framework/svelte/reference/interfaces/NotifyEvent.md b/docs/framework/svelte/reference/interfaces/NotifyEvent.md index 17b3241654f..5e7875d41b8 100644 --- a/docs/framework/svelte/reference/interfaces/NotifyEvent.md +++ b/docs/framework/svelte/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) +Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1519) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1485) +Defined in: [packages/query-core/src/types.ts:1520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1520) diff --git a/docs/framework/svelte/reference/interfaces/QueriesObserverOptions.md b/docs/framework/svelte/reference/interfaces/QueriesObserverOptions.md index 16035c45714..68e7913885d 100644 --- a/docs/framework/svelte/reference/interfaces/QueriesObserverOptions.md +++ b/docs/framework/svelte/reference/interfaces/QueriesObserverOptions.md @@ -19,9 +19,11 @@ Defined in: [packages/query-core/src/queriesObserver.ts:23](https://github.com/T optional combine: CombineFn; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L32) +Defined in: [packages/query-core/src/queriesObserver.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L34) A function that combines the array of `QueryObserverResult`s (one per observed query) into a single value. The combined value is memoized and only recomputed when one of the underlying results, the query hashes, or the `combine` function itself changes. + +Defaults to returning the array of `QueryObserverResult`s unchanged. diff --git a/docs/framework/svelte/reference/interfaces/QueryClientConfig.md b/docs/framework/svelte/reference/interfaces/QueryClientConfig.md index b04dadba88c..411eb0b2fb2 100644 --- a/docs/framework/svelte/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/svelte/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/ optional defaultOptions: DefaultOptions; ``` -Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) Default options for all queries and mutations created through this client. @@ -25,7 +25,7 @@ Default options for all queries and mutations created through this client. optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1447](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1447) +Defined in: [packages/query-core/src/types.ts:1482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1482) The mutation cache this client is connected to. A new `MutationCache` is created if not provided. @@ -38,6 +38,6 @@ provided. optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) +Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/svelte/reference/interfaces/QueryExecuteOptions.md b/docs/framework/svelte/reference/interfaces/QueryExecuteOptions.md index 5a055675308..1e844c5ba10 100644 --- a/docs/framework/svelte/reference/interfaces/QueryExecuteOptions.md +++ b/docs/framework/svelte/reference/interfaces/QueryExecuteOptions.md @@ -3,7 +3,7 @@ id: QueryExecuteOptions title: QueryExecuteOptions --- -Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L555) +Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) ## Extends @@ -43,7 +43,7 @@ Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -70,7 +70,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -93,7 +93,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -111,7 +111,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) +Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L577) *** @@ -121,7 +121,7 @@ Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -139,7 +139,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -158,7 +158,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -180,7 +180,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -201,7 +201,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -223,7 +223,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -242,7 +242,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -265,7 +265,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -283,12 +283,13 @@ WithRequired.queryKeyHashFn optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -305,7 +306,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -329,7 +330,7 @@ WithRequired.retryDelay optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L567) +Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L578) #### Parameters @@ -349,7 +350,7 @@ Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:572](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L572) +Defined in: [packages/query-core/src/types.ts:583](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L583) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -362,10 +363,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/svelte/reference/interfaces/QueryFilters.md b/docs/framework/svelte/reference/interfaces/QueryFilters.md index 6b177d93aa5..749e4283d0d 100644 --- a/docs/framework/svelte/reference/interfaces/QueryFilters.md +++ b/docs/framework/svelte/reference/interfaces/QueryFilters.md @@ -27,7 +27,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -39,7 +39,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -51,7 +51,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -73,7 +73,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -85,7 +85,7 @@ Include queries matching this query key optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -97,6 +97,8 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries + +Defaults to `'all'`. diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverBaseResult.md index 4689d9d661a..1b54d6f8041 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L743) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) +Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) +Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) +Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) +Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) +Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult.md index 86ae34b80ab..7a4f855305f 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) +Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) +Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverLoadingResult.md index a0024077883..8f94574bcca 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) +Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) +Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverOptions.md b/docs/framework/svelte/reference/interfaces/QueryObserverOptions.md index af3d0bdff26..7c4c5f495bb 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverOptions.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverOptions.md @@ -3,7 +3,7 @@ id: QueryObserverOptions title: QueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L373) +Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L375) ## Extends @@ -47,11 +47,12 @@ Defined in: [packages/query-core/src/types.ts:373](https://github.com/TanStack/q optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. *** @@ -62,7 +63,7 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -89,7 +90,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -112,7 +113,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -130,7 +131,7 @@ WithRequired.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -148,7 +149,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -167,7 +168,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -189,7 +190,7 @@ WithRequired.networkMode optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -205,7 +206,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -226,7 +227,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -240,7 +241,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -262,7 +263,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -281,7 +282,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -304,7 +305,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -322,10 +323,11 @@ WithRequired.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. *** @@ -336,7 +338,7 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -349,12 +351,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. *** @@ -365,12 +368,13 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. *** @@ -381,12 +385,13 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. *** @@ -397,12 +402,13 @@ Defaults to `true`. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -419,7 +425,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -443,10 +449,11 @@ WithRequired.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. *** @@ -457,7 +464,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -482,12 +489,13 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. *** @@ -498,10 +506,11 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -518,10 +527,11 @@ WithRequired.structuralSharing optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. *** @@ -532,10 +542,11 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverPendingResult.md index 21fab248a7c..41a101c7c8c 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:875](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L875) +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:876](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L876) +Defined in: [packages/query-core/src/types.ts:887](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L887) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) +Defined in: [packages/query-core/src/types.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L888) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) +Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverPlaceholderResult.md index 89af2502c11..cce7cffcc9b 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) +Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) +Defined in: [packages/query-core/src/types.ts:969](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L969) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) +Defined in: [packages/query-core/src/types.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L970) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) +Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) +Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) +Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) +Defined in: [packages/query-core/src/types.ts:972](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L972) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult.md index dab5586fdc1..8486e8cf4cb 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) +Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) +Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverSuccessResult.md index b180b89ca62..f126bea0f70 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) +Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) +Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) +Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) +Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryOptions.md b/docs/framework/svelte/reference/interfaces/QueryOptions.md index ba603a4332f..bb82dd0f56a 100644 --- a/docs/framework/svelte/reference/interfaces/QueryOptions.md +++ b/docs/framework/svelte/reference/interfaces/QueryOptions.md @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:231](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -56,7 +56,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -73,7 +73,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -85,7 +85,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -97,7 +97,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -110,7 +110,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -126,7 +126,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -141,7 +141,7 @@ optional queryFn: | typeof skipToken; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -157,7 +157,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -170,7 +170,7 @@ as the actual cache key internally. optional queryKey: TQueryKey; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -187,7 +187,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -199,12 +199,13 @@ If specified, this function is used to hash the `queryKey` to a string. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. *** @@ -215,7 +216,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -233,8 +234,9 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. diff --git a/docs/framework/svelte/reference/interfaces/RefetchOptions.md b/docs/framework/svelte/reference/interfaces/RefetchOptions.md index b502dcd3492..104412c5bac 100644 --- a/docs/framework/svelte/reference/interfaces/RefetchOptions.md +++ b/docs/framework/svelte/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L684) +Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,7 +38,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/svelte/reference/interfaces/RefetchQueryFilters.md b/docs/framework/svelte/reference/interfaces/RefetchQueryFilters.md index 84f917c6201..bde28360fa1 100644 --- a/docs/framework/svelte/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/svelte/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:709](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L709) +Defined in: [packages/query-core/src/types.ts:720](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L720) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -26,7 +26,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -42,7 +42,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -58,7 +58,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -84,7 +84,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -100,7 +100,7 @@ Include queries matching this query key optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -116,10 +116,12 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries +Defaults to `'all'`. + #### Inherited from [`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/svelte/reference/interfaces/ResetOptions.md b/docs/framework/svelte/reference/interfaces/ResetOptions.md index 1855fef3064..6d3a8398fbb 100644 --- a/docs/framework/svelte/reference/interfaces/ResetOptions.md +++ b/docs/framework/svelte/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L714) +Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/svelte/reference/interfaces/ResultOptions.md b/docs/framework/svelte/reference/interfaces/ResultOptions.md index 9766c56d1a6..f3da151a3ec 100644 --- a/docs/framework/svelte/reference/interfaces/ResultOptions.md +++ b/docs/framework/svelte/reference/interfaces/ResultOptions.md @@ -3,7 +3,7 @@ id: ResultOptions title: ResultOptions --- -Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) +Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L686) ## Extended by @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/svelte/reference/interfaces/SetDataOptions.md b/docs/framework/svelte/reference/interfaces/SetDataOptions.md index 4262e781b05..cac83e9312a 100644 --- a/docs/framework/svelte/reference/interfaces/SetDataOptions.md +++ b/docs/framework/svelte/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1471) +Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1506) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1472](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1472) +Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) diff --git a/docs/framework/svelte/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/svelte/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md index 733a1a5ad75..4412ad00c8e 100644 --- a/docs/framework/svelte/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md +++ b/docs/framework/svelte/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedInfiniteQueryObserverOptions type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:538](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L538) +Defined in: [packages/query-core/src/types.ts:549](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L549) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/svelte/reference/type-aliases/DefaultedQueryObserverOptions.md index 1b4309f150c..9ce8401b128 100644 --- a/docs/framework/svelte/reference/type-aliases/DefaultedQueryObserverOptions.md +++ b/docs/framework/svelte/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedQueryObserverOptions type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L509) +Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index d82cfa37d51..cec33b142b7 100644 --- a/docs/framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) +Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/svelte/reference/type-aliases/DefinedQueryObserverResult.md index 97fcae175a9..b4480af3810 100644 --- a/docs/framework/svelte/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/svelte/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) +Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/svelte/reference/type-aliases/EnsureInfiniteQueryDataOptions.md index 305eef94893..ff75b1c3449 100644 --- a/docs/framework/svelte/reference/type-aliases/EnsureInfiniteQueryDataOptions.md +++ b/docs/framework/svelte/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -7,7 +7,7 @@ title: EnsureInfiniteQueryDataOptions type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; ``` -Defined in: [packages/query-core/src/types.ts:612](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L612) +Defined in: [packages/query-core/src/types.ts:623](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L623) ## Type Declaration diff --git a/docs/framework/svelte/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/svelte/reference/type-aliases/FetchInfiniteQueryOptions.md index 1ee1470b14a..c926bbd3ae5 100644 --- a/docs/framework/svelte/reference/type-aliases/FetchInfiniteQueryOptions.md +++ b/docs/framework/svelte/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: FetchInfiniteQueryOptions type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L656) +Defined in: [packages/query-core/src/types.ts:667](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L667) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/FetchStatus.md b/docs/framework/svelte/reference/type-aliases/FetchStatus.md index 7b71e54eacd..b347069e97e 100644 --- a/docs/framework/svelte/reference/type-aliases/FetchStatus.md +++ b/docs/framework/svelte/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:752](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L752) diff --git a/docs/framework/svelte/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/svelte/reference/type-aliases/InfiniteQueryExecuteOptions.md index 29c974cfddf..c198662a319 100644 --- a/docs/framework/svelte/reference/type-aliases/InfiniteQueryExecuteOptions.md +++ b/docs/framework/svelte/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -7,7 +7,7 @@ title: InfiniteQueryExecuteOptions type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:635](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L635) +Defined in: [packages/query-core/src/types.ts:646](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L646) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/svelte/reference/type-aliases/InfiniteQueryObserverResult.md index 7a646bc1c38..42279b19c00 100644 --- a/docs/framework/svelte/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/svelte/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) +Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/MutateFunction.md b/docs/framework/svelte/reference/type-aliases/MutateFunction.md index 284bd0fc270..558040d3439 100644 --- a/docs/framework/svelte/reference/type-aliases/MutateFunction.md +++ b/docs/framework/svelte/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1271) +Defined in: [packages/query-core/src/types.ts:1306](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1306) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/MutateFunctionRest.md b/docs/framework/svelte/reference/type-aliases/MutateFunctionRest.md index a2f16ea5302..3e7a5217482 100644 --- a/docs/framework/svelte/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/svelte/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1256) +Defined in: [packages/query-core/src/types.ts:1291](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1291) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/MutationFunction.md b/docs/framework/svelte/reference/type-aliases/MutationFunction.md index 4c8c7aed384..330af1ef65a 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationFunction.md +++ b/docs/framework/svelte/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/MutationFunctionContext.md b/docs/framework/svelte/reference/type-aliases/MutationFunctionContext.md index ef228cc53d3..97de2f1c220 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/svelte/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) +Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1169) +Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1180) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1170) +Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) +Defined in: [packages/query-core/src/types.ts:1182](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1182) diff --git a/docs/framework/svelte/reference/type-aliases/MutationKey.md b/docs/framework/svelte/reference/type-aliases/MutationKey.md index 7157d6052fd..8e9d3bc3b3a 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationKey.md +++ b/docs/framework/svelte/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) diff --git a/docs/framework/svelte/reference/type-aliases/MutationMeta.md b/docs/framework/svelte/reference/type-aliases/MutationMeta.md index f3bf9984fab..474c593e206 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationMeta.md +++ b/docs/framework/svelte/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1160](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1160) +Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) diff --git a/docs/framework/svelte/reference/type-aliases/MutationObserverResult.md b/docs/framework/svelte/reference/type-aliases/MutationObserverResult.md index 3390192e071..21e43836bf6 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/svelte/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) +Defined in: [packages/query-core/src/types.ts:1464](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1464) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/MutationScope.md b/docs/framework/svelte/reference/type-aliases/MutationScope.md index a2511c903d9..feac9d9d17a 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationScope.md +++ b/docs/framework/svelte/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) +Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1167) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) +Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) diff --git a/docs/framework/svelte/reference/type-aliases/MutationStatus.md b/docs/framework/svelte/reference/type-aliases/MutationStatus.md index d9b58cdd26f..4cd2d3c9535 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationStatus.md +++ b/docs/framework/svelte/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1154](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1154) +Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) diff --git a/docs/framework/svelte/reference/type-aliases/NotifyEventType.md b/docs/framework/svelte/reference/type-aliases/NotifyEventType.md index 94912df6c6b..9bbc85e4ce8 100644 --- a/docs/framework/svelte/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/svelte/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) +Defined in: [packages/query-core/src/types.ts:1510](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1510) diff --git a/docs/framework/svelte/reference/type-aliases/QueryObserverResult.md b/docs/framework/svelte/reference/type-aliases/QueryObserverResult.md index f5c6c95d5f2..4fc661a6c9d 100644 --- a/docs/framework/svelte/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/svelte/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) +Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/QueryStatus.md b/docs/framework/svelte/reference/type-aliases/QueryStatus.md index 3fc872e604b..6679b8b17c6 100644 --- a/docs/framework/svelte/reference/type-aliases/QueryStatus.md +++ b/docs/framework/svelte/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:740](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L740) +Defined in: [packages/query-core/src/types.ts:751](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L751) diff --git a/docs/framework/svelte/reference/type-aliases/SkipToken.md b/docs/framework/svelte/reference/type-aliases/SkipToken.md index 176c23830d2..3a5791b982e 100644 --- a/docs/framework/svelte/reference/type-aliases/SkipToken.md +++ b/docs/framework/svelte/reference/type-aliases/SkipToken.md @@ -7,6 +7,6 @@ title: SkipToken type SkipToken = typeof skipToken; ``` -Defined in: [packages/query-core/src/utils.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L524) +Defined in: [packages/query-core/src/utils.ts:526](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L526) The type of the [skipToken](../variables/skipToken.md) sentinel value. diff --git a/docs/framework/svelte/reference/type-aliases/ThrowOnError.md b/docs/framework/svelte/reference/type-aliases/ThrowOnError.md index 60ad44c1cd1..613549e4d52 100644 --- a/docs/framework/svelte/reference/type-aliases/ThrowOnError.md +++ b/docs/framework/svelte/reference/type-aliases/ThrowOnError.md @@ -7,7 +7,7 @@ title: ThrowOnError type ThrowOnError = boolean | (error, query) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L361) +Defined in: [packages/query-core/src/types.ts:363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L363) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/Updater.md b/docs/framework/svelte/reference/type-aliases/Updater.md index b6a29ccc5fc..7a0c2f30503 100644 --- a/docs/framework/svelte/reference/type-aliases/Updater.md +++ b/docs/framework/svelte/reference/type-aliases/Updater.md @@ -7,7 +7,7 @@ title: Updater type Updater = TOutput | (input) => TOutput; ``` -Defined in: [packages/query-core/src/utils.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L103) +Defined in: [packages/query-core/src/utils.ts:105](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L105) Either a plain value of type `TOutput`, or a function that receives `TInput` and returns `TOutput`. Used for example by `setQueryData`-style updaters, which accept either the new data directly or a diff --git a/docs/framework/svelte/reference/type-aliases/WithRequired.md b/docs/framework/svelte/reference/type-aliases/WithRequired.md index c8ef831db3c..deb87dfe4a4 100644 --- a/docs/framework/svelte/reference/type-aliases/WithRequired.md +++ b/docs/framework/svelte/reference/type-aliases/WithRequired.md @@ -7,7 +7,7 @@ title: WithRequired type WithRequired = TTarget & { [_ in TKey]: {} }; ``` -Defined in: [packages/query-core/src/types.ts:505](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L505) +Defined in: [packages/query-core/src/types.ts:516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L516) ## Type Parameters diff --git a/docs/framework/svelte/reference/variables/isServer.md b/docs/framework/svelte/reference/variables/isServer.md index 28956d55cbf..16aa39d1244 100644 --- a/docs/framework/svelte/reference/variables/isServer.md +++ b/docs/framework/svelte/reference/variables/isServer.md @@ -7,7 +7,7 @@ title: isServer const isServer: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L112) +Defined in: [packages/query-core/src/utils.ts:114](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L114) ## Deprecated diff --git a/docs/framework/svelte/reference/variables/skipToken.md b/docs/framework/svelte/reference/variables/skipToken.md index 3163e91c1c2..a390d0b7b66 100644 --- a/docs/framework/svelte/reference/variables/skipToken.md +++ b/docs/framework/svelte/reference/variables/skipToken.md @@ -7,7 +7,7 @@ title: skipToken const skipToken: typeof skipToken; ``` -Defined in: [packages/query-core/src/utils.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L520) +Defined in: [packages/query-core/src/utils.ts:522](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L522) Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`, diff --git a/docs/framework/vue/reference/classes/QueriesObserver.md b/docs/framework/vue/reference/classes/QueriesObserver.md index 0fd6094c5c2..cfc6a776f6b 100644 --- a/docs/framework/vue/reference/classes/QueriesObserver.md +++ b/docs/framework/vue/reference/classes/QueriesObserver.md @@ -3,7 +3,7 @@ id: QueriesObserver title: QueriesObserver --- -Defined in: [packages/query-core/src/queriesObserver.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L54) +Defined in: [packages/query-core/src/queriesObserver.ts:56](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L56) A `QueriesObserver` watches an array of queries at once, exposing them as a single array of `QueryObserverResult`s (or, when a `combine` option is @@ -45,7 +45,7 @@ new QueriesObserver( options?): QueriesObserver; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L68) +Defined in: [packages/query-core/src/queriesObserver.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L70) #### Parameters @@ -95,7 +95,7 @@ Subscribable.listeners destroy(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L104) +Defined in: [packages/query-core/src/queriesObserver.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L106) Stops observing all queries: clears all listeners and destroys every underlying `QueryObserver` this observer manages. @@ -112,7 +112,7 @@ underlying `QueryObserver` this observer manages. getCurrentResult(): QueryObserverResult[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L208) +Defined in: [packages/query-core/src/queriesObserver.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L210) Returns the most recently computed array of `QueryObserverResult`s, one per observed query, in the same order as the queries passed to the @@ -137,7 +137,7 @@ const data = results.map((result) => result.data) getObservers(): QueryObserver[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L225) +Defined in: [packages/query-core/src/queriesObserver.ts:227](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L227) Returns the underlying `QueryObserver` instances this observer manages, in the same order as the queries passed to the constructor or @@ -155,7 +155,7 @@ in the same order as the queries passed to the constructor or getOptimisticResult(queries, combine): [QueryObserverResult[], (r?) => TCombinedResult, () => QueryObserverResult[]]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L236) +Defined in: [packages/query-core/src/queriesObserver.ts:238](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L238) The `QueriesObserver` counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult) — computes the result for the given (already-defaulted) queries right now, synchronously. Called by @@ -185,7 +185,7 @@ wrap the results for property-access tracking. getQueries(): Query[]; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:216](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L216) +Defined in: [packages/query-core/src/queriesObserver.ts:218](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L218) Returns the underlying `Query` instances currently being observed, in the same order as the queries passed to the constructor or `setQueries`. @@ -222,7 +222,7 @@ Subscribable.hasListeners protected onSubscribe(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:84](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L84) +Defined in: [packages/query-core/src/queriesObserver.ts:86](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L86) #### Returns @@ -242,7 +242,7 @@ Subscribable.onSubscribe protected onUnsubscribe(): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L94) +Defined in: [packages/query-core/src/queriesObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L96) #### Returns @@ -262,7 +262,7 @@ Subscribable.onUnsubscribe setQueries(queries, options?): void; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:125](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L125) +Defined in: [packages/query-core/src/queriesObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L127) Replaces the set of queries being observed. Existing `QueryObserver`s are reused for queries that match an already-observed query hash; diff --git a/docs/framework/vue/reference/functions/hashKey.md b/docs/framework/vue/reference/functions/hashKey.md index 9e7844aa09d..dc774c032ce 100644 --- a/docs/framework/vue/reference/functions/hashKey.md +++ b/docs/framework/vue/reference/functions/hashKey.md @@ -7,7 +7,7 @@ title: hashKey function hashKey(queryKey): string; ``` -Defined in: [packages/query-core/src/utils.ts:282](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L282) +Defined in: [packages/query-core/src/utils.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L284) Default query & mutation keys hash function. Hashes the value into a stable hash. diff --git a/docs/framework/vue/reference/functions/keepPreviousData.md b/docs/framework/vue/reference/functions/keepPreviousData.md index d41c7d7c726..6a84f4c5970 100644 --- a/docs/framework/vue/reference/functions/keepPreviousData.md +++ b/docs/framework/vue/reference/functions/keepPreviousData.md @@ -7,7 +7,7 @@ title: keepPreviousData function keepPreviousData(previousData): T | undefined; ``` -Defined in: [packages/query-core/src/utils.ts:491](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L491) +Defined in: [packages/query-core/src/utils.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L493) Intended to be passed as a query's `placeholderData` option, for example `placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new diff --git a/docs/framework/vue/reference/functions/matchMutation.md b/docs/framework/vue/reference/functions/matchMutation.md index ec5e171547d..9d91464e098 100644 --- a/docs/framework/vue/reference/functions/matchMutation.md +++ b/docs/framework/vue/reference/functions/matchMutation.md @@ -7,7 +7,7 @@ title: matchMutation function matchMutation(filters, mutation): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:235](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L235) +Defined in: [packages/query-core/src/utils.ts:237](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L237) Checks whether a mutation matches the given [MutationFilters](../type-aliases/MutationFilters.md). Every filter that is specified must match; filters that are left unspecified are ignored. diff --git a/docs/framework/vue/reference/functions/matchQuery.md b/docs/framework/vue/reference/functions/matchQuery.md index 793edf87117..d052d0abcd4 100644 --- a/docs/framework/vue/reference/functions/matchQuery.md +++ b/docs/framework/vue/reference/functions/matchQuery.md @@ -7,7 +7,7 @@ title: matchQuery function matchQuery(filters, query): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L173) +Defined in: [packages/query-core/src/utils.ts:175](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L175) Checks whether a query matches the given [QueryFilters](../type-aliases/QueryFilters.md). Every filter that is specified must match; filters that are left unspecified are ignored. diff --git a/docs/framework/vue/reference/functions/noop.md b/docs/framework/vue/reference/functions/noop.md index fd1b8dc2ad0..01fb409f4e9 100644 --- a/docs/framework/vue/reference/functions/noop.md +++ b/docs/framework/vue/reference/functions/noop.md @@ -9,7 +9,7 @@ title: noop function noop(): void; ``` -Defined in: [packages/query-core/src/utils.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L117) +Defined in: [packages/query-core/src/utils.ts:119](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L119) A function that does nothing. @@ -23,7 +23,7 @@ A function that does nothing. function noop(): undefined; ``` -Defined in: [packages/query-core/src/utils.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L118) +Defined in: [packages/query-core/src/utils.ts:120](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L120) A function that does nothing. diff --git a/docs/framework/vue/reference/functions/partialMatchKey.md b/docs/framework/vue/reference/functions/partialMatchKey.md index 3795de85b95..4db67323e9b 100644 --- a/docs/framework/vue/reference/functions/partialMatchKey.md +++ b/docs/framework/vue/reference/functions/partialMatchKey.md @@ -7,7 +7,7 @@ title: partialMatchKey function partialMatchKey(a, b): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L298) +Defined in: [packages/query-core/src/utils.ts:300](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L300) Checks if key `b` partially matches with key `a`. diff --git a/docs/framework/vue/reference/functions/replaceEqualDeep.md b/docs/framework/vue/reference/functions/replaceEqualDeep.md index 77a393196ef..6a81c3907fb 100644 --- a/docs/framework/vue/reference/functions/replaceEqualDeep.md +++ b/docs/framework/vue/reference/functions/replaceEqualDeep.md @@ -10,7 +10,7 @@ function replaceEqualDeep( depth?): T; ``` -Defined in: [packages/query-core/src/utils.ts:337](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L337) +Defined in: [packages/query-core/src/utils.ts:339](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L339) This function returns `a` if `b` is deeply equal. If not, it will replace any deeply equal children of `b` with those of `a`. diff --git a/docs/framework/vue/reference/functions/shouldThrowError.md b/docs/framework/vue/reference/functions/shouldThrowError.md index 3146617391e..1f1e62a8d0e 100644 --- a/docs/framework/vue/reference/functions/shouldThrowError.md +++ b/docs/framework/vue/reference/functions/shouldThrowError.md @@ -7,7 +7,7 @@ title: shouldThrowError function shouldThrowError(throwOnError, params): boolean; ``` -Defined in: [packages/query-core/src/utils.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L574) +Defined in: [packages/query-core/src/utils.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L576) Resolves a `throwOnError` option to a boolean. If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller, diff --git a/docs/framework/vue/reference/interfaces/CancelOptions.md b/docs/framework/vue/reference/interfaces/CancelOptions.md index 14394c18533..f52c729f3b1 100644 --- a/docs/framework/vue/reference/interfaces/CancelOptions.md +++ b/docs/framework/vue/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1466) +Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1501) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1466](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1467) +Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1467](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1468) +Defined in: [packages/query-core/src/types.ts:1503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1503) diff --git a/docs/framework/vue/reference/interfaces/DefaultOptions.md b/docs/framework/vue/reference/interfaces/DefaultOptions.md index 026116d11db..67ae012f9ee 100644 --- a/docs/framework/vue/reference/interfaces/DefaultOptions.md +++ b/docs/framework/vue/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1452) +Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1487) ## Type Parameters @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:1452](https://github.com/TanStack/ optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) +Defined in: [packages/query-core/src/types.ts:1498](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1498) Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). @@ -31,7 +31,7 @@ Default options used when dehydrating the client's caches; see [DehydrateOptions optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1496](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1496) Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). @@ -67,7 +67,7 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) +Defined in: [packages/query-core/src/types.ts:1494](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1494) Default options applied to every mutation, unless overridden per-mutation. @@ -79,6 +79,6 @@ Default options applied to every mutation, unless overridden per-mutation. optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) +Defined in: [packages/query-core/src/types.ts:1489](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1489) Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/vue/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/vue/reference/interfaces/EnsureQueryDataOptions.md index d7b4751a9d3..d71a60902e6 100644 --- a/docs/framework/vue/reference/interfaces/EnsureQueryDataOptions.md +++ b/docs/framework/vue/reference/interfaces/EnsureQueryDataOptions.md @@ -3,7 +3,7 @@ id: EnsureQueryDataOptions title: EnsureQueryDataOptions --- -Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) +Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L606) ## Deprecated @@ -41,7 +41,7 @@ Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -66,7 +66,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -87,7 +87,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -103,7 +103,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) +Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) #### Inherited from @@ -117,7 +117,7 @@ Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -133,7 +133,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -150,7 +150,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -170,7 +170,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -189,7 +189,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -209,7 +209,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -226,7 +226,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -247,7 +247,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -263,12 +263,13 @@ If specified, this function is used to hash the `queryKey` to a string. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -283,7 +284,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -305,7 +306,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional revalidateIfStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L608) +Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L619) *** @@ -315,7 +316,7 @@ Defined in: [packages/query-core/src/types.ts:608](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) +Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -332,10 +333,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/vue/reference/interfaces/FetchNextPageOptions.md b/docs/framework/vue/reference/interfaces/FetchNextPageOptions.md index d12afe35fe1..2c0be977140 100644 --- a/docs/framework/vue/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/vue/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L716) +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:716](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) +Defined in: [packages/query-core/src/types.ts:736](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L736) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/vue/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/vue/reference/interfaces/FetchPreviousPageOptions.md index 93ca92088f1..683e789ee52 100644 --- a/docs/framework/vue/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/vue/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L728) +Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L739) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:728](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) +Defined in: [packages/query-core/src/types.ts:748](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L748) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/vue/reference/interfaces/FetchQueryOptions.md b/docs/framework/vue/reference/interfaces/FetchQueryOptions.md index 27d7aa63d3d..0820a2a87b7 100644 --- a/docs/framework/vue/reference/interfaces/FetchQueryOptions.md +++ b/docs/framework/vue/reference/interfaces/FetchQueryOptions.md @@ -3,7 +3,7 @@ id: FetchQueryOptions title: FetchQueryOptions --- -Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L576) +Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L587) ## Deprecated @@ -45,7 +45,7 @@ Defined in: [packages/query-core/src/types.ts:576](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -72,7 +72,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -95,7 +95,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -113,7 +113,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) +Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) *** @@ -123,7 +123,7 @@ Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -141,7 +141,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -160,7 +160,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -182,7 +182,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -203,7 +203,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -225,7 +225,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -244,7 +244,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -267,7 +267,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -285,12 +285,13 @@ WithRequired.queryKeyHashFn optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -307,7 +308,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -331,7 +332,7 @@ WithRequired.retryDelay optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) +Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -344,10 +345,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult.md index f1443c39625..9195e0727f8 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) +Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L991) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) +Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) +Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) +Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) +Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) +Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 7c55201c028..2841b5ab116 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) +Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) +Defined in: [packages/query-core/src/types.ts:1076](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1076) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) +Defined in: [packages/query-core/src/types.ts:1077](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1077) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) +Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult.md index f9541ebd73b..95ff84b3ef3 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) +Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) +Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) +Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) +Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverOptions.md index db1ca7f18fe..7d5b0dd1a4d 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverOptions.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverOptions title: InfiniteQueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) +Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L531) ## Extends @@ -39,11 +39,12 @@ Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/q optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -58,7 +59,7 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -81,7 +82,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -98,7 +99,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -117,7 +118,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -138,7 +139,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -154,7 +155,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from @@ -168,7 +169,7 @@ Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -184,7 +185,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -201,7 +202,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -221,7 +222,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -241,7 +242,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -260,7 +261,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -278,7 +279,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -298,7 +299,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -315,7 +316,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -336,7 +337,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -352,10 +353,11 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -370,7 +372,7 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -387,12 +389,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -407,12 +410,13 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -427,12 +431,13 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -447,12 +452,13 @@ Defaults to `true`. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -467,7 +473,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -489,10 +495,11 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -507,7 +514,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -536,12 +543,13 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -556,10 +564,11 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -574,10 +583,11 @@ Defaults to `true`. optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. #### Inherited from @@ -592,12 +602,13 @@ Defaults to `false`. optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult.md index 1bab3233ec9..c3e8b022cdb 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1027](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1027) +Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1029](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1029) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1035](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1035) +Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1031](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1031) +Defined in: [packages/query-core/src/types.ts:1042](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1042) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1034](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1034) +Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index 58310e1af49..e62579744ba 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) +Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) +Defined in: [packages/query-core/src/types.ts:1133](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1133) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) +Defined in: [packages/query-core/src/types.ts:1128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1128) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) +Defined in: [packages/query-core/src/types.ts:1129](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1129) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) +Defined in: [packages/query-core/src/types.ts:1132](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1132) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) +Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) +Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) +Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index 22ed760c153..a67e877f083 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1007](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1007) +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1015](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1015) +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1094](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1094) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) +Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) +Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) +Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 732c882f86f..0b875662cbc 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:993](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L993) +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:999](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L999) +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1003](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1003) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1011](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1011) +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1019](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1019) +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) +Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) +Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) +Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) +Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/vue/reference/interfaces/InfiniteQueryPageParamsOptions.md index bfab8bfc319..afe27785edc 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryPageParamsOptions.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryPageParamsOptions title: InfiniteQueryPageParamsOptions --- -Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) +Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L347) ## Extends @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/q getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L358) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -44,7 +44,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L353) +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -57,7 +57,7 @@ The result will also be used to determine the value of `hasPreviousPage`. initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from diff --git a/docs/framework/vue/reference/interfaces/InitialPageParam.md b/docs/framework/vue/reference/interfaces/InitialPageParam.md index ffbf32ae0d6..2d42bf029a4 100644 --- a/docs/framework/vue/reference/interfaces/InitialPageParam.md +++ b/docs/framework/vue/reference/interfaces/InitialPageParam.md @@ -3,7 +3,7 @@ id: InitialPageParam title: InitialPageParam --- -Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) +Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L343) ## Extended by @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/q initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L342) +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) diff --git a/docs/framework/vue/reference/interfaces/InvalidateOptions.md b/docs/framework/vue/reference/interfaces/InvalidateOptions.md index 1cd96c88165..d83ecd43ec0 100644 --- a/docs/framework/vue/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/vue/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L713) +Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:713](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/vue/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/vue/reference/interfaces/InvalidateQueryFilters.md index 8bb1a830e94..81461ccb716 100644 --- a/docs/framework/vue/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/vue/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) +Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) ## Extends @@ -23,7 +23,7 @@ Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/q optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -41,7 +41,7 @@ QueryFilters.exact optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -59,7 +59,7 @@ QueryFilters.fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -87,7 +87,7 @@ QueryFilters.predicate optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -105,7 +105,7 @@ QueryFilters.queryKey optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) +Defined in: [packages/query-core/src/types.ts:717](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L717) Controls which of the matched (now-invalidated) queries are refetched in the background. Defaults to `'active'`. @@ -122,7 +122,7 @@ Defaults to `'active'`. optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -140,10 +140,12 @@ QueryFilters.stale optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries +Defaults to `'all'`. + #### Inherited from ```ts diff --git a/docs/framework/vue/reference/interfaces/MutateOptions.md b/docs/framework/vue/reference/interfaces/MutateOptions.md index 6e27e4e6d29..b12b3b29ec2 100644 --- a/docs/framework/vue/reference/interfaces/MutateOptions.md +++ b/docs/framework/vue/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1247) +Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1282) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1247](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1235](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1235) +Defined in: [packages/query-core/src/types.ts:1270](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1270) #### Parameters diff --git a/docs/framework/vue/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/vue/reference/interfaces/MutationObserverBaseResult.md index 190d4d4d3b6..e1c09a56737 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1280) +Defined in: [packages/query-core/src/types.ts:1315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1315) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1289) +Defined in: [packages/query-core/src/types.ts:1324](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1324) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1298) +Defined in: [packages/query-core/src/types.ts:1333](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1333) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1303) +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1308) +Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1313](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1313) +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1318](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1318) +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1327](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1327) +Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1293](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1293) +Defined in: [packages/query-core/src/types.ts:1328](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1328) The variables object passed to the `mutationFn`. diff --git a/docs/framework/vue/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/vue/reference/interfaces/MutationObserverErrorResult.md index 03af3a33d12..cce591e3465 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1387](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1387) +Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1399](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1399) +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) +Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1402) +Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1403](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1403) +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1404) +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1405](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1405) +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) +Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) The variables object passed to the `mutationFn`. diff --git a/docs/framework/vue/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/vue/reference/interfaces/MutationObserverIdleResult.md index 833db327a04..b7892846a6c 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1345) +Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1356](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1356) +Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1359](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1359) +Defined in: [packages/query-core/src/types.ts:1394](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1394) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1360) +Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1361) +Defined in: [packages/query-core/src/types.ts:1396](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1396) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) +Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1357](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1357) +Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) The variables object passed to the `mutationFn`. diff --git a/docs/framework/vue/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/vue/reference/interfaces/MutationObserverLoadingResult.md index 6732628f444..d4368822213 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1366](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1366) +Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1379](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1379) +Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) +Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1381](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1381) +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) +Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1383](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1383) +Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1384](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1384) +Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1378](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1378) +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) The variables object passed to the `mutationFn`. diff --git a/docs/framework/vue/reference/interfaces/MutationObserverOptions.md b/docs/framework/vue/reference/interfaces/MutationObserverOptions.md index 6723cfd8f25..d21a77b5505 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1220) +Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1255) ## Extends @@ -35,7 +35,12 @@ Defined in: [packages/query-core/src/types.ts:1220](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1213](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1213) +Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) + +The time in milliseconds that an unused/inactive mutation remains in memory before it is +garbage collected. + +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. #### Inherited from @@ -51,7 +56,7 @@ MutationOptions.gcTime optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1216](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1216) +Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) #### Inherited from @@ -67,7 +72,7 @@ MutationOptions.meta optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) #### Inherited from @@ -83,7 +88,7 @@ MutationOptions.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1186](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1186) +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Inherited from @@ -99,7 +104,13 @@ MutationOptions.mutationKey optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. #### Inherited from @@ -115,7 +126,7 @@ MutationOptions.networkMode optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -153,7 +164,7 @@ MutationOptions.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1187) +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) #### Parameters @@ -183,7 +194,7 @@ MutationOptions.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1203) +Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) #### Parameters @@ -225,7 +236,7 @@ MutationOptions.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) +Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) #### Parameters @@ -263,7 +274,14 @@ MutationOptions.onSuccess optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1210) +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) + +If `false`, failed mutations will not retry by default. +If `true`, failed mutations will retry infinitely. +If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. +If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + +Defaults to `0`. #### Inherited from @@ -279,7 +297,12 @@ MutationOptions.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1211) +Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +Defaults to a function that applies exponential backoff, capped at 30 seconds. #### Inherited from @@ -295,7 +318,7 @@ MutationOptions.retryDelay optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1217](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1217) +Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) #### Inherited from @@ -311,4 +334,4 @@ MutationOptions.scope optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1226](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1226) +Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) diff --git a/docs/framework/vue/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/vue/reference/interfaces/MutationObserverSuccessResult.md index 89e8c2739cc..52cdcc4883e 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1408](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1408) +Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1420](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1420) +Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) +Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1423](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1423) +Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1424](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1424) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1425) +Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1342](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1342) +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1426](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1426) +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) +Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) The variables object passed to the `mutationFn`. diff --git a/docs/framework/vue/reference/interfaces/NotifyEvent.md b/docs/framework/vue/reference/interfaces/NotifyEvent.md index 17b3241654f..5e7875d41b8 100644 --- a/docs/framework/vue/reference/interfaces/NotifyEvent.md +++ b/docs/framework/vue/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) +Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1519) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1485) +Defined in: [packages/query-core/src/types.ts:1520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1520) diff --git a/docs/framework/vue/reference/interfaces/QueriesObserverOptions.md b/docs/framework/vue/reference/interfaces/QueriesObserverOptions.md index 16035c45714..68e7913885d 100644 --- a/docs/framework/vue/reference/interfaces/QueriesObserverOptions.md +++ b/docs/framework/vue/reference/interfaces/QueriesObserverOptions.md @@ -19,9 +19,11 @@ Defined in: [packages/query-core/src/queriesObserver.ts:23](https://github.com/T optional combine: CombineFn; ``` -Defined in: [packages/query-core/src/queriesObserver.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L32) +Defined in: [packages/query-core/src/queriesObserver.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L34) A function that combines the array of `QueryObserverResult`s (one per observed query) into a single value. The combined value is memoized and only recomputed when one of the underlying results, the query hashes, or the `combine` function itself changes. + +Defaults to returning the array of `QueryObserverResult`s unchanged. diff --git a/docs/framework/vue/reference/interfaces/QueryClientConfig.md b/docs/framework/vue/reference/interfaces/QueryClientConfig.md index b04dadba88c..411eb0b2fb2 100644 --- a/docs/framework/vue/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/vue/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/ optional defaultOptions: DefaultOptions; ``` -Defined in: [packages/query-core/src/types.ts:1449](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1449) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) Default options for all queries and mutations created through this client. @@ -25,7 +25,7 @@ Default options for all queries and mutations created through this client. optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1447](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1447) +Defined in: [packages/query-core/src/types.ts:1482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1482) The mutation cache this client is connected to. A new `MutationCache` is created if not provided. @@ -38,6 +38,6 @@ provided. optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) +Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/vue/reference/interfaces/QueryExecuteOptions.md b/docs/framework/vue/reference/interfaces/QueryExecuteOptions.md index ce40aa09805..d2ebd296f94 100644 --- a/docs/framework/vue/reference/interfaces/QueryExecuteOptions.md +++ b/docs/framework/vue/reference/interfaces/QueryExecuteOptions.md @@ -3,7 +3,7 @@ id: QueryExecuteOptions title: QueryExecuteOptions --- -Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L555) +Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) ## Extends @@ -43,7 +43,7 @@ Defined in: [packages/query-core/src/types.ts:555](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -70,7 +70,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -93,7 +93,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -111,7 +111,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) +Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L577) *** @@ -121,7 +121,7 @@ Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -139,7 +139,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -158,7 +158,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -180,7 +180,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -201,7 +201,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -223,7 +223,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -242,7 +242,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -265,7 +265,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -283,12 +283,13 @@ WithRequired.queryKeyHashFn optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -305,7 +306,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -329,7 +330,7 @@ WithRequired.retryDelay optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L567) +Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L578) #### Parameters @@ -349,7 +350,7 @@ Defined in: [packages/query-core/src/types.ts:567](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:572](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L572) +Defined in: [packages/query-core/src/types.ts:583](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L583) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -362,10 +363,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/vue/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/vue/reference/interfaces/QueryObserverBaseResult.md index 4689d9d661a..1b54d6f8041 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L743) +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:743](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:750](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L750) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:759](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L759) +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:783](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L783) +Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:810](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L810) +Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:806](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L806) +Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:824](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L824) +Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:828](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L828) +Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:842](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L842) +Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:860](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L860) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/vue/reference/interfaces/QueryObserverLoadingErrorResult.md index 86ae34b80ab..7a4f855305f 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) +Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) +Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/vue/reference/interfaces/QueryObserverLoadingResult.md index a0024077883..8f94574bcca 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) +Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:895](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L895) +Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverOptions.md b/docs/framework/vue/reference/interfaces/QueryObserverOptions.md index bdaefab7baa..f6180995f76 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverOptions.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverOptions.md @@ -3,7 +3,7 @@ id: QueryObserverOptions title: QueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L373) +Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L375) ## Extends @@ -47,11 +47,12 @@ Defined in: [packages/query-core/src/types.ts:373](https://github.com/TanStack/q optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:390](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L390) +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. *** @@ -62,7 +63,7 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L271) +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -89,7 +90,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L311) +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -112,7 +113,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L315) +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -130,7 +131,7 @@ WithRequired.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L338) +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -148,7 +149,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L334) +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -167,7 +168,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L260) +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -189,7 +190,7 @@ WithRequired.networkMode optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:467](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L467) +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -205,7 +206,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L284) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -226,7 +227,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -240,7 +241,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:279](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L279) +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -262,7 +263,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:289](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L289) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -281,7 +282,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:298](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L298) +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -304,7 +305,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L302) +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -322,10 +323,11 @@ WithRequired.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:404](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L404) +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. *** @@ -336,7 +338,7 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -349,12 +351,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. *** @@ -365,12 +368,13 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L435) +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. *** @@ -381,12 +385,13 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L422) +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. *** @@ -397,12 +402,13 @@ Defaults to `true`. optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L245) +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -419,7 +425,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L255) +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -443,10 +449,11 @@ WithRequired.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L459) +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. *** @@ -457,7 +464,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L482) +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -482,12 +489,13 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. *** @@ -498,10 +506,11 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L323) +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -518,10 +527,11 @@ WithRequired.structuralSharing optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:488](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L488) +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. *** @@ -532,10 +542,11 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L475) +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. diff --git a/docs/framework/vue/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/vue/reference/interfaces/QueryObserverPendingResult.md index 21fab248a7c..41a101c7c8c 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:875](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L875) +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:876](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L876) +Defined in: [packages/query-core/src/types.ts:887](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L887) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:877](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L877) +Defined in: [packages/query-core/src/types.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L888) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L802) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:878](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L878) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:880](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L880) +Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:883](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L883) +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/vue/reference/interfaces/QueryObserverPlaceholderResult.md index 89af2502c11..cce7cffcc9b 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) +Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) +Defined in: [packages/query-core/src/types.ts:969](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L969) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) +Defined in: [packages/query-core/src/types.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L970) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) +Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) +Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) +Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) +Defined in: [packages/query-core/src/types.ts:972](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L972) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/vue/reference/interfaces/QueryObserverRefetchErrorResult.md index dab5586fdc1..8486e8cf4cb 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) +Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) +Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/vue/reference/interfaces/QueryObserverSuccessResult.md index b180b89ca62..f126bea0f70 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:778](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L778) +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:763](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L763) +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:769](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L769) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:868](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L868) +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L846) +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:846](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) +Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:787](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L787) +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:792](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L792) +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:797](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L797) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:815](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L815) +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) +Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:820](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L820) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) +Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:833](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L833) +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:837](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L837) +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:850](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L850) +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) +Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/RefetchOptions.md b/docs/framework/vue/reference/interfaces/RefetchOptions.md index b502dcd3492..104412c5bac 100644 --- a/docs/framework/vue/reference/interfaces/RefetchOptions.md +++ b/docs/framework/vue/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L684) +Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:684](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,7 +38,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/vue/reference/interfaces/RefetchQueryFilters.md b/docs/framework/vue/reference/interfaces/RefetchQueryFilters.md index 57abef774c4..00581054484 100644 --- a/docs/framework/vue/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/vue/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:709](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L709) +Defined in: [packages/query-core/src/types.ts:720](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L720) ## Extends @@ -23,7 +23,7 @@ Defined in: [packages/query-core/src/types.ts:709](https://github.com/TanStack/q optional exact: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L39) +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -41,7 +41,7 @@ QueryFilters.exact optional fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/utils.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L55) +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -59,7 +59,7 @@ QueryFilters.fetchStatus optional predicate: (query) => boolean; ``` -Defined in: [packages/query-core/src/utils.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L43) +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -87,7 +87,7 @@ QueryFilters.predicate optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: [packages/query-core/src/utils.ts:47](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L47) +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -105,7 +105,7 @@ QueryFilters.queryKey optional stale: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L51) +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -123,10 +123,12 @@ QueryFilters.stale optional type: QueryTypeFilter; ``` -Defined in: [packages/query-core/src/utils.ts:35](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L35) +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries +Defaults to `'all'`. + #### Inherited from ```ts diff --git a/docs/framework/vue/reference/interfaces/ResetOptions.md b/docs/framework/vue/reference/interfaces/ResetOptions.md index 1855fef3064..6d3a8398fbb 100644 --- a/docs/framework/vue/reference/interfaces/ResetOptions.md +++ b/docs/framework/vue/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L714) +Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:714](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/vue/reference/interfaces/ResultOptions.md b/docs/framework/vue/reference/interfaces/ResultOptions.md index 9766c56d1a6..f3da151a3ec 100644 --- a/docs/framework/vue/reference/interfaces/ResultOptions.md +++ b/docs/framework/vue/reference/interfaces/ResultOptions.md @@ -3,7 +3,7 @@ id: ResultOptions title: ResultOptions --- -Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) +Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L686) ## Extended by @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:681](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L681) +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/vue/reference/interfaces/SetDataOptions.md b/docs/framework/vue/reference/interfaces/SetDataOptions.md index 4262e781b05..cac83e9312a 100644 --- a/docs/framework/vue/reference/interfaces/SetDataOptions.md +++ b/docs/framework/vue/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1471) +Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1506) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1471](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1472](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1472) +Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) diff --git a/docs/framework/vue/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/vue/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md index 733a1a5ad75..4412ad00c8e 100644 --- a/docs/framework/vue/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md +++ b/docs/framework/vue/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedInfiniteQueryObserverOptions type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:538](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L538) +Defined in: [packages/query-core/src/types.ts:549](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L549) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/vue/reference/type-aliases/DefaultedQueryObserverOptions.md index 1b4309f150c..9ce8401b128 100644 --- a/docs/framework/vue/reference/type-aliases/DefaultedQueryObserverOptions.md +++ b/docs/framework/vue/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedQueryObserverOptions type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L509) +Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index d82cfa37d51..cec33b142b7 100644 --- a/docs/framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) +Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/vue/reference/type-aliases/DefinedQueryObserverResult.md index 97fcae175a9..b4480af3810 100644 --- a/docs/framework/vue/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/vue/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) +Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/vue/reference/type-aliases/EnsureInfiniteQueryDataOptions.md index 305eef94893..ff75b1c3449 100644 --- a/docs/framework/vue/reference/type-aliases/EnsureInfiniteQueryDataOptions.md +++ b/docs/framework/vue/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -7,7 +7,7 @@ title: EnsureInfiniteQueryDataOptions type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; ``` -Defined in: [packages/query-core/src/types.ts:612](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L612) +Defined in: [packages/query-core/src/types.ts:623](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L623) ## Type Declaration diff --git a/docs/framework/vue/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/vue/reference/type-aliases/FetchInfiniteQueryOptions.md index 1ee1470b14a..c926bbd3ae5 100644 --- a/docs/framework/vue/reference/type-aliases/FetchInfiniteQueryOptions.md +++ b/docs/framework/vue/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: FetchInfiniteQueryOptions type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:656](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L656) +Defined in: [packages/query-core/src/types.ts:667](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L667) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/FetchStatus.md b/docs/framework/vue/reference/type-aliases/FetchStatus.md index 7b71e54eacd..b347069e97e 100644 --- a/docs/framework/vue/reference/type-aliases/FetchStatus.md +++ b/docs/framework/vue/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:741](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L741) +Defined in: [packages/query-core/src/types.ts:752](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L752) diff --git a/docs/framework/vue/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/vue/reference/type-aliases/InfiniteQueryExecuteOptions.md index 29c974cfddf..c198662a319 100644 --- a/docs/framework/vue/reference/type-aliases/InfiniteQueryExecuteOptions.md +++ b/docs/framework/vue/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -7,7 +7,7 @@ title: InfiniteQueryExecuteOptions type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:635](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L635) +Defined in: [packages/query-core/src/types.ts:646](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L646) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/vue/reference/type-aliases/InfiniteQueryObserverResult.md index 7a646bc1c38..42279b19c00 100644 --- a/docs/framework/vue/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/vue/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) +Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/MutateFunction.md b/docs/framework/vue/reference/type-aliases/MutateFunction.md index 284bd0fc270..558040d3439 100644 --- a/docs/framework/vue/reference/type-aliases/MutateFunction.md +++ b/docs/framework/vue/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1271](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1271) +Defined in: [packages/query-core/src/types.ts:1306](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1306) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/MutateFunctionRest.md b/docs/framework/vue/reference/type-aliases/MutateFunctionRest.md index a2f16ea5302..3e7a5217482 100644 --- a/docs/framework/vue/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/vue/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1256) +Defined in: [packages/query-core/src/types.ts:1291](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1291) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/MutationFunction.md b/docs/framework/vue/reference/type-aliases/MutationFunction.md index 4c8c7aed384..330af1ef65a 100644 --- a/docs/framework/vue/reference/type-aliases/MutationFunction.md +++ b/docs/framework/vue/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1174](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1174) +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/MutationFunctionContext.md b/docs/framework/vue/reference/type-aliases/MutationFunctionContext.md index ef228cc53d3..97de2f1c220 100644 --- a/docs/framework/vue/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/vue/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) +Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1169) +Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1180) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1169](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1170) +Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1170](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) +Defined in: [packages/query-core/src/types.ts:1182](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1182) diff --git a/docs/framework/vue/reference/type-aliases/MutationKey.md b/docs/framework/vue/reference/type-aliases/MutationKey.md index 7157d6052fd..8e9d3bc3b3a 100644 --- a/docs/framework/vue/reference/type-aliases/MutationKey.md +++ b/docs/framework/vue/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) diff --git a/docs/framework/vue/reference/type-aliases/MutationMeta.md b/docs/framework/vue/reference/type-aliases/MutationMeta.md index f3bf9984fab..474c593e206 100644 --- a/docs/framework/vue/reference/type-aliases/MutationMeta.md +++ b/docs/framework/vue/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1160](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1160) +Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) diff --git a/docs/framework/vue/reference/type-aliases/MutationObserverResult.md b/docs/framework/vue/reference/type-aliases/MutationObserverResult.md index 3390192e071..21e43836bf6 100644 --- a/docs/framework/vue/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/vue/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1429](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1429) +Defined in: [packages/query-core/src/types.ts:1464](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1464) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/MutationScope.md b/docs/framework/vue/reference/type-aliases/MutationScope.md index a2511c903d9..feac9d9d17a 100644 --- a/docs/framework/vue/reference/type-aliases/MutationScope.md +++ b/docs/framework/vue/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1156) +Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1167) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1156](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1157](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1157) +Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) diff --git a/docs/framework/vue/reference/type-aliases/MutationStatus.md b/docs/framework/vue/reference/type-aliases/MutationStatus.md index d9b58cdd26f..4cd2d3c9535 100644 --- a/docs/framework/vue/reference/type-aliases/MutationStatus.md +++ b/docs/framework/vue/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1154](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1154) +Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) diff --git a/docs/framework/vue/reference/type-aliases/NotifyEventType.md b/docs/framework/vue/reference/type-aliases/NotifyEventType.md index 94912df6c6b..9bbc85e4ce8 100644 --- a/docs/framework/vue/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/vue/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) +Defined in: [packages/query-core/src/types.ts:1510](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1510) diff --git a/docs/framework/vue/reference/type-aliases/QueryObserverResult.md b/docs/framework/vue/reference/type-aliases/QueryObserverResult.md index f5c6c95d5f2..4fc661a6c9d 100644 --- a/docs/framework/vue/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/vue/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) +Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/QueryStatus.md b/docs/framework/vue/reference/type-aliases/QueryStatus.md index 3fc872e604b..6679b8b17c6 100644 --- a/docs/framework/vue/reference/type-aliases/QueryStatus.md +++ b/docs/framework/vue/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:740](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L740) +Defined in: [packages/query-core/src/types.ts:751](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L751) diff --git a/docs/framework/vue/reference/type-aliases/SkipToken.md b/docs/framework/vue/reference/type-aliases/SkipToken.md index 176c23830d2..3a5791b982e 100644 --- a/docs/framework/vue/reference/type-aliases/SkipToken.md +++ b/docs/framework/vue/reference/type-aliases/SkipToken.md @@ -7,6 +7,6 @@ title: SkipToken type SkipToken = typeof skipToken; ``` -Defined in: [packages/query-core/src/utils.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L524) +Defined in: [packages/query-core/src/utils.ts:526](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L526) The type of the [skipToken](../variables/skipToken.md) sentinel value. diff --git a/docs/framework/vue/reference/type-aliases/ThrowOnError.md b/docs/framework/vue/reference/type-aliases/ThrowOnError.md index 60ad44c1cd1..613549e4d52 100644 --- a/docs/framework/vue/reference/type-aliases/ThrowOnError.md +++ b/docs/framework/vue/reference/type-aliases/ThrowOnError.md @@ -7,7 +7,7 @@ title: ThrowOnError type ThrowOnError = boolean | (error, query) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L361) +Defined in: [packages/query-core/src/types.ts:363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L363) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/Updater.md b/docs/framework/vue/reference/type-aliases/Updater.md index b6a29ccc5fc..7a0c2f30503 100644 --- a/docs/framework/vue/reference/type-aliases/Updater.md +++ b/docs/framework/vue/reference/type-aliases/Updater.md @@ -7,7 +7,7 @@ title: Updater type Updater = TOutput | (input) => TOutput; ``` -Defined in: [packages/query-core/src/utils.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L103) +Defined in: [packages/query-core/src/utils.ts:105](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L105) Either a plain value of type `TOutput`, or a function that receives `TInput` and returns `TOutput`. Used for example by `setQueryData`-style updaters, which accept either the new data directly or a diff --git a/docs/framework/vue/reference/type-aliases/WithRequired.md b/docs/framework/vue/reference/type-aliases/WithRequired.md index c8ef831db3c..deb87dfe4a4 100644 --- a/docs/framework/vue/reference/type-aliases/WithRequired.md +++ b/docs/framework/vue/reference/type-aliases/WithRequired.md @@ -7,7 +7,7 @@ title: WithRequired type WithRequired = TTarget & { [_ in TKey]: {} }; ``` -Defined in: [packages/query-core/src/types.ts:505](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L505) +Defined in: [packages/query-core/src/types.ts:516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L516) ## Type Parameters diff --git a/docs/framework/vue/reference/variables/isServer.md b/docs/framework/vue/reference/variables/isServer.md index 28956d55cbf..16aa39d1244 100644 --- a/docs/framework/vue/reference/variables/isServer.md +++ b/docs/framework/vue/reference/variables/isServer.md @@ -7,7 +7,7 @@ title: isServer const isServer: boolean; ``` -Defined in: [packages/query-core/src/utils.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L112) +Defined in: [packages/query-core/src/utils.ts:114](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L114) ## Deprecated diff --git a/docs/framework/vue/reference/variables/skipToken.md b/docs/framework/vue/reference/variables/skipToken.md index 3163e91c1c2..a390d0b7b66 100644 --- a/docs/framework/vue/reference/variables/skipToken.md +++ b/docs/framework/vue/reference/variables/skipToken.md @@ -7,7 +7,7 @@ title: skipToken const skipToken: typeof skipToken; ``` -Defined in: [packages/query-core/src/utils.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L520) +Defined in: [packages/query-core/src/utils.ts:522](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L522) Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`, diff --git a/packages/query-core/src/queriesObserver.ts b/packages/query-core/src/queriesObserver.ts index 12ea3e1673d..cbffcfc830f 100644 --- a/packages/query-core/src/queriesObserver.ts +++ b/packages/query-core/src/queriesObserver.ts @@ -28,6 +28,8 @@ export interface QueriesObserverOptions< * observed query) into a single value. The combined value is memoized and * only recomputed when one of the underlying results, the query hashes, or * the `combine` function itself changes. + * + * Defaults to returning the array of `QueryObserverResult`s unchanged. */ combine?: CombineFn } diff --git a/packages/query-core/src/types.ts b/packages/query-core/src/types.ts index e1514a92993..3858f8fe1d0 100644 --- a/packages/query-core/src/types.ts +++ b/packages/query-core/src/types.ts @@ -240,6 +240,7 @@ export interface QueryOptions< * If `true`, failed queries will retry infinitely. * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + * * Defaults to `3` on the client and `0` on the server. */ retry?: RetryValue @@ -318,6 +319,7 @@ export interface QueryOptions< /** * Set this to `false` to disable structural sharing between query results. * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + * * Defaults to `true`. */ structuralSharing?: @@ -385,6 +387,7 @@ export interface QueryObserverOptions< * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. * To refetch the query, use the `refetch` method returned from the `useQuery` instance. * Accepts a boolean or function that returns a boolean. + * * Defaults to `true`. */ enabled?: QueryBooleanOption @@ -393,12 +396,14 @@ export interface QueryObserverOptions< * If set to `Infinity`, the data will never be considered stale. * If set to `'static'`, the data will never be considered stale. * If set to a function, the function will be executed with the query to compute a `staleTime`. + * * Defaults to `0`. */ staleTime?: StaleTimeFunction /** * If set to a number, the query will continuously refetch at this frequency in milliseconds. * If set to a function, the function will be executed with the latest data and query to compute a frequency + * * Defaults to `false`. */ refetchInterval?: @@ -417,6 +422,7 @@ export interface QueryObserverOptions< * If set to `false`, the query will not refetch on window focus. * If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). * If set to a function, the function will be executed with the latest data and query to compute the value. + * * Defaults to `true`. */ refetchOnWindowFocus?: @@ -430,6 +436,7 @@ export interface QueryObserverOptions< * If set to `false`, the query will not refetch on reconnect. * If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). * If set to a function, the function will be executed with the latest data and query to compute the value. + * * Defaults to `true` unless `networkMode` is `'always'`. */ refetchOnReconnect?: @@ -443,6 +450,7 @@ export interface QueryObserverOptions< * If set to `false`, will disable additional instances of a query to trigger background refetch. * If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). * If set to a function, the function will be executed with the latest data and query to compute the value + * * Defaults to `true`. */ refetchOnMount?: @@ -454,6 +462,7 @@ export interface QueryObserverOptions< /** * If set to `false`, the query will not be retried on mount if it contains an error. * If set to a function, the function will be executed with the query to compute the value. + * * Defaults to `true`. */ retryOnMount?: QueryBooleanOption @@ -470,6 +479,7 @@ export interface QueryObserverOptions< * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. * If set to `false` and `suspense` is `false`, errors are returned as state. * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + * * Defaults to `false`. */ throwOnError?: ThrowOnError @@ -483,6 +493,7 @@ export interface QueryObserverOptions< /** * If set to `true`, the query will suspend when `status === 'pending'` * and throw errors when `status === 'error'`. + * * Defaults to `false`. */ suspense?: boolean @@ -1207,9 +1218,33 @@ export interface MutationOptions< onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext, ) => Promise | unknown + /** + * If `false`, failed mutations will not retry by default. + * If `true`, failed mutations will retry infinitely. + * If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. + * If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + * + * Defaults to `0`. + */ retry?: RetryValue + /** + * This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the + * next attempt in milliseconds. + * + * Defaults to a function that applies exponential backoff, capped at 30 seconds. + */ retryDelay?: RetryDelayValue + /** + * Defaults to `'online'`. + * @see [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + */ networkMode?: NetworkMode + /** + * The time in milliseconds that an unused/inactive mutation remains in memory before it is + * garbage collected. + * + * Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. + */ gcTime?: number /** @internal */ _defaulted?: boolean diff --git a/packages/query-core/src/utils.ts b/packages/query-core/src/utils.ts index 22d8f68d0c7..4d40399eb20 100644 --- a/packages/query-core/src/utils.ts +++ b/packages/query-core/src/utils.ts @@ -31,6 +31,8 @@ type TuplePrefixes> = T extends readonly [] export interface QueryFilters { /** * Filter to active queries, inactive queries or all queries + * + * Defaults to `'all'`. */ type?: QueryTypeFilter /** From 077deb8cfda86daf0acbb4ba630b2e97b758ce2b Mon Sep 17 00:00:00 2001 From: Wonsuk Choi Date: Mon, 7 Sep 2026 04:41:34 +0900 Subject: [PATCH 7/9] fix(query-devtools): drop unnecessary 'query-core' project reference --- .../reference/classes/CancelledError.md | 8 +- .../classes/InfiniteQueryObserver.md | 58 ++++++------- .../angular/reference/classes/Mutation.md | 28 +++---- .../reference/classes/MutationCache.md | 38 ++++----- .../reference/classes/MutationObserver.md | 30 +++---- .../reference/classes/QueriesObserver.md | 26 +++--- .../angular/reference/classes/Query.md | 60 ++++++------- .../angular/reference/classes/QueryCache.md | 44 +++++----- .../angular/reference/classes/QueryClient.md | 84 +++++++++---------- .../reference/classes/QueryObserver.md | 54 ++++++------ .../defaultShouldDehydrateMutation.md | 2 +- .../functions/defaultShouldDehydrateQuery.md | 2 +- .../angular/reference/functions/dehydrate.md | 8 +- .../reference/functions/dehydrateQuery.md | 2 +- .../functions/experimental_streamedQuery.md | 2 +- .../angular/reference/functions/hashKey.md | 2 +- .../angular/reference/functions/hydrate.md | 2 +- .../reference/functions/isCancelledError.md | 2 +- .../reference/functions/keepPreviousData.md | 2 +- .../reference/functions/matchMutation.md | 2 +- .../angular/reference/functions/matchQuery.md | 2 +- .../angular/reference/functions/noop.md | 4 +- .../reference/functions/partialMatchKey.md | 2 +- .../reference/functions/replaceEqualDeep.md | 2 +- .../reference/functions/shouldThrowError.md | 2 +- .../reference/interfaces/CancelOptions.md | 6 +- .../interfaces/CreateBaseQueryOptions.md | 65 ++++++++------ .../interfaces/CreateInfiniteQueryOptions.md | 68 ++++++++------- .../interfaces/CreateMutationOptions.md | 49 ++++++++--- .../interfaces/CreateQueryOptions.md | 62 ++++++++------ .../reference/interfaces/DefaultOptions.md | 10 +-- .../reference/interfaces/DehydrateOptions.md | 10 +-- .../reference/interfaces/DehydratedState.md | 6 +- .../interfaces/EnsureQueryDataOptions.md | 38 +++++---- .../interfaces/FetchNextPageOptions.md | 6 +- .../interfaces/FetchPreviousPageOptions.md | 6 +- .../reference/interfaces/FetchQueryOptions.md | 36 ++++---- .../reference/interfaces/FocusManager.md | 20 ++--- .../reference/interfaces/HydrateOptions.md | 4 +- .../reference/interfaces/InfiniteData.md | 6 +- .../InfiniteQueryObserverBaseResult.md | 68 +++++++-------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 +++++++-------- .../InfiniteQueryObserverLoadingResult.md | 68 +++++++-------- .../InfiniteQueryObserverOptions.md | 73 +++++++++------- .../InfiniteQueryObserverPendingResult.md | 68 +++++++-------- .../InfiniteQueryObserverPlaceholderResult.md | 68 +++++++-------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 +++++++-------- .../InfiniteQueryObserverSuccessResult.md | 68 +++++++-------- .../InfiniteQueryPageParamsOptions.md | 8 +- .../reference/interfaces/InitialPageParam.md | 4 +- .../reference/interfaces/InvalidateOptions.md | 6 +- .../interfaces/InvalidateQueryFilters.md | 18 ++-- .../reference/interfaces/MutateOptions.md | 8 +- .../interfaces/MutationCacheConfig.md | 10 +-- .../reference/interfaces/MutationFilters.md | 10 +-- .../interfaces/MutationObserverBaseResult.md | 32 +++---- .../interfaces/MutationObserverErrorResult.md | 32 +++---- .../interfaces/MutationObserverIdleResult.md | 32 +++---- .../MutationObserverLoadingResult.md | 32 +++---- .../interfaces/MutationObserverOptions.md | 51 +++++++---- .../MutationObserverSuccessResult.md | 32 +++---- .../reference/interfaces/MutationOptions.md | 49 ++++++++--- .../reference/interfaces/MutationState.md | 20 ++--- .../reference/interfaces/NotifyEvent.md | 4 +- .../reference/interfaces/OnlineManager.md | 18 ++-- .../interfaces/QueriesObserverOptions.md | 6 +- .../reference/interfaces/QueryCacheConfig.md | 8 +- .../reference/interfaces/QueryClientConfig.md | 8 +- .../interfaces/QueryExecuteOptions.md | 38 +++++---- .../reference/interfaces/QueryFilters.md | 16 ++-- .../interfaces/QueryObserverBaseResult.md | 52 ++++++------ .../QueryObserverLoadingErrorResult.md | 52 ++++++------ .../interfaces/QueryObserverLoadingResult.md | 52 ++++++------ .../interfaces/QueryObserverOptions.md | 67 ++++++++------- .../interfaces/QueryObserverPendingResult.md | 52 ++++++------ .../QueryObserverPlaceholderResult.md | 52 ++++++------ .../QueryObserverRefetchErrorResult.md | 52 ++++++------ .../interfaces/QueryObserverSuccessResult.md | 52 ++++++------ .../reference/interfaces/QueryOptions.md | 32 +++---- .../reference/interfaces/QueryState.md | 26 +++--- .../reference/interfaces/RefetchOptions.md | 6 +- .../interfaces/RefetchQueryFilters.md | 16 ++-- .../angular/reference/interfaces/Register.md | 2 +- .../reference/interfaces/ResetOptions.md | 6 +- .../reference/interfaces/ResultOptions.md | 4 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../reference/interfaces/TimeoutManager.md | 12 +-- .../reference/type-aliases/AnyDataTag.md | 6 +- .../angular/reference/type-aliases/DataTag.md | 2 +- .../reference/type-aliases/DefaultError.md | 2 +- .../DefaultedInfiniteQueryObserverOptions.md | 2 +- .../DefaultedQueryObserverOptions.md | 2 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../type-aliases/DistributiveOmit.md | 2 +- .../EnsureInfiniteQueryDataOptions.md | 2 +- .../type-aliases/FetchInfiniteQueryOptions.md | 2 +- .../reference/type-aliases/FetchStatus.md | 2 +- .../type-aliases/GetNextPageParamFunction.md | 2 +- .../GetPreviousPageParamFunction.md | 2 +- .../type-aliases/InferDataFromTag.md | 2 +- .../type-aliases/InferErrorFromTag.md | 2 +- .../InfiniteQueryExecuteOptions.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../type-aliases/InitialDataFunction.md | 2 +- .../reference/type-aliases/ManagedTimerId.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationCacheNotifyEvent.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +- .../reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NetworkMode.md | 2 +- .../type-aliases/NonUndefinedGuard.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/NotifyOnChangeProps.md | 2 +- .../reference/type-aliases/OmitKeyof.md | 2 +- .../reference/type-aliases/Override.md | 2 +- .../type-aliases/PlaceholderDataFunction.md | 2 +- .../QueriesPlaceholderDataFunction.md | 2 +- .../type-aliases/QueryBooleanOption.md | 2 +- .../type-aliases/QueryCacheNotifyEvent.md | 2 +- .../reference/type-aliases/QueryFunction.md | 2 +- .../type-aliases/QueryFunctionContext.md | 2 +- .../reference/type-aliases/QueryKey.md | 2 +- .../type-aliases/QueryKeyHashFunction.md | 2 +- .../type-aliases/QueryKeyWithDataTag.md | 4 +- .../reference/type-aliases/QueryMeta.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../reference/type-aliases/QueryPersister.md | 2 +- .../reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/SkipToken.md | 2 +- .../reference/type-aliases/StaleTime.md | 2 +- .../type-aliases/StaleTimeFunction.md | 2 +- .../reference/type-aliases/ThrowOnError.md | 2 +- .../reference/type-aliases/TimeoutCallback.md | 2 +- .../reference/type-aliases/TimeoutProvider.md | 10 +-- .../reference/type-aliases/UnsetMarker.md | 2 +- .../angular/reference/type-aliases/Updater.md | 2 +- .../reference/type-aliases/WithRequired.md | 2 +- .../type-aliases/dataTagErrorSymbol.md | 2 +- .../reference/type-aliases/dataTagSymbol.md | 2 +- .../reference/variables/dataTagErrorSymbol.md | 4 +- .../reference/variables/dataTagSymbol.md | 4 +- .../reference/variables/defaultScheduler.md | 4 +- .../reference/variables/environmentManager.md | 12 ++- .../reference/variables/focusManager.md | 2 +- .../angular/reference/variables/isServer.md | 2 +- .../reference/variables/notifyManager.md | 4 +- .../reference/variables/onlineManager.md | 2 +- .../angular/reference/variables/skipToken.md | 4 +- .../reference/variables/timeoutManager.md | 2 +- .../reference/variables/unsetMarker.md | 4 +- packages/query-devtools/tsconfig.json | 3 +- 158 files changed, 1361 insertions(+), 1216 deletions(-) diff --git a/docs/framework/angular/reference/classes/CancelledError.md b/docs/framework/angular/reference/classes/CancelledError.md index 61d35ba7178..7fded5da20f 100644 --- a/docs/framework/angular/reference/classes/CancelledError.md +++ b/docs/framework/angular/reference/classes/CancelledError.md @@ -3,7 +3,7 @@ id: CancelledError title: CancelledError --- -Defined in: packages/query-core/dist-ts/src/retryer.d.ts:47 +Defined in: [packages/query-core/src/retryer.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L77) The error thrown by a `Retryer` (and surfaced to `query.promise`/`mutation`) when a fetch is cancelled, e.g. via `query.cancel()`. `revert`, if `true`, tells the caller to restore the state the query was in before the fetch @@ -36,7 +36,7 @@ try { new CancelledError(options?): CancelledError; ``` -Defined in: packages/query-core/dist-ts/src/retryer.d.ts:50 +Defined in: [packages/query-core/src/retryer.ts:80](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L80) #### Parameters @@ -110,7 +110,7 @@ Error.name optional revert: boolean; ``` -Defined in: packages/query-core/dist-ts/src/retryer.d.ts:48 +Defined in: [packages/query-core/src/retryer.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L78) *** @@ -120,7 +120,7 @@ Defined in: packages/query-core/dist-ts/src/retryer.d.ts:48 optional silent: boolean; ``` -Defined in: packages/query-core/dist-ts/src/retryer.d.ts:49 +Defined in: [packages/query-core/src/retryer.ts:79](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L79) *** diff --git a/docs/framework/angular/reference/classes/InfiniteQueryObserver.md b/docs/framework/angular/reference/classes/InfiniteQueryObserver.md index df9ac3bc2e0..af43087a3ad 100644 --- a/docs/framework/angular/reference/classes/InfiniteQueryObserver.md +++ b/docs/framework/angular/reference/classes/InfiniteQueryObserver.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserver title: InfiniteQueryObserver --- -Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:26 +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L41) An `InfiniteQueryObserver` extends `QueryObserver` to observe and switch between infinite queries. It augments the base `QueryObserverResult` with @@ -58,7 +58,7 @@ const unsubscribe = observer.subscribe((result) => console.log(result)) new InfiniteQueryObserver(client, options): InfiniteQueryObserver; ``` -Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:30 +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L83) #### Parameters @@ -86,7 +86,7 @@ Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:30 protected fetch: ReplaceReturnType<(fetchOptions) => Promise>, Promise>>; ``` -Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:29 +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:72](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L72) #### Overrides @@ -102,7 +102,7 @@ QueryObserver.fetch getCurrentResult: ReplaceReturnType<() => QueryObserverResult, InfiniteQueryObserverResult>; ``` -Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:28 +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L60) Returns the most recently computed `QueryObserverResult` for the observed query. This is a point-in-time read; to be notified of updates @@ -130,7 +130,7 @@ QueryObserver.getCurrentResult protected listeners: Set>; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) #### Inherited from @@ -144,7 +144,7 @@ Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 options: QueryObserverOptions, TQueryKey>; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:31 +Defined in: [packages/query-core/src/queryObserver.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L89) #### Inherited from @@ -158,7 +158,7 @@ Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:31 subscribe: (listener) => () => void; ``` -Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:27 +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:55](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L55) #### Parameters @@ -190,7 +190,7 @@ QueryObserver.subscribe protected bindMethods(): void; ``` -Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:31 +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L96) #### Returns @@ -208,7 +208,7 @@ Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:31 protected createResult(query, options): InfiniteQueryObserverResult; ``` -Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:84 +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:201](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L201) #### Parameters @@ -236,7 +236,7 @@ Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:84 destroy(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:53 +Defined in: [packages/query-core/src/queryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L161) Stops observing the current query: clears all listeners, cancels the stale and refetch-interval timers, and removes this observer from the @@ -258,7 +258,7 @@ query it was observing. fetchNextPage(options?): Promise>; ``` -Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:64 +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L161) Fetches the next page of the infinite query and returns a promise that resolves with the resulting `InfiniteQueryObserverResult`. The page @@ -298,7 +298,7 @@ if (hasNextPage) { fetchOptimistic(options): Promise>; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:134 +Defined in: [packages/query-core/src/queryObserver.ts:395](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L395) Fetches a query defined by the given options without affecting this observer's own tracked query or result, and returns a promise that @@ -338,7 +338,7 @@ console.log(result.data) fetchPreviousPage(options?): Promise>; ``` -Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:83 +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:190](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L190) Fetches the previous page of the infinite query and returns a promise that resolves with the resulting `InfiniteQueryObserverResult`. The page @@ -378,7 +378,7 @@ if (hasPreviousPage) { getCurrentQuery(): Query, TQueryKey>; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:106 +Defined in: [packages/query-core/src/queryObserver.ts:357](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L357) Returns the `Query` instance this observer is currently observing. @@ -398,7 +398,7 @@ Returns the `Query` instance this observer is currently observing. getOptimisticResult(options): InfiniteQueryObserverResult; ``` -Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:45 +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L127) The infinite-query counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult), marking the options as an infinite query before delegating to it. Called by framework adapters (e.g. @@ -427,7 +427,7 @@ synchronously. hasListeners(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) #### Returns @@ -445,7 +445,7 @@ Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 protected onSubscribe(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:34 +Defined in: [packages/query-core/src/queryObserver.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L110) #### Returns @@ -463,7 +463,7 @@ Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:34 protected onUnsubscribe(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:35 +Defined in: [packages/query-core/src/queryObserver.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L124) #### Returns @@ -478,19 +478,19 @@ Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:35 ### refetch() ```ts -refetch(__namedParameters?): Promise>; +refetch(__namedParameters): Promise>; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:117 +Defined in: [packages/query-core/src/queryObserver.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L371) Refetches the observed query and returns a promise that resolves with the resulting `QueryObserverResult`. #### Parameters -##### \_\_namedParameters? +##### \_\_namedParameters -[`RefetchOptions`](../interfaces/RefetchOptions.md) +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` #### Returns @@ -515,7 +515,7 @@ console.log(result.data) setOptions(options): void; ``` -Defined in: packages/query-core/dist-ts/src/infiniteQueryObserver.d.ts:38 +Defined in: [packages/query-core/src/infiniteQueryObserver.ts:108](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L108) Updates the observer's options. Behaves the same as `QueryObserver.setOptions`, additionally marking the options as @@ -544,7 +544,7 @@ implementation. shouldFetchOnReconnect(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:41 +Defined in: [packages/query-core/src/queryObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L135) Returns whether the observed query is currently stale and configured (via the `refetchOnReconnect` option) to refetch when the network @@ -566,7 +566,7 @@ reconnects. shouldFetchOnWindowFocus(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:47 +Defined in: [packages/query-core/src/queryObserver.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L148) Returns whether the observed query is currently stale and configured (via the `refetchOnWindowFocus` option) to refetch when the window @@ -588,7 +588,7 @@ regains focus. trackProp(key): void; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:102 +Defined in: [packages/query-core/src/queryObserver.ts:350](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L350) Records that the given `QueryObserverResult` property was read, so a subsequent update only notifies this observer if a tracked property actually changed. Normally called indirectly via @@ -599,7 +599,7 @@ access themselves (e.g. through their own reactivity system) instead of via the ##### key -`"status"` | `"error"` | `"isSuccess"` | `"isError"` | `"isPending"` | `"data"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isPlaceholderData"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` +`"error"` | `"data"` | `"isError"` | `"isPending"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isSuccess"` | `"isPlaceholderData"` | `"status"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` #### Returns @@ -617,7 +617,7 @@ access themselves (e.g. through their own reactivity system) instead of via the trackResult(result, onPropTracked?): QueryObserverResult; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:95 +Defined in: [packages/query-core/src/queryObserver.ts:331](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L331) Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via [QueryObserver#trackProp](QueryObserver.md#trackprop) (and an optional `onPropTracked` callback). Used by framework @@ -650,7 +650,7 @@ properties you actually read" behavior. updateResult(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:142 +Defined in: [packages/query-core/src/queryObserver.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L735) Recomputes and stores the current result from the current query/options, notifying listeners if it changed. Framework adapters call this right after subscribing to make sure no query diff --git a/docs/framework/angular/reference/classes/Mutation.md b/docs/framework/angular/reference/classes/Mutation.md index 4d328066b21..e038a9cd394 100644 --- a/docs/framework/angular/reference/classes/Mutation.md +++ b/docs/framework/angular/reference/classes/Mutation.md @@ -3,7 +3,7 @@ id: Mutation title: Mutation --- -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:101 +Defined in: [packages/query-core/src/mutation.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L135) Represents a single mutation attempt. A `Mutation` holds the mutation's options, state (data/error/status), and the `MutationObserver`s currently @@ -52,7 +52,7 @@ const mutation = mutationCache.find({ mutationKey: ['addPost'] }) new Mutation(config): Mutation; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:106 +Defined in: [packages/query-core/src/mutation.ts:152](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L152) #### Parameters @@ -78,7 +78,7 @@ Removable.constructor gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/removable.d.ts:3 +Defined in: [packages/query-core/src/removable.ts:7](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L7) #### Inherited from @@ -94,7 +94,7 @@ Removable.gcTime readonly mutationId: number; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:105 +Defined in: [packages/query-core/src/mutation.ts:143](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L143) *** @@ -104,7 +104,7 @@ Defined in: packages/query-core/dist-ts/src/mutation.d.ts:105 options: MutationOptions; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:104 +Defined in: [packages/query-core/src/mutation.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L142) *** @@ -114,7 +114,7 @@ Defined in: packages/query-core/dist-ts/src/mutation.d.ts:104 state: MutationState; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:103 +Defined in: [packages/query-core/src/mutation.ts:141](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L141) ## Accessors @@ -126,7 +126,7 @@ Defined in: packages/query-core/dist-ts/src/mutation.d.ts:103 get meta(): Record | undefined; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:112 +Defined in: [packages/query-core/src/mutation.ts:179](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L179) The `meta` object passed in the mutation's options, if any. @@ -142,7 +142,7 @@ The `meta` object passed in the mutation's options, if any. protected clearGcTimeout(): void; ``` -Defined in: packages/query-core/dist-ts/src/removable.d.ts:7 +Defined in: [packages/query-core/src/removable.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L32) #### Returns @@ -162,7 +162,7 @@ Removable.clearGcTimeout continue(): Promise; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:139 +Defined in: [packages/query-core/src/mutation.ts:243](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L243) Resumes a mutation that is currently paused or was restored from a dehydrated, still-`pending` state. @@ -199,7 +199,7 @@ await mutation?.continue() destroy(): void; ``` -Defined in: packages/query-core/dist-ts/src/removable.d.ts:4 +Defined in: [packages/query-core/src/removable.ts:10](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L10) #### Returns @@ -219,7 +219,7 @@ Removable.destroy execute(variables): Promise; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:170 +Defined in: [packages/query-core/src/mutation.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L284) Runs the mutation function for the given variables through a retryer, and drives the mutation's state and lifecycle callbacks through to settlement. @@ -271,7 +271,7 @@ const data = await mutation.execute(variables) protected optionalRemove(): void; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:117 +Defined in: [packages/query-core/src/mutation.ts:212](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L212) #### Returns @@ -291,7 +291,7 @@ Removable.optionalRemove protected scheduleGc(): void; ``` -Defined in: packages/query-core/dist-ts/src/removable.d.ts:5 +Defined in: [packages/query-core/src/removable.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L14) #### Returns @@ -311,7 +311,7 @@ Removable.scheduleGc protected updateGcTime(newGcTime): void; ``` -Defined in: packages/query-core/dist-ts/src/removable.d.ts:6 +Defined in: [packages/query-core/src/removable.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L24) #### Parameters diff --git a/docs/framework/angular/reference/classes/MutationCache.md b/docs/framework/angular/reference/classes/MutationCache.md index 0b0b1b30bba..5a172b4cb9b 100644 --- a/docs/framework/angular/reference/classes/MutationCache.md +++ b/docs/framework/angular/reference/classes/MutationCache.md @@ -3,7 +3,7 @@ id: MutationCache title: MutationCache --- -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:75 +Defined in: [packages/query-core/src/mutationCache.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L124) The `MutationCache` is the storage for mutations. @@ -28,16 +28,16 @@ const unsubscribe = mutationCache.subscribe((event) => { ### Constructor ```ts -new MutationCache(config?): MutationCache; +new MutationCache(config): MutationCache; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:78 +Defined in: [packages/query-core/src/mutationCache.ts:129](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L129) #### Parameters -##### config? +##### config -[`MutationCacheConfig`](../interfaces/MutationCacheConfig.md) +[`MutationCacheConfig`](../interfaces/MutationCacheConfig.md) = `{}` #### Returns @@ -54,10 +54,10 @@ Subscribable.constructor ### config ```ts -config: MutationCacheConfig; +config: MutationCacheConfig = {}; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:77 +Defined in: [packages/query-core/src/mutationCache.ts:129](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L129) *** @@ -67,7 +67,7 @@ Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:77 protected listeners: Set; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) #### Inherited from @@ -83,7 +83,7 @@ Subscribable.listeners clear(): void; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:99 +Defined in: [packages/query-core/src/mutationCache.ts:236](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L236) Removes all mutations from the cache. @@ -109,7 +109,7 @@ find(filters): | undefined; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:129 +Defined in: [packages/query-core/src/mutationCache.ts:278](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L278) A slightly more advanced method that can be used to get an existing mutation instance from the cache. If the mutation does not exist, `undefined` is returned. @@ -163,10 +163,10 @@ const mutation = mutationCache.find({ mutationKey: ['addPost'] }) ### findAll() ```ts -findAll(filters?): Mutation[]; +findAll(filters): Mutation[]; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:145 +Defined in: [packages/query-core/src/mutationCache.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L308) An even more advanced method that can be used to get existing mutation instances from the cache that match the given filters. If no mutations match, an empty array is returned. @@ -176,9 +176,9 @@ information about mutations in rare scenarios. #### Parameters -##### filters? +##### filters -[`MutationFilters`](../interfaces/MutationFilters.md)\<`unknown`, `Error`, `unknown`, `unknown`\> +[`MutationFilters`](../interfaces/MutationFilters.md) = `{}` #### Returns @@ -204,7 +204,7 @@ const mutations = mutationCache.findAll({ mutationKey: ['addPost'] }) getAll(): Mutation[]; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:113 +Defined in: [packages/query-core/src/mutationCache.ts:259](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L259) Returns all mutations within the cache. @@ -231,7 +231,7 @@ const mutations = mutationCache.getAll() hasListeners(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) #### Returns @@ -251,7 +251,7 @@ Subscribable.hasListeners protected onSubscribe(): void; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:6 +Defined in: [packages/query-core/src/subscribable.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L23) #### Returns @@ -271,7 +271,7 @@ Subscribable.onSubscribe protected onUnsubscribe(): void; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:7 +Defined in: [packages/query-core/src/subscribable.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L27) #### Returns @@ -291,7 +291,7 @@ Subscribable.onUnsubscribe subscribe(listener): () => void; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:4 +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) #### Parameters diff --git a/docs/framework/angular/reference/classes/MutationObserver.md b/docs/framework/angular/reference/classes/MutationObserver.md index c7d705c17d7..a121c67b0e8 100644 --- a/docs/framework/angular/reference/classes/MutationObserver.md +++ b/docs/framework/angular/reference/classes/MutationObserver.md @@ -3,7 +3,7 @@ id: MutationObserver title: MutationObserver --- -Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:21 +Defined in: [packages/query-core/src/mutationObserver.ts:38](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L38) Observes a single mutation and derives a `MutationObserverResult` from it. A framework hook like `useMutation` creates one `MutationObserver` per hook @@ -50,7 +50,7 @@ const observer = new MutationObserver(queryClient, { new MutationObserver(client, options): MutationObserver; ``` -Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:24 +Defined in: [packages/query-core/src/mutationObserver.ts:58](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L58) #### Parameters @@ -69,7 +69,9 @@ Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:24 #### Overrides ```ts -Subscribable>.constructor +Subscribable< + MutationObserverListener +>.constructor ``` ## Properties @@ -80,7 +82,7 @@ Subscribable>; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) #### Inherited from @@ -96,7 +98,7 @@ Subscribable.listeners options: MutationObserverOptions; ``` -Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:23 +Defined in: [packages/query-core/src/mutationObserver.ts:46](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L46) ## Methods @@ -106,7 +108,7 @@ Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:23 protected bindMethods(): void; ``` -Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:25 +Defined in: [packages/query-core/src/mutationObserver.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L75) #### Returns @@ -120,7 +122,7 @@ Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:25 getCurrentResult(): MutationObserverResult; ``` -Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:52 +Defined in: [packages/query-core/src/mutationObserver.ts:155](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L155) Returns the observer's current result, derived from the observed mutation's state (or the default, `idle` state if no mutation has been @@ -138,7 +140,7 @@ built yet, e.g. before the first `mutate()` call or after `reset()`). hasListeners(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) #### Returns @@ -158,7 +160,7 @@ Subscribable.hasListeners mutate(variables, options?): Promise; ``` -Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:88 +Defined in: [packages/query-core/src/mutationObserver.ts:207](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L207) Builds a new `Mutation` in the `MutationCache` using the observer's current options, detaches this observer from any previously observed @@ -200,7 +202,7 @@ await observer.mutate( protected onSubscribe(): void; ``` -Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:43 +Defined in: [packages/query-core/src/mutationObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L127) #### Returns @@ -220,7 +222,7 @@ Subscribable.onSubscribe protected onUnsubscribe(): void; ``` -Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:44 +Defined in: [packages/query-core/src/mutationObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L135) #### Returns @@ -240,7 +242,7 @@ Subscribable.onUnsubscribe reset(): void; ``` -Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:69 +Defined in: [packages/query-core/src/mutationObserver.ts:180](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L180) Detaches the observer from the mutation it is currently observing (if any) and resets the observed result back to its default, `idle` state. @@ -272,7 +274,7 @@ observer.reset() setOptions(options): void; ``` -Defined in: packages/query-core/dist-ts/src/mutationObserver.d.ts:42 +Defined in: [packages/query-core/src/mutationObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L96) Updates the observer's options. @@ -308,7 +310,7 @@ observer.setOptions({ subscribe(listener): () => void; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:4 +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) #### Parameters diff --git a/docs/framework/angular/reference/classes/QueriesObserver.md b/docs/framework/angular/reference/classes/QueriesObserver.md index cce04d387ad..379e6fc95ee 100644 --- a/docs/framework/angular/reference/classes/QueriesObserver.md +++ b/docs/framework/angular/reference/classes/QueriesObserver.md @@ -3,7 +3,7 @@ id: QueriesObserver title: QueriesObserver --- -Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:35 +Defined in: [packages/query-core/src/queriesObserver.ts:56](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L56) A `QueriesObserver` watches an array of queries at once, exposing them as a single array of `QueryObserverResult`s (or, when a `combine` option is @@ -45,7 +45,7 @@ new QueriesObserver( options?): QueriesObserver; ``` -Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:37 +Defined in: [packages/query-core/src/queriesObserver.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L70) #### Parameters @@ -79,7 +79,7 @@ Subscribable.constructor protected listeners: Set; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) #### Inherited from @@ -95,7 +95,7 @@ Subscribable.listeners destroy(): void; ``` -Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:44 +Defined in: [packages/query-core/src/queriesObserver.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L106) Stops observing all queries: clears all listeners and destroys every underlying `QueryObserver` this observer manages. @@ -112,7 +112,7 @@ underlying `QueryObserver` this observer manages. getCurrentResult(): QueryObserverResult[]; ``` -Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:71 +Defined in: [packages/query-core/src/queriesObserver.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L210) Returns the most recently computed array of `QueryObserverResult`s, one per observed query, in the same order as the queries passed to the @@ -137,7 +137,7 @@ const data = results.map((result) => result.data) getObservers(): QueryObserver[]; ``` -Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:82 +Defined in: [packages/query-core/src/queriesObserver.ts:227](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L227) Returns the underlying `QueryObserver` instances this observer manages, in the same order as the queries passed to the constructor or @@ -155,7 +155,7 @@ in the same order as the queries passed to the constructor or getOptimisticResult(queries, combine): [QueryObserverResult[], (r?) => TCombinedResult, () => QueryObserverResult[]]; ``` -Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:90 +Defined in: [packages/query-core/src/queriesObserver.ts:238](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L238) The `QueriesObserver` counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult) — computes the result for the given (already-defaulted) queries right now, synchronously. Called by @@ -185,7 +185,7 @@ wrap the results for property-access tracking. getQueries(): Query[]; ``` -Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:76 +Defined in: [packages/query-core/src/queriesObserver.ts:218](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L218) Returns the underlying `Query` instances currently being observed, in the same order as the queries passed to the constructor or `setQueries`. @@ -202,7 +202,7 @@ the same order as the queries passed to the constructor or `setQueries`. hasListeners(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) #### Returns @@ -222,7 +222,7 @@ Subscribable.hasListeners protected onSubscribe(): void; ``` -Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:38 +Defined in: [packages/query-core/src/queriesObserver.ts:86](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L86) #### Returns @@ -242,7 +242,7 @@ Subscribable.onSubscribe protected onUnsubscribe(): void; ``` -Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:39 +Defined in: [packages/query-core/src/queriesObserver.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L96) #### Returns @@ -262,7 +262,7 @@ Subscribable.onUnsubscribe setQueries(queries, options?): void; ``` -Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:59 +Defined in: [packages/query-core/src/queriesObserver.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L127) Replaces the set of queries being observed. Existing `QueryObserver`s are reused for queries that match an already-observed query hash; @@ -300,7 +300,7 @@ observer.setQueries([ subscribe(listener): () => void; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:4 +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) #### Parameters diff --git a/docs/framework/angular/reference/classes/Query.md b/docs/framework/angular/reference/classes/Query.md index 2b7702bf60b..bc15461e541 100644 --- a/docs/framework/angular/reference/classes/Query.md +++ b/docs/framework/angular/reference/classes/Query.md @@ -3,7 +3,7 @@ id: Query title: Query --- -Defined in: packages/query-core/dist-ts/src/query.d.ts:154 +Defined in: [packages/query-core/src/query.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L225) Represents a single cached query. A `Query` holds the query's key, options, state (data/error/status), and the observers currently subscribed to it. @@ -54,7 +54,7 @@ if (query) { new Query(config): Query; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:161 +Defined in: [packages/query-core/src/query.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L246) #### Parameters @@ -80,7 +80,7 @@ Removable.constructor gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/removable.d.ts:3 +Defined in: [packages/query-core/src/removable.ts:7](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L7) #### Inherited from @@ -96,7 +96,7 @@ Removable.gcTime observers: QueryObserver[]; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:160 +Defined in: [packages/query-core/src/query.ts:242](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L242) *** @@ -106,7 +106,7 @@ Defined in: packages/query-core/dist-ts/src/query.d.ts:160 options: QueryOptions; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:158 +Defined in: [packages/query-core/src/query.ts:233](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L233) *** @@ -116,7 +116,7 @@ Defined in: packages/query-core/dist-ts/src/query.d.ts:158 queryHash: string; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:157 +Defined in: [packages/query-core/src/query.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L232) *** @@ -126,7 +126,7 @@ Defined in: packages/query-core/dist-ts/src/query.d.ts:157 queryKey: TQueryKey; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:156 +Defined in: [packages/query-core/src/query.ts:231](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L231) *** @@ -136,7 +136,7 @@ Defined in: packages/query-core/dist-ts/src/query.d.ts:156 state: QueryState; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:159 +Defined in: [packages/query-core/src/query.ts:234](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L234) ## Accessors @@ -148,7 +148,7 @@ Defined in: packages/query-core/dist-ts/src/query.d.ts:159 get meta(): Record | undefined; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:165 +Defined in: [packages/query-core/src/query.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L264) The `meta` object passed in the query's options, if any. @@ -166,7 +166,7 @@ The `meta` object passed in the query's options, if any. get promise(): Promise | undefined; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:172 +Defined in: [packages/query-core/src/query.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L277) The promise for the currently in-flight fetch, if the query is fetching. `undefined` when the query is not fetching. @@ -183,7 +183,7 @@ The promise for the currently in-flight fetch, if the query is fetching. cancel(options?): Promise; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:196 +Defined in: [packages/query-core/src/query.ts:348](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L348) Cancels the query's currently in-flight fetch, if any. - Returns a promise that resolves once the cancellation has settled. @@ -213,7 +213,7 @@ await query.cancel() protected clearGcTimeout(): void; ``` -Defined in: packages/query-core/dist-ts/src/removable.d.ts:7 +Defined in: [packages/query-core/src/removable.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L32) #### Returns @@ -233,7 +233,7 @@ Removable.clearGcTimeout destroy(): void; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:204 +Defined in: [packages/query-core/src/query.ts:361](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L361) Clears the query's garbage collection timeout and silently cancels any in-flight fetch. Called by `QueryCache` when the query is removed from @@ -261,7 +261,7 @@ Removable.destroy fetch(options?, fetchOptions?): Promise; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:309 +Defined in: [packages/query-core/src/query.ts:590](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L590) Fetches the query, i.e. runs its `queryFn` (through any configured retryer/behavior) and updates the query's state with the result. @@ -294,7 +294,7 @@ retryer/behavior) and updates the query's state with the result. getObserversCount(): number; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:287 +Defined in: [packages/query-core/src/query.ts:560](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L560) Returns the number of observers currently subscribed to this query. @@ -318,7 +318,7 @@ if (query.getObserversCount() === 0) { invalidate(): void; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:298 +Defined in: [packages/query-core/src/query.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L574) Marks the query as invalidated, unless it is already invalidated. This updates `state.isInvalidated` and notifies observers, but does not by @@ -342,7 +342,7 @@ query.invalidate() isActive(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:217 +Defined in: [packages/query-core/src/query.ts:386](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L386) Returns `true` if the query has at least one observer for which `enabled` does not resolve to `false`. @@ -359,7 +359,7 @@ does not resolve to `false`. isDisabled(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:226 +Defined in: [packages/query-core/src/query.ts:400](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L400) Returns `true` if the query is disabled, meaning it will not fetch automatically. @@ -380,7 +380,7 @@ automatically. isFetched(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:231 +Defined in: [packages/query-core/src/query.ts:412](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L412) Returns `true` if the query has been fetched, i.e. it has resolved with either data or an error at least once. @@ -397,7 +397,7 @@ either data or an error at least once. isStale(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:253 +Defined in: [packages/query-core/src/query.ts:447](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L447) Returns `true` if the query is stale. - If the query has observers, defers to whether any observer's current @@ -427,10 +427,10 @@ if (query.isStale()) { ### isStaleByTime() ```ts -isStaleByTime(staleTime?): boolean; +isStaleByTime(staleTime): boolean; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:268 +Defined in: [packages/query-core/src/query.ts:473](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L473) Returns `true` if the query's data is stale relative to the given `staleTime` (defaults to `0`). @@ -441,9 +441,9 @@ Returns `true` if the query's data is stale relative to the given #### Parameters -##### staleTime? +##### staleTime -[`StaleTime`](../type-aliases/StaleTime.md) +[`StaleTime`](../type-aliases/StaleTime.md) = `0` #### Returns @@ -467,7 +467,7 @@ const isStale = query.isStaleByTime(1000 * 60) isStatic(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:236 +Defined in: [packages/query-core/src/query.ts:420](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L420) Returns `true` if the query has at least one observer configured with `staleTime: 'static'`, meaning it is treated as never stale. @@ -484,7 +484,7 @@ Returns `true` if the query has at least one observer configured with protected optionalRemove(): void; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:175 +Defined in: [packages/query-core/src/query.ts:305](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L305) #### Returns @@ -504,7 +504,7 @@ Removable.optionalRemove reset(): void; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:212 +Defined in: [packages/query-core/src/query.ts:377](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L377) Resets the query back to its initial state (the state it had when it was first created, e.g. any `initialData`), destroying it first to cancel any @@ -522,7 +522,7 @@ in-flight fetch. protected scheduleGc(): void; ``` -Defined in: packages/query-core/dist-ts/src/removable.d.ts:5 +Defined in: [packages/query-core/src/removable.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L14) #### Returns @@ -542,7 +542,7 @@ Removable.scheduleGc setState(state): void; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:185 +Defined in: [packages/query-core/src/query.ts:334](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L334) Merges the given partial state directly into this query's state, notifying observers. Used by persistence and broadcast plugins to restore a state snapshot, and by devtools to let a @@ -566,7 +566,7 @@ user manually trigger a loading/error state or edit the cached data. protected updateGcTime(newGcTime): void; ``` -Defined in: packages/query-core/dist-ts/src/removable.d.ts:6 +Defined in: [packages/query-core/src/removable.ts:24](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L24) #### Parameters diff --git a/docs/framework/angular/reference/classes/QueryCache.md b/docs/framework/angular/reference/classes/QueryCache.md index c8fd03d76f6..b7a577b5e54 100644 --- a/docs/framework/angular/reference/classes/QueryCache.md +++ b/docs/framework/angular/reference/classes/QueryCache.md @@ -3,7 +3,7 @@ id: QueryCache title: QueryCache --- -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:85 +Defined in: [packages/query-core/src/queryCache.ts:123](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L123) The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta information, and state of the queries it contains. @@ -31,16 +31,16 @@ const unsubscribe = queryCache.subscribe((event) => { ### Constructor ```ts -new QueryCache(config?): QueryCache; +new QueryCache(config): QueryCache; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:88 +Defined in: [packages/query-core/src/queryCache.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L126) #### Parameters -##### config? +##### config -[`QueryCacheConfig`](../interfaces/QueryCacheConfig.md) +[`QueryCacheConfig`](../interfaces/QueryCacheConfig.md) = `{}` #### Returns @@ -57,10 +57,10 @@ Subscribable.constructor ### config ```ts -config: QueryCacheConfig; +config: QueryCacheConfig = {}; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:87 +Defined in: [packages/query-core/src/queryCache.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L126) *** @@ -70,7 +70,7 @@ Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:87 protected listeners: Set; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) #### Inherited from @@ -89,7 +89,7 @@ build( state?): Query; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:105 +Defined in: [packages/query-core/src/queryCache.ts:147](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L147) Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or builds and adds a new one to the cache if none exists yet. Used by framework adapters and @@ -151,7 +151,7 @@ const query = queryCache.build(queryClient, { clear(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:135 +Defined in: [packages/query-core/src/queryCache.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L232) Removes all queries from the cache. @@ -177,7 +177,7 @@ find(filters): | undefined; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:180 +Defined in: [packages/query-core/src/queryCache.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L299) A slightly more advanced method that can be used to get an existing query instance from the cache. This instance not only contains all the state for the query, but all of the instances, @@ -230,10 +230,10 @@ const query = queryCache.find({ queryKey: ['posts'] }) ### findAll() ```ts -findAll(filters?): Query[]; +findAll(filters): Query[]; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:196 +Defined in: [packages/query-core/src/queryCache.ts:324](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L324) An even more advanced method that can be used to get existing query instances from the cache that partially match a query key. If no queries match, an empty array is returned. @@ -243,9 +243,9 @@ information about queries in rare scenarios. #### Parameters -##### filters? +##### filters -[`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> +[`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = `{}` #### Returns @@ -273,7 +273,7 @@ get(queryHash): | undefined; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:150 +Defined in: [packages/query-core/src/queryCache.ts:254](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L254) Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none exists. Unlike [QueryCache#find](#find), this looks up by the already-computed hash rather @@ -326,7 +326,7 @@ const query = queryCache.get(queryHash) getAll(): Query[]; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:161 +Defined in: [packages/query-core/src/queryCache.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L277) Returns all queries within the cache. @@ -350,7 +350,7 @@ const queries = queryCache.getAll() hasListeners(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) #### Returns @@ -370,7 +370,7 @@ Subscribable.hasListeners protected onSubscribe(): void; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:6 +Defined in: [packages/query-core/src/subscribable.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L23) #### Returns @@ -390,7 +390,7 @@ Subscribable.onSubscribe protected onUnsubscribe(): void; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:7 +Defined in: [packages/query-core/src/subscribable.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L27) #### Returns @@ -410,7 +410,7 @@ Subscribable.onUnsubscribe remove(query): void; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:124 +Defined in: [packages/query-core/src/queryCache.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L208) Destroys the given `Query` and removes it from the cache, notifying subscribers with a `'removed'` event. A no-op if the query is no longer the one currently stored under its hash @@ -446,7 +446,7 @@ if (query) { subscribe(listener): () => void; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:4 +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) #### Parameters diff --git a/docs/framework/angular/reference/classes/QueryClient.md b/docs/framework/angular/reference/classes/QueryClient.md index 3ba8886041b..c7d1a034545 100644 --- a/docs/framework/angular/reference/classes/QueryClient.md +++ b/docs/framework/angular/reference/classes/QueryClient.md @@ -3,7 +3,7 @@ id: QueryClient title: QueryClient --- -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:24 +Defined in: [packages/query-core/src/queryClient.ts:79](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L79) `QueryClient` is used to interact with a cache of queries and mutations. It owns a `QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds @@ -28,16 +28,16 @@ await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts }) ### Constructor ```ts -new QueryClient(config?): QueryClient; +new QueryClient(config): QueryClient; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:26 +Defined in: [packages/query-core/src/queryClient.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L89) #### Parameters -##### config? +##### config -[`QueryClientConfig`](../interfaces/QueryClientConfig.md) +[`QueryClientConfig`](../interfaces/QueryClientConfig.md) = `{}` #### Returns @@ -51,7 +51,7 @@ Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:26 cancelQueries(filters?, cancelOptions?): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:180 +Defined in: [packages/query-core/src/queryClient.ts:432](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L432) Cancels outgoing fetches for queries matching the given filters. Most useful when performing optimistic updates, since any outgoing refetch that resolves afterwards would otherwise @@ -74,7 +74,7 @@ The returned promise never rejects, even if individual cancellations fail. ##### cancelOptions? -[`CancelOptions`](../interfaces/CancelOptions.md) +[`CancelOptions`](../interfaces/CancelOptions.md) = `{}` #### Returns @@ -94,7 +94,7 @@ await queryClient.cancelQueries({ queryKey: ['posts'], exact: true }) clear(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:430 +Defined in: [packages/query-core/src/queryClient.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1083) Clears both the query cache and the mutation cache this client is connected to. @@ -119,7 +119,7 @@ queryClient.clear() defaultMutationOptions(options?): T; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:418 +Defined in: [packages/query-core/src/queryClient.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1057) The mutation counterpart of [QueryClient#defaultQueryOptions](#defaultqueryoptions). Called by framework adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the @@ -150,7 +150,7 @@ on top. A no-op if the options are already defaulted (`_defaulted: true`). defaultQueryOptions(options): DefaultedQueryObserverOptions; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:411 +Defined in: [packages/query-core/src/queryClient.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L970) Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the @@ -201,7 +201,7 @@ on top. A no-op if the options are already defaulted (`_defaulted: true`). ensureInfiniteQueryData(options): Promise>; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:284 +Defined in: [packages/query-core/src/queryClient.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L735) #### Type Parameters @@ -247,7 +247,7 @@ Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This ensureQueryData(options): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:78 +Defined in: [packages/query-core/src/queryClient.ts:197](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L197) #### Type Parameters @@ -289,7 +289,7 @@ Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method fetchInfiniteQuery(options): Promise>; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:276 +Defined in: [packages/query-core/src/queryClient.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L692) #### Type Parameters @@ -335,7 +335,7 @@ Use queryClient.infiniteQuery(options) instead. This method will be removed in t fetchQuery(options): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:246 +Defined in: [packages/query-core/src/queryClient.ts:600](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L600) #### Type Parameters @@ -381,7 +381,7 @@ Use queryClient.query(options) instead. This method will be removed in the next getDefaultOptions(): DefaultOptions; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:336 +Defined in: [packages/query-core/src/queryClient.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L818) Returns the default options that were set when creating the client, or via [QueryClient#setDefaultOptions](#setdefaultoptions). @@ -407,7 +407,7 @@ const defaultOptions = queryClient.getDefaultOptions() getMutationCache(): MutationCache; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:323 +Defined in: [packages/query-core/src/queryClient.ts:802](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L802) Returns the mutation cache this client is connected to. @@ -433,7 +433,7 @@ const mutations = mutationCache.findAll({ status: 'pending' }) getMutationDefaults(mutationKey): OmitKeyof, "mutationKey">; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:404 +Defined in: [packages/query-core/src/queryClient.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L945) Returns the default options registered for mutations whose mutation key partially matches the given `mutationKey`, via [QueryClient#setMutationDefaults](#setmutationdefaults). If multiple registered @@ -463,7 +463,7 @@ const defaultOptions = queryClient.getMutationDefaults(['addPost']) getQueriesData(filters): [readonly unknown[], TQueryFnData | undefined][]; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:96 +Defined in: [packages/query-core/src/queryClient.ts:240](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L240) Imperative (non-reactive) way to retrieve the cached data of multiple queries at once. Only queries matching the given filters are returned; if none match, an empty array is @@ -513,7 +513,7 @@ const data = queryClient.getQueriesData({ queryKey: ['posts'] }) getQueryCache(): QueryCache; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:310 +Defined in: [packages/query-core/src/queryClient.ts:786](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L786) Returns the query cache this client is connected to. @@ -539,7 +539,7 @@ const queries = queryCache.findAll({ queryKey: ['posts'] }) getQueryData(queryKey): TInferredQueryFnData | undefined; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:74 +Defined in: [packages/query-core/src/queryClient.ts:183](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L183) Imperative (non-reactive) way to retrieve data for a QueryKey. Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. @@ -583,7 +583,7 @@ Use `useQuery` to create a `QueryObserver` that subscribes to changes. getQueryDefaults(queryKey): OmitKeyof, "queryKey">; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:381 +Defined in: [packages/query-core/src/queryClient.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L888) Returns the default options registered for queries whose query key partially matches the given `queryKey`, via [QueryClient#setQueryDefaults](#setquerydefaults). If multiple registered defaults @@ -615,7 +615,7 @@ getQueryState(options): Promise[] ? InfiniteData : TData>; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:272 +Defined in: [packages/query-core/src/queryClient.ts:666](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L666) Asynchronous method to fetch and cache an infinite query, resolving with an [InfiniteData](../interfaces/InfiniteData.md) object or throwing with the error. @@ -731,7 +731,7 @@ try { invalidateQueries(filters?, options?): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:194 +Defined in: [packages/query-core/src/queryClient.ts:460](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L460) Marks queries matching the given filters as invalidated. Unlike [QueryClient#removeQueries](#removequeries), invalidated queries stay in the cache. @@ -754,7 +754,7 @@ Unless `filters.refetchType` is `'none'`, matching queries are then refetched vi ##### options? -[`InvalidateOptions`](../interfaces/InvalidateOptions.md) +[`InvalidateOptions`](../interfaces/InvalidateOptions.md) = `{}` #### Returns @@ -774,7 +774,7 @@ await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' isFetching(filters?): number; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:52 +Defined in: [packages/query-core/src/queryClient.ts:150](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L150) Returns the number of queries in the cache that are currently fetching, optionally matching a set of filters. This includes background-fetching, loading new pages, and @@ -812,7 +812,7 @@ if (queryClient.isFetching()) { isMutating(filters?): number; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:64 +Defined in: [packages/query-core/src/queryClient.ts:168](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L168) Returns the number of mutations in the cache that are currently pending, optionally matching a set of filters. @@ -849,7 +849,7 @@ if (queryClient.isMutating()) { mount(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:33 +Defined in: [packages/query-core/src/queryClient.ts:104](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L104) Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start listening for focus/online events and resume paused mutations. Ref-counted via an internal @@ -868,7 +868,7 @@ the shared listeners until the last one unmounts. prefetchInfiniteQuery(options): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:280 +Defined in: [packages/query-core/src/queryClient.ts:714](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L714) #### Type Parameters @@ -914,7 +914,7 @@ Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.ca prefetchQuery(options): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:250 +Defined in: [packages/query-core/src/queryClient.ts:634](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L634) #### Type Parameters @@ -956,7 +956,7 @@ Use queryClient.query(options) instead. You can swallow errors with `.catch(noop query(options): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:242 +Defined in: [packages/query-core/src/queryClient.ts:554](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L554) Asynchronous method to fetch and cache a query, resolving with the data or throwing with the error. @@ -1033,7 +1033,7 @@ try { refetchQueries(filters?, options?): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:210 +Defined in: [packages/query-core/src/queryClient.ts:497](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L497) Refetches queries matching the given filters, regardless of whether they are stale. Without filters, every query in the cache is refetched. Queries that are disabled, or static (only @@ -1057,7 +1057,7 @@ not reject on individual query failures unless `throwOnError` is set. ##### options? -[`RefetchOptions`](../interfaces/RefetchOptions.md) +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` #### Returns @@ -1078,7 +1078,7 @@ await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' }) removeQueries(filters?): void; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:155 +Defined in: [packages/query-core/src/queryClient.ts:376](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L376) Removes queries from the cache that match the given filters. Unlike [QueryClient#invalidateQueries](#invalidatequeries) or [QueryClient#refetchQueries](#refetchqueries), this removes @@ -1115,7 +1115,7 @@ queryClient.removeQueries({ queryKey: ['posts'], exact: true }) resetQueries(filters?, options?): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:166 +Defined in: [packages/query-core/src/queryClient.ts:397](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L397) Resets queries matching the given filters back to their initial state (e.g. any `initialData`), notifying subscribers rather than removing them. Active queries among the @@ -1155,7 +1155,7 @@ await queryClient.resetQueries({ queryKey: ['posts'], exact: true }) resumePausedMutations(): Promise; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:297 +Defined in: [packages/query-core/src/queryClient.ts:767](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L767) Resumes mutations that were paused because there was no network connection. Does nothing (resolving immediately) if the client is currently offline. @@ -1181,7 +1181,7 @@ await queryClient.resumePausedMutations() setDefaultOptions(options): void; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:354 +Defined in: [packages/query-core/src/queryClient.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L839) Dynamically sets the default options for this client, overwriting any previously defined default options. @@ -1221,7 +1221,7 @@ queryClient.setDefaultOptions({ setMutationDefaults(mutationKey, options): void; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:393 +Defined in: [packages/query-core/src/queryClient.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L917) Sets default options for mutations whose mutation key partially matches the given `mutationKey`. As with [QueryClient#setQueryDefaults](#setquerydefaults), the order of registration @@ -1280,7 +1280,7 @@ setQueriesData( options?): [readonly unknown[], TQueryFnData | undefined][]; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:132 +Defined in: [packages/query-core/src/queryClient.ts:319](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L319) Synchronous way to immediately update the cached data of multiple queries at once, using filters or partial query key matching. Only queries that already exist and match the given @@ -1334,7 +1334,7 @@ setQueryData( options?): NoInfer | undefined; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:118 +Defined in: [packages/query-core/src/queryClient.ts:271](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L271) Synchronous way to immediately update a query's cached data. If the updater (or the value passed) resolves to `undefined`, the cache is left untouched and no query is created; @@ -1398,7 +1398,7 @@ queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost]) setQueryDefaults(queryKey, options): void; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:370 +Defined in: [packages/query-core/src/queryClient.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L858) Sets default options for queries whose query key partially matches the given `queryKey`. @@ -1455,7 +1455,7 @@ await queryClient.query({ queryKey: ['posts'] }) unmount(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryClient.d.ts:39 +Defined in: [packages/query-core/src/queryClient.ts:127](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L127) The inverse of [QueryClient#mount](#mount) — called by a framework adapter's `QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online diff --git a/docs/framework/angular/reference/classes/QueryObserver.md b/docs/framework/angular/reference/classes/QueryObserver.md index 470cf95ced7..51ff16910df 100644 --- a/docs/framework/angular/reference/classes/QueryObserver.md +++ b/docs/framework/angular/reference/classes/QueryObserver.md @@ -3,7 +3,7 @@ id: QueryObserver title: QueryObserver --- -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:29 +Defined in: [packages/query-core/src/queryObserver.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L57) A `QueryObserver` watches a single query in the `QueryCache` and computes a `QueryObserverResult` from its state, recomputing and notifying subscribers @@ -63,7 +63,7 @@ const unsubscribe = observer.subscribe((result) => { new QueryObserver(client, options): QueryObserver; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:32 +Defined in: [packages/query-core/src/queryObserver.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L87) #### Parameters @@ -93,7 +93,7 @@ Subscribable>.constructor protected listeners: Set>; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) #### Inherited from @@ -109,7 +109,7 @@ Subscribable.listeners options: QueryObserverOptions; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:31 +Defined in: [packages/query-core/src/queryObserver.ts:89](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L89) ## Methods @@ -119,7 +119,7 @@ Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:31 protected bindMethods(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:33 +Defined in: [packages/query-core/src/queryObserver.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L106) #### Returns @@ -133,7 +133,7 @@ Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:33 protected createResult(query, options): QueryObserverResult; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:136 +Defined in: [packages/query-core/src/queryObserver.ts:559](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L559) #### Parameters @@ -157,7 +157,7 @@ Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:136 destroy(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:53 +Defined in: [packages/query-core/src/queryObserver.ts:161](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L161) Stops observing the current query: clears all listeners, cancels the stale and refetch-interval timers, and removes this observer from the @@ -175,7 +175,7 @@ query it was observing. protected fetch(fetchOptions): Promise>; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:135 +Defined in: [packages/query-core/src/queryObserver.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L448) #### Parameters @@ -195,7 +195,7 @@ Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:135 fetchOptimistic(options): Promise>; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:134 +Defined in: [packages/query-core/src/queryObserver.ts:395](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L395) Fetches a query defined by the given options without affecting this observer's own tracked query or result, and returns a promise that @@ -231,7 +231,7 @@ console.log(result.data) getCurrentQuery(): Query; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:106 +Defined in: [packages/query-core/src/queryObserver.ts:357](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L357) Returns the `Query` instance this observer is currently observing. @@ -247,7 +247,7 @@ Returns the `Query` instance this observer is currently observing. getCurrentResult(): QueryObserverResult; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:88 +Defined in: [packages/query-core/src/queryObserver.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L321) Returns the most recently computed `QueryObserverResult` for the observed query. This is a point-in-time read; to be notified of updates @@ -273,7 +273,7 @@ console.log(result.status, result.data) getOptimisticResult(options): QueryObserverResult; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:75 +Defined in: [packages/query-core/src/queryObserver.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L272) Computes the result the observer would produce for the given (already-defaulted) options right now, building the underlying `Query` if it doesn't exist yet, without waiting for a @@ -298,7 +298,7 @@ returned value is available synchronously, ahead of `setOptions` triggering an a hasListeners(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) #### Returns @@ -318,7 +318,7 @@ Subscribable.hasListeners protected onSubscribe(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:34 +Defined in: [packages/query-core/src/queryObserver.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L110) #### Returns @@ -338,7 +338,7 @@ Subscribable.onSubscribe protected onUnsubscribe(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:35 +Defined in: [packages/query-core/src/queryObserver.ts:124](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L124) #### Returns @@ -355,19 +355,19 @@ Subscribable.onUnsubscribe ### refetch() ```ts -refetch(__namedParameters?): Promise>; +refetch(__namedParameters): Promise>; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:117 +Defined in: [packages/query-core/src/queryObserver.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L371) Refetches the observed query and returns a promise that resolves with the resulting `QueryObserverResult`. #### Parameters -##### \_\_namedParameters? +##### \_\_namedParameters -[`RefetchOptions`](../interfaces/RefetchOptions.md) +[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}` #### Returns @@ -388,7 +388,7 @@ console.log(result.data) setOptions(options): void; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:68 +Defined in: [packages/query-core/src/queryObserver.ts:182](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L182) Updates the observer's options. This will re-resolve the query being observed (switching to a different query if the `queryKey` changed), @@ -422,7 +422,7 @@ observer.setOptions({ queryKey: ['posts', 2], queryFn: () => fetchPost(2) }) shouldFetchOnReconnect(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:41 +Defined in: [packages/query-core/src/queryObserver.ts:135](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L135) Returns whether the observed query is currently stale and configured (via the `refetchOnReconnect` option) to refetch when the network @@ -440,7 +440,7 @@ reconnects. shouldFetchOnWindowFocus(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:47 +Defined in: [packages/query-core/src/queryObserver.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L148) Returns whether the observed query is currently stale and configured (via the `refetchOnWindowFocus` option) to refetch when the window @@ -458,7 +458,7 @@ regains focus. subscribe(listener): () => void; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:4 +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) #### Parameters @@ -490,7 +490,7 @@ Subscribable.subscribe trackProp(key): void; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:102 +Defined in: [packages/query-core/src/queryObserver.ts:350](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L350) Records that the given `QueryObserverResult` property was read, so a subsequent update only notifies this observer if a tracked property actually changed. Normally called indirectly via @@ -501,7 +501,7 @@ access themselves (e.g. through their own reactivity system) instead of via the ##### key -`"status"` | `"error"` | `"isSuccess"` | `"isError"` | `"isPending"` | `"data"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isPlaceholderData"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` +`"error"` | `"data"` | `"isError"` | `"isPending"` | `"isLoading"` | `"isLoadingError"` | `"isRefetchError"` | `"isSuccess"` | `"isPlaceholderData"` | `"status"` | `"dataUpdatedAt"` | `"errorUpdatedAt"` | `"failureCount"` | `"failureReason"` | `"errorUpdateCount"` | `"isFetched"` | `"isFetchedAfterMount"` | `"isFetching"` | `"isInitialLoading"` | `"isPaused"` | `"isRefetching"` | `"isStale"` | `"isEnabled"` | `"refetch"` | `"fetchStatus"` #### Returns @@ -515,7 +515,7 @@ access themselves (e.g. through their own reactivity system) instead of via the trackResult(result, onPropTracked?): QueryObserverResult; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:95 +Defined in: [packages/query-core/src/queryObserver.ts:331](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L331) Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via [QueryObserver#trackProp](#trackprop) (and an optional `onPropTracked` callback). Used by framework @@ -544,7 +544,7 @@ properties you actually read" behavior. updateResult(): void; ``` -Defined in: packages/query-core/dist-ts/src/queryObserver.d.ts:142 +Defined in: [packages/query-core/src/queryObserver.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L735) Recomputes and stores the current result from the current query/options, notifying listeners if it changed. Framework adapters call this right after subscribing to make sure no query diff --git a/docs/framework/angular/reference/functions/defaultShouldDehydrateMutation.md b/docs/framework/angular/reference/functions/defaultShouldDehydrateMutation.md index 2c6c020a881..940f8745a5d 100644 --- a/docs/framework/angular/reference/functions/defaultShouldDehydrateMutation.md +++ b/docs/framework/angular/reference/functions/defaultShouldDehydrateMutation.md @@ -7,7 +7,7 @@ title: defaultShouldDehydrateMutation function defaultShouldDehydrateMutation(mutation): boolean; ``` -Defined in: packages/query-core/dist-ts/src/hydration.d.ts:77 +Defined in: [packages/query-core/src/hydration.ts:177](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L177) The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are currently paused (e.g. paused by `networkMode` while offline). diff --git a/docs/framework/angular/reference/functions/defaultShouldDehydrateQuery.md b/docs/framework/angular/reference/functions/defaultShouldDehydrateQuery.md index 5619987053f..abf19439d8a 100644 --- a/docs/framework/angular/reference/functions/defaultShouldDehydrateQuery.md +++ b/docs/framework/angular/reference/functions/defaultShouldDehydrateQuery.md @@ -7,7 +7,7 @@ title: defaultShouldDehydrateQuery function defaultShouldDehydrateQuery(query): boolean; ``` -Defined in: packages/query-core/dist-ts/src/hydration.d.ts:82 +Defined in: [packages/query-core/src/hydration.ts:185](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L185) The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is `'success'`. diff --git a/docs/framework/angular/reference/functions/dehydrate.md b/docs/framework/angular/reference/functions/dehydrate.md index 254a61d6c5e..33cdcd3940d 100644 --- a/docs/framework/angular/reference/functions/dehydrate.md +++ b/docs/framework/angular/reference/functions/dehydrate.md @@ -4,10 +4,10 @@ title: dehydrate --- ```ts -function dehydrate(client, options?): DehydratedState; +function dehydrate(client, options): DehydratedState; ``` -Defined in: packages/query-core/dist-ts/src/hydration.d.ts:101 +Defined in: [packages/query-core/src/hydration.ts:207](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L207) Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`, typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`. @@ -21,9 +21,9 @@ falling back to the client's `dehydrate` default options, and finally to `defaul [`QueryClient`](../classes/QueryClient.md) -### options? +### options -[`DehydrateOptions`](../interfaces/DehydrateOptions.md) +[`DehydrateOptions`](../interfaces/DehydrateOptions.md) = `{}` ## Returns diff --git a/docs/framework/angular/reference/functions/dehydrateQuery.md b/docs/framework/angular/reference/functions/dehydrateQuery.md index 07810f1cbe0..2314f52fd91 100644 --- a/docs/framework/angular/reference/functions/dehydrateQuery.md +++ b/docs/framework/angular/reference/functions/dehydrateQuery.md @@ -10,7 +10,7 @@ function dehydrateQuery( shouldRedactErrors?): DehydratedQuery; ``` -Defined in: packages/query-core/dist-ts/src/hydration.d.ts:72 +Defined in: [packages/query-core/src/hydration.ts:148](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L148) Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g. `queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the diff --git a/docs/framework/angular/reference/functions/experimental_streamedQuery.md b/docs/framework/angular/reference/functions/experimental_streamedQuery.md index bd9ffcf366e..4c490322d60 100644 --- a/docs/framework/angular/reference/functions/experimental_streamedQuery.md +++ b/docs/framework/angular/reference/functions/experimental_streamedQuery.md @@ -7,7 +7,7 @@ title: experimental_streamedQuery function experimental_streamedQuery(streamFn): QueryFunction; ``` -Defined in: packages/query-core/dist-ts/src/streamedQuery.d.ts:53 +Defined in: [packages/query-core/src/streamedQuery.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L75) This is a helper function to create a query function that streams data from an AsyncIterable. Data will be an Array of all the chunks received. diff --git a/docs/framework/angular/reference/functions/hashKey.md b/docs/framework/angular/reference/functions/hashKey.md index fd9aaa2a57f..dc774c032ce 100644 --- a/docs/framework/angular/reference/functions/hashKey.md +++ b/docs/framework/angular/reference/functions/hashKey.md @@ -7,7 +7,7 @@ title: hashKey function hashKey(queryKey): string; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:131 +Defined in: [packages/query-core/src/utils.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L284) Default query & mutation keys hash function. Hashes the value into a stable hash. diff --git a/docs/framework/angular/reference/functions/hydrate.md b/docs/framework/angular/reference/functions/hydrate.md index 44a4d6ef3e7..c0093b57457 100644 --- a/docs/framework/angular/reference/functions/hydrate.md +++ b/docs/framework/angular/reference/functions/hydrate.md @@ -10,7 +10,7 @@ function hydrate( options?): void; ``` -Defined in: packages/query-core/dist-ts/src/hydration.d.ts:119 +Defined in: [packages/query-core/src/hydration.ts:264](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L264) Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`. diff --git a/docs/framework/angular/reference/functions/isCancelledError.md b/docs/framework/angular/reference/functions/isCancelledError.md index c2aea390ea1..c8f57c4b94d 100644 --- a/docs/framework/angular/reference/functions/isCancelledError.md +++ b/docs/framework/angular/reference/functions/isCancelledError.md @@ -7,7 +7,7 @@ title: isCancelledError function isCancelledError(value): value is CancelledError; ``` -Defined in: packages/query-core/dist-ts/src/retryer.d.ts:55 +Defined in: [packages/query-core/src/retryer.ts:90](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L90) ## Parameters diff --git a/docs/framework/angular/reference/functions/keepPreviousData.md b/docs/framework/angular/reference/functions/keepPreviousData.md index 9552f3b25b8..6a84f4c5970 100644 --- a/docs/framework/angular/reference/functions/keepPreviousData.md +++ b/docs/framework/angular/reference/functions/keepPreviousData.md @@ -7,7 +7,7 @@ title: keepPreviousData function keepPreviousData(previousData): T | undefined; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:164 +Defined in: [packages/query-core/src/utils.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L493) Intended to be passed as a query's `placeholderData` option, for example `placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new diff --git a/docs/framework/angular/reference/functions/matchMutation.md b/docs/framework/angular/reference/functions/matchMutation.md index aaac0d976b0..40210da4cf1 100644 --- a/docs/framework/angular/reference/functions/matchMutation.md +++ b/docs/framework/angular/reference/functions/matchMutation.md @@ -7,7 +7,7 @@ title: matchMutation function matchMutation(filters, mutation): boolean; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:119 +Defined in: [packages/query-core/src/utils.ts:237](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L237) Checks whether a mutation matches the given [MutationFilters](../interfaces/MutationFilters.md). Every filter that is specified must match; filters that are left unspecified are ignored. diff --git a/docs/framework/angular/reference/functions/matchQuery.md b/docs/framework/angular/reference/functions/matchQuery.md index 012ac43329d..4c54b2df995 100644 --- a/docs/framework/angular/reference/functions/matchQuery.md +++ b/docs/framework/angular/reference/functions/matchQuery.md @@ -7,7 +7,7 @@ title: matchQuery function matchQuery(filters, query): boolean; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:104 +Defined in: [packages/query-core/src/utils.ts:175](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L175) Checks whether a query matches the given [QueryFilters](../interfaces/QueryFilters.md). Every filter that is specified must match; filters that are left unspecified are ignored. diff --git a/docs/framework/angular/reference/functions/noop.md b/docs/framework/angular/reference/functions/noop.md index 7b8187ac6b7..01fb409f4e9 100644 --- a/docs/framework/angular/reference/functions/noop.md +++ b/docs/framework/angular/reference/functions/noop.md @@ -9,7 +9,7 @@ title: noop function noop(): void; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:85 +Defined in: [packages/query-core/src/utils.ts:119](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L119) A function that does nothing. @@ -23,7 +23,7 @@ A function that does nothing. function noop(): undefined; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:86 +Defined in: [packages/query-core/src/utils.ts:120](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L120) A function that does nothing. diff --git a/docs/framework/angular/reference/functions/partialMatchKey.md b/docs/framework/angular/reference/functions/partialMatchKey.md index 0713f30cee2..4db67323e9b 100644 --- a/docs/framework/angular/reference/functions/partialMatchKey.md +++ b/docs/framework/angular/reference/functions/partialMatchKey.md @@ -7,7 +7,7 @@ title: partialMatchKey function partialMatchKey(a, b): boolean; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:135 +Defined in: [packages/query-core/src/utils.ts:300](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L300) Checks if key `b` partially matches with key `a`. diff --git a/docs/framework/angular/reference/functions/replaceEqualDeep.md b/docs/framework/angular/reference/functions/replaceEqualDeep.md index 58d5b074f89..6a81c3907fb 100644 --- a/docs/framework/angular/reference/functions/replaceEqualDeep.md +++ b/docs/framework/angular/reference/functions/replaceEqualDeep.md @@ -10,7 +10,7 @@ function replaceEqualDeep( depth?): T; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:141 +Defined in: [packages/query-core/src/utils.ts:339](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L339) This function returns `a` if `b` is deeply equal. If not, it will replace any deeply equal children of `b` with those of `a`. diff --git a/docs/framework/angular/reference/functions/shouldThrowError.md b/docs/framework/angular/reference/functions/shouldThrowError.md index 4d0d27b37d9..1f1e62a8d0e 100644 --- a/docs/framework/angular/reference/functions/shouldThrowError.md +++ b/docs/framework/angular/reference/functions/shouldThrowError.md @@ -7,7 +7,7 @@ title: shouldThrowError function shouldThrowError(throwOnError, params): boolean; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:204 +Defined in: [packages/query-core/src/utils.ts:576](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L576) Resolves a `throwOnError` option to a boolean. If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller, diff --git a/docs/framework/angular/reference/interfaces/CancelOptions.md b/docs/framework/angular/reference/interfaces/CancelOptions.md index 6d8f8ff1ab9..f52c729f3b1 100644 --- a/docs/framework/angular/reference/interfaces/CancelOptions.md +++ b/docs/framework/angular/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:878 +Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1501) ## Properties @@ -13,7 +13,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:878 optional revert: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:879 +Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) *** @@ -23,4 +23,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:879 optional silent: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:880 +Defined in: [packages/query-core/src/types.ts:1503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1503) diff --git a/docs/framework/angular/reference/interfaces/CreateBaseQueryOptions.md b/docs/framework/angular/reference/interfaces/CreateBaseQueryOptions.md index 919577cc6f8..80f89af69d7 100644 --- a/docs/framework/angular/reference/interfaces/CreateBaseQueryOptions.md +++ b/docs/framework/angular/reference/interfaces/CreateBaseQueryOptions.md @@ -55,11 +55,12 @@ The type of your `queryKey`. optional enabled: QueryBooleanOption; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:210 +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -74,7 +75,7 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:120 +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -99,7 +100,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:160 +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -120,7 +121,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:164 +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -136,7 +137,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:185 +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -152,7 +153,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:181 +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -169,7 +170,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:109 +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -189,7 +190,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:267 +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -209,7 +210,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:133 +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -272,7 +273,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:292 +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -290,7 +291,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:128 +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -310,7 +311,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:138 +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -327,7 +328,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:147 +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -348,7 +349,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:151 +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -364,10 +365,11 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:224 +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -382,7 +384,7 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:229 +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -399,12 +401,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:253 +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -419,12 +422,13 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:245 +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -439,12 +443,13 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:237 +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -459,12 +464,13 @@ Defaults to `true`. optional retry: RetryValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:94 +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -479,7 +485,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:104 +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -501,10 +507,11 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:259 +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -519,7 +526,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:282 +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -548,12 +555,13 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:218 +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -568,10 +576,11 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:172 +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -586,10 +595,11 @@ Defaults to `true`. optional suspense: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:288 +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. #### Inherited from @@ -604,12 +614,13 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:275 +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/CreateInfiniteQueryOptions.md b/docs/framework/angular/reference/interfaces/CreateInfiniteQueryOptions.md index 48d73849f28..496ce36b7e6 100644 --- a/docs/framework/angular/reference/interfaces/CreateInfiniteQueryOptions.md +++ b/docs/framework/angular/reference/interfaces/CreateInfiniteQueryOptions.md @@ -56,11 +56,12 @@ The type of the parameter passed to `queryFn` to fetch a given page. optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:210 +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -77,7 +78,7 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:120 +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -100,7 +101,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:200 +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -119,7 +120,7 @@ OmitKeyof.getNextPageParam optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:195 +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -140,7 +141,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:160 +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -163,7 +164,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:164 +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -181,7 +182,7 @@ OmitKeyof.initialDataUpdatedAt initialPageParam: TPageParam; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:188 +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from @@ -197,7 +198,7 @@ OmitKeyof.initialPageParam optional maxPages: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:185 +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -213,7 +214,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:181 +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -230,7 +231,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:109 +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -250,7 +251,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:267 +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -270,7 +271,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:133 +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -291,7 +292,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:292 +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -311,7 +312,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:128 +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -333,7 +334,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:138 +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -350,7 +351,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:147 +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -373,7 +374,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:151 +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -391,10 +392,11 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:224 +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -411,7 +413,7 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:229 +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -428,12 +430,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:253 +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -450,12 +453,13 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:245 +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -472,12 +476,13 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:237 +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -494,12 +499,13 @@ OmitKeyof.refetchOnWindowFocus optional retry: RetryValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:94 +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -516,7 +522,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:104 +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -540,10 +546,11 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:259 +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -560,7 +567,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:282 +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -591,12 +598,13 @@ OmitKeyof.select optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:218 +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -613,10 +621,11 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:172 +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -633,12 +642,13 @@ OmitKeyof.structuralSharing optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:275 +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/CreateMutationOptions.md b/docs/framework/angular/reference/interfaces/CreateMutationOptions.md index bfd8792f535..76ed90b426a 100644 --- a/docs/framework/angular/reference/interfaces/CreateMutationOptions.md +++ b/docs/framework/angular/reference/interfaces/CreateMutationOptions.md @@ -47,7 +47,12 @@ their `onMutateResult` parameter — useful for optimistic-update rollback data. optional gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:735 +Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) + +The time in milliseconds that an unused/inactive mutation remains in memory before it is +garbage collected. + +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. #### Inherited from @@ -61,7 +66,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:735 optional meta: Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:738 +Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) #### Inherited from @@ -75,7 +80,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:738 optional mutationFn: MutationFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:726 +Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) #### Inherited from @@ -91,7 +96,7 @@ OmitKeyof.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:727 +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Inherited from @@ -105,7 +110,13 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:727 optional networkMode: NetworkMode; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:734 +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. #### Inherited from @@ -119,7 +130,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:734 optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:730 +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -157,7 +168,7 @@ OmitKeyof.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:728 +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) #### Parameters @@ -187,7 +198,7 @@ OmitKeyof.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:731 +Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) #### Parameters @@ -229,7 +240,7 @@ OmitKeyof.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:729 +Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) #### Parameters @@ -267,7 +278,14 @@ OmitKeyof.onSuccess optional retry: RetryValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:732 +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) + +If `false`, failed mutations will not retry by default. +If `true`, failed mutations will retry infinitely. +If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. +If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + +Defaults to `0`. #### Inherited from @@ -283,7 +301,12 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:733 +Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +Defaults to a function that applies exponential backoff, capped at 30 seconds. #### Inherited from @@ -299,7 +322,7 @@ OmitKeyof.retryDelay optional scope: MutationScope; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:739 +Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) #### Inherited from @@ -313,7 +336,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:739 optional throwOnError: boolean | (error) => boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:742 +Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/CreateQueryOptions.md b/docs/framework/angular/reference/interfaces/CreateQueryOptions.md index 0ba1e95f964..4c690e9a0ea 100644 --- a/docs/framework/angular/reference/interfaces/CreateQueryOptions.md +++ b/docs/framework/angular/reference/interfaces/CreateQueryOptions.md @@ -47,11 +47,12 @@ The type of your `queryKey`. optional enabled: QueryBooleanOption; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:210 +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -68,7 +69,7 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:120 +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -93,7 +94,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:160 +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -116,7 +117,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:164 +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -134,7 +135,7 @@ OmitKeyof.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:185 +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -150,7 +151,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:181 +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -167,7 +168,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:109 +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -187,7 +188,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:267 +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -207,7 +208,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:133 +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -272,7 +273,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:292 +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -292,7 +293,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:128 +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -314,7 +315,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:138 +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -331,7 +332,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:147 +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -354,7 +355,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:151 +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -372,10 +373,11 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:224 +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -392,7 +394,7 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:229 +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -409,12 +411,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:253 +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -431,12 +434,13 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:245 +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -453,12 +457,13 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:237 +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -475,12 +480,13 @@ OmitKeyof.refetchOnWindowFocus optional retry: RetryValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:94 +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -497,7 +503,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:104 +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -521,10 +527,11 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:259 +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -541,7 +548,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:282 +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -572,12 +579,13 @@ OmitKeyof.select optional staleTime: StaleTimeFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:218 +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -594,10 +602,11 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:172 +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -614,12 +623,13 @@ OmitKeyof.structuralSharing optional throwOnError: ThrowOnError; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:275 +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/DefaultOptions.md b/docs/framework/angular/reference/interfaces/DefaultOptions.md index 6a73a9c907a..67ae012f9ee 100644 --- a/docs/framework/angular/reference/interfaces/DefaultOptions.md +++ b/docs/framework/angular/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:868 +Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1487) ## Type Parameters @@ -19,7 +19,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:868 optional dehydrate: DehydrateOptions; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:876 +Defined in: [packages/query-core/src/types.ts:1498](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1498) Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). @@ -31,7 +31,7 @@ Default options used when dehydrating the client's caches; see [DehydrateOptions optional hydrate: object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:874 +Defined in: [packages/query-core/src/types.ts:1496](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1496) Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). @@ -67,7 +67,7 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:872 +Defined in: [packages/query-core/src/types.ts:1494](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1494) Default options applied to every mutation, unless overridden per-mutation. @@ -79,6 +79,6 @@ Default options applied to every mutation, unless overridden per-mutation. optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:870 +Defined in: [packages/query-core/src/types.ts:1489](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1489) Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/angular/reference/interfaces/DehydrateOptions.md b/docs/framework/angular/reference/interfaces/DehydrateOptions.md index c822f2a2d8d..e862ae88b43 100644 --- a/docs/framework/angular/reference/interfaces/DehydrateOptions.md +++ b/docs/framework/angular/reference/interfaces/DehydrateOptions.md @@ -3,7 +3,7 @@ id: DehydrateOptions title: DehydrateOptions --- -Defined in: packages/query-core/dist-ts/src/hydration.d.ts:10 +Defined in: [packages/query-core/src/hydration.ts:42](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L42) Options for `dehydrate`, controlling which queries/mutations are included in the resulting `DehydratedState` and how their data/errors are transformed before being serialized (e.g. for embedding in server-rendered markup). @@ -16,7 +16,7 @@ how their data/errors are transformed before being serialized (e.g. for embeddin optional serializeData: TransformerFn; ``` -Defined in: packages/query-core/dist-ts/src/hydration.d.ts:12 +Defined in: [packages/query-core/src/hydration.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L44) Transforms a query's `data` before it is dehydrated. Useful for non-JSON-serializable data. @@ -28,7 +28,7 @@ Transforms a query's `data` before it is dehydrated. Useful for non-JSON-seriali optional shouldDehydrateMutation: (mutation) => boolean; ``` -Defined in: packages/query-core/dist-ts/src/hydration.d.ts:14 +Defined in: [packages/query-core/src/hydration.ts:46](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L46) Predicate to decide whether a given `Mutation` should be dehydrated. Defaults to `defaultShouldDehydrateMutation`. @@ -50,7 +50,7 @@ Predicate to decide whether a given `Mutation` should be dehydrated. Defaults to optional shouldDehydrateQuery: (query) => boolean; ``` -Defined in: packages/query-core/dist-ts/src/hydration.d.ts:16 +Defined in: [packages/query-core/src/hydration.ts:48](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L48) Predicate to decide whether a given `Query` should be dehydrated. Defaults to `defaultShouldDehydrateQuery`. @@ -72,7 +72,7 @@ Predicate to decide whether a given `Query` should be dehydrated. Defaults to `d optional shouldRedactErrors: (error) => boolean; ``` -Defined in: packages/query-core/dist-ts/src/hydration.d.ts:22 +Defined in: [packages/query-core/src/hydration.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L54) Predicate to decide whether a query's error should be redacted before dehydration. Errors are redacted (replaced with a generic `Error('redacted')`) unless this function is provided and returns `false` for the diff --git a/docs/framework/angular/reference/interfaces/DehydratedState.md b/docs/framework/angular/reference/interfaces/DehydratedState.md index 13481944cad..be034c9e8fd 100644 --- a/docs/framework/angular/reference/interfaces/DehydratedState.md +++ b/docs/framework/angular/reference/interfaces/DehydratedState.md @@ -3,7 +3,7 @@ id: DehydratedState title: DehydratedState --- -Defined in: packages/query-core/dist-ts/src/hydration.d.ts:58 +Defined in: [packages/query-core/src/hydration.ts:94](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L94) A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data @@ -17,7 +17,7 @@ that has already been fetched, avoiding a redundant fetch on the client. mutations: DehydratedMutation[]; ``` -Defined in: packages/query-core/dist-ts/src/hydration.d.ts:59 +Defined in: [packages/query-core/src/hydration.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L95) *** @@ -27,4 +27,4 @@ Defined in: packages/query-core/dist-ts/src/hydration.d.ts:59 queries: DehydratedQuery[]; ``` -Defined in: packages/query-core/dist-ts/src/hydration.d.ts:60 +Defined in: [packages/query-core/src/hydration.ts:96](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L96) diff --git a/docs/framework/angular/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/angular/reference/interfaces/EnsureQueryDataOptions.md index 454919d1933..d71a60902e6 100644 --- a/docs/framework/angular/reference/interfaces/EnsureQueryDataOptions.md +++ b/docs/framework/angular/reference/interfaces/EnsureQueryDataOptions.md @@ -3,7 +3,7 @@ id: EnsureQueryDataOptions title: EnsureQueryDataOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:322 +Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L606) ## Deprecated @@ -41,7 +41,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:322 optional gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:120 +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -66,7 +66,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:160 +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -87,7 +87,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:164 +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -103,7 +103,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional initialPageParam: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:314 +Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) #### Inherited from @@ -117,7 +117,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:314 optional maxPages: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:185 +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -133,7 +133,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:181 +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -150,7 +150,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:109 +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -170,7 +170,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:133 +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -189,7 +189,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:128 +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -209,7 +209,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:138 +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -226,7 +226,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:147 +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -247,7 +247,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:151 +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -263,12 +263,13 @@ If specified, this function is used to hash the `queryKey` to a string. optional retry: RetryValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:94 +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -283,7 +284,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:104 +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -305,7 +306,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional revalidateIfStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:323 +Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L619) *** @@ -315,7 +316,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:323 optional staleTime: StaleTimeFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:319 +Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -332,10 +333,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:172 +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/FetchNextPageOptions.md b/docs/framework/angular/reference/interfaces/FetchNextPageOptions.md index 16c2a10f990..2c0be977140 100644 --- a/docs/framework/angular/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/angular/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:373 +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) ## Extends @@ -17,7 +17,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:373 optional cancelRefetch: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:382 +Defined in: [packages/query-core/src/types.ts:736](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L736) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:344 +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/angular/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/angular/reference/interfaces/FetchPreviousPageOptions.md index 1db86bcf72b..683e789ee52 100644 --- a/docs/framework/angular/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/angular/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:384 +Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L739) ## Extends @@ -17,7 +17,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:384 optional cancelRefetch: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:393 +Defined in: [packages/query-core/src/types.ts:748](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L748) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,7 +34,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:344 +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/angular/reference/interfaces/FetchQueryOptions.md b/docs/framework/angular/reference/interfaces/FetchQueryOptions.md index 9cf06e5ddae..634ae0e09f9 100644 --- a/docs/framework/angular/reference/interfaces/FetchQueryOptions.md +++ b/docs/framework/angular/reference/interfaces/FetchQueryOptions.md @@ -3,7 +3,7 @@ id: FetchQueryOptions title: FetchQueryOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:313 +Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L587) ## Deprecated @@ -45,7 +45,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:313 optional gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:120 +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -72,7 +72,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:160 +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -95,7 +95,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:164 +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -113,7 +113,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:314 +Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) *** @@ -123,7 +123,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:314 optional maxPages: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:185 +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -141,7 +141,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:181 +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -160,7 +160,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:109 +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -182,7 +182,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:133 +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -203,7 +203,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:128 +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -225,7 +225,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:138 +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -244,7 +244,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:147 +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -267,7 +267,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:151 +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -285,12 +285,13 @@ WithRequired.queryKeyHashFn optional retry: RetryValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:94 +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -307,7 +308,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:104 +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -331,7 +332,7 @@ WithRequired.retryDelay optional staleTime: StaleTimeFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:319 +Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -344,10 +345,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:172 +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/FocusManager.md b/docs/framework/angular/reference/interfaces/FocusManager.md index 8004d77a5a4..1ab81dc6357 100644 --- a/docs/framework/angular/reference/interfaces/FocusManager.md +++ b/docs/framework/angular/reference/interfaces/FocusManager.md @@ -3,7 +3,7 @@ id: FocusManager title: FocusManager --- -Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:9 +Defined in: [packages/query-core/src/focusManager.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L14) The `FocusManager` manages the focus state within TanStack Query. @@ -21,7 +21,7 @@ It can be used to change the default event listeners or to manually change the f protected listeners: Set; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) #### Inherited from @@ -37,7 +37,7 @@ Subscribable.listeners hasListeners(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) #### Returns @@ -57,7 +57,7 @@ Subscribable.hasListeners isFocused(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:66 +Defined in: [packages/query-core/src/focusManager.ts:128](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L128) `isFocused` can be used to get the current focus state. @@ -73,7 +73,7 @@ Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:66 onFocus(): void; ``` -Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:62 +Defined in: [packages/query-core/src/focusManager.ts:118](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L118) `onFocus` notifies all subscribed listeners with the current focus state. @@ -89,7 +89,7 @@ Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:62 protected onSubscribe(): void; ``` -Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:12 +Defined in: [packages/query-core/src/focusManager.ts:39](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L39) #### Returns @@ -109,7 +109,7 @@ Subscribable.onSubscribe protected onUnsubscribe(): void; ``` -Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:13 +Defined in: [packages/query-core/src/focusManager.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L45) #### Returns @@ -129,7 +129,7 @@ Subscribable.onUnsubscribe setEventListener(setup): void; ``` -Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:39 +Defined in: [packages/query-core/src/focusManager.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L77) `setEventListener` can be used to set a custom event listener that will be used to determine the focus state. The provided `setup` function @@ -174,7 +174,7 @@ focusManager.setEventListener((handleFocus) => { setFocused(focused?): void; ``` -Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:58 +Defined in: [packages/query-core/src/focusManager.ts:107](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L107) `setFocused` can be used to manually set the focus state. Set `undefined` to fall back to the default focus check. @@ -212,7 +212,7 @@ focusManager.setFocused(undefined) subscribe(listener): () => void; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:4 +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) #### Parameters diff --git a/docs/framework/angular/reference/interfaces/HydrateOptions.md b/docs/framework/angular/reference/interfaces/HydrateOptions.md index 85bcf407685..fe8b92317e3 100644 --- a/docs/framework/angular/reference/interfaces/HydrateOptions.md +++ b/docs/framework/angular/reference/interfaces/HydrateOptions.md @@ -3,7 +3,7 @@ id: HydrateOptions title: HydrateOptions --- -Defined in: packages/query-core/dist-ts/src/hydration.d.ts:28 +Defined in: [packages/query-core/src/hydration.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L61) Options for `hydrate`, controlling the default options applied to queries/mutations restored from a `DehydratedState`, and how to reverse any transformation applied by `DehydrateOptions.serializeData`. @@ -16,7 +16,7 @@ Options for `hydrate`, controlling the default options applied to queries/mutati optional defaultOptions: object; ``` -Defined in: packages/query-core/dist-ts/src/hydration.d.ts:29 +Defined in: [packages/query-core/src/hydration.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L62) #### deserializeData? diff --git a/docs/framework/angular/reference/interfaces/InfiniteData.md b/docs/framework/angular/reference/interfaces/InfiniteData.md index cb30e058677..4d7ad595c2d 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteData.md +++ b/docs/framework/angular/reference/interfaces/InfiniteData.md @@ -3,7 +3,7 @@ id: InfiniteData title: InfiniteData --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:77 +Defined in: [packages/query-core/src/types.ts:210](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L210) ## Type Parameters @@ -23,7 +23,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:77 pageParams: TPageParam[]; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:79 +Defined in: [packages/query-core/src/types.ts:212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L212) *** @@ -33,4 +33,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:79 pages: TData[]; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:78 +Defined in: [packages/query-core/src/types.ts:211](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L211) diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult.md index 981cb650e9c..9195e0727f8 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:592 +Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L991) ## Extends @@ -36,7 +36,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:592 data: TData | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:401 +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:405 +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:410 +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:429 +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:414 +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:420 +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:596 +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:600 +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:517 +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:604 +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:608 +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:497 +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:497 isError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:434 +Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:438 +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:443 +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:448 +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:616 +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:624 +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:612 +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:620 +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:466 +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:461 +Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:457 +Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:475 +Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:479 +Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:493 +Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:501 +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:509 +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 7418f482838..2841b5ab116 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:653 +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:653 data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:654 +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:405 +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:655 +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:429 +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:414 +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:420 +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:596 +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:600 +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:517 +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:604 +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:608 +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:497 +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:497 isError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:656 +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:438 +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:443 +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:448 +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:616 +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:624 +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:661 +Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:662 +Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:466 +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:658 +Defined in: [packages/query-core/src/types.ts:1076](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1076) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:659 +Defined in: [packages/query-core/src/types.ts:1077](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1077) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:657 +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:664 +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:660 +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:663 +Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:501 +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:665 +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult.md index 12d6c8d296b..95ff84b3ef3 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:639 +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:639 data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:640 +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:405 +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:641 +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:429 +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:414 +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:420 +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:596 +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:600 +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:517 +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:604 +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:608 +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:497 +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:497 isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:642 +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:438 +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:443 +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:448 +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:616 +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:624 +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:647 +Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:648 +Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:466 +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:644 +Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:645 +Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:643 +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:650 +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:646 +Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:649 +Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:501 +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:651 +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverOptions.md index e681041e19f..7d5b0dd1a4d 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverOptions.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverOptions title: InfiniteQueryObserverOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:300 +Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L531) ## Extends @@ -39,11 +39,12 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:300 optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:210 +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. #### Inherited from @@ -58,7 +59,7 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:120 +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -81,7 +82,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:200 +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -98,7 +99,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:195 +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -117,7 +118,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:160 +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -138,7 +139,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:164 +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -154,7 +155,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi initialPageParam: TPageParam; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:188 +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from @@ -168,7 +169,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:188 optional maxPages: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:185 +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -184,7 +185,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:181 +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -201,7 +202,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:109 +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -221,7 +222,7 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:267 +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -241,7 +242,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:133 +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -260,7 +261,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:292 +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -278,7 +279,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:128 +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -298,7 +299,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:138 +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -315,7 +316,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:147 +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -336,7 +337,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:151 +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -352,10 +353,11 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:224 +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. #### Inherited from @@ -370,7 +372,7 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:229 +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -387,12 +389,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:253 +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. #### Inherited from @@ -407,12 +410,13 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:245 +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. #### Inherited from @@ -427,12 +431,13 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:237 +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. #### Inherited from @@ -447,12 +452,13 @@ Defaults to `true`. optional retry: RetryValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:94 +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -467,7 +473,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:104 +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -489,10 +495,11 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:259 +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. #### Inherited from @@ -507,7 +514,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:282 +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -536,12 +543,13 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:218 +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. #### Inherited from @@ -556,10 +564,11 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:172 +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -574,10 +583,11 @@ Defaults to `true`. optional suspense: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:288 +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. #### Inherited from @@ -592,12 +602,13 @@ Defaults to `false`. optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:275 +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult.md index 775730f6200..c3e8b022cdb 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:626 +Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:626 data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:627 +Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:405 +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:628 +Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:429 +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:414 +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:420 +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:596 +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:600 +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:517 +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:604 +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:608 +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:497 +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:497 isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:629 +Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:438 +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:443 +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:448 +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:616 +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:624 +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:633 +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:634 +Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:466 +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:631 +Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:630 +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:636 +Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:632 +Defined in: [packages/query-core/src/types.ts:1042](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1042) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:635 +Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:501 +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:637 +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index c85ec282368..e62579744ba 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:693 +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:693 data: TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:694 +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:405 +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:696 +Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:429 +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:414 +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:420 +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:596 +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:600 +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:517 +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:604 +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:608 +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:497 +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:497 isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:695 +Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:438 +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:443 +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:448 +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:616 +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:624 +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:703 +Defined in: [packages/query-core/src/types.ts:1133](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1133) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:704 +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:466 +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:698 +Defined in: [packages/query-core/src/types.ts:1128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1128) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:699 +Defined in: [packages/query-core/src/types.ts:1129](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1129) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:697 +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:702 +Defined in: [packages/query-core/src/types.ts:1132](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1132) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:700 +Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:701 +Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:501 +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:705 +Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index d914f0d80ab..a67e877f083 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:667 +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:667 data: TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:668 +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:405 +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:669 +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:429 +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:414 +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:420 +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:596 +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:600 +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:517 +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:604 +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:608 +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:497 +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:497 isError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:670 +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:438 +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:443 +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:448 +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:616 +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:624 +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:612 +Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:620 +Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:466 +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:672 +Defined in: [packages/query-core/src/types.ts:1094](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1094) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:673 +Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:671 +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:676 +Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:674 +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:675 +Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:501 +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:677 +Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 44a718888ed..0b875662cbc 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:679 +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:679 data: TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:680 +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:405 +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:681 +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:429 +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:414 +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:420 +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:596 +Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:600 +Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:517 +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:604 +Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:608 +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:497 +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:497 isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:682 +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:438 +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:443 +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:448 +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:616 +Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:624 +Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:687 +Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:688 +Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:466 +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:684 +Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:685 +Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:683 +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:690 +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:686 +Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:689 +Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:501 +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:691 +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/angular/reference/interfaces/InfiniteQueryPageParamsOptions.md index 06590765c43..afe27785edc 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryPageParamsOptions.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryPageParamsOptions title: InfiniteQueryPageParamsOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:190 +Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L347) ## Extends @@ -31,7 +31,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:190 getNextPageParam: GetNextPageParamFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:200 +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -44,7 +44,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:195 +Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -57,7 +57,7 @@ The result will also be used to determine the value of `hasPreviousPage`. initialPageParam: TPageParam; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:188 +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/InitialPageParam.md b/docs/framework/angular/reference/interfaces/InitialPageParam.md index 66e3e97f9f1..2d42bf029a4 100644 --- a/docs/framework/angular/reference/interfaces/InitialPageParam.md +++ b/docs/framework/angular/reference/interfaces/InitialPageParam.md @@ -3,7 +3,7 @@ id: InitialPageParam title: InitialPageParam --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:187 +Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L343) ## Extended by @@ -23,4 +23,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:187 initialPageParam: TPageParam; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:188 +Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) diff --git a/docs/framework/angular/reference/interfaces/InvalidateOptions.md b/docs/framework/angular/reference/interfaces/InvalidateOptions.md index 8eff9d55ad4..d83ecd43ec0 100644 --- a/docs/framework/angular/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/angular/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:369 +Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) ## Extends @@ -17,7 +17,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:369 optional cancelRefetch: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:354 +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:344 +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/angular/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/angular/reference/interfaces/InvalidateQueryFilters.md index 849f946e918..36eb3f27998 100644 --- a/docs/framework/angular/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/angular/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:356 +Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -26,7 +26,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:21 +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -42,7 +42,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:37 +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -58,7 +58,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:25 +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -84,7 +84,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:29 +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -100,7 +100,7 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:365 +Defined in: [packages/query-core/src/types.ts:717](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L717) Controls which of the matched (now-invalidated) queries are refetched in the background. Defaults to `'active'`. @@ -117,7 +117,7 @@ Defaults to `'active'`. optional stale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:33 +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -133,10 +133,12 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:17 +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries +Defaults to `'all'`. + #### Inherited from [`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/angular/reference/interfaces/MutateOptions.md b/docs/framework/angular/reference/interfaces/MutateOptions.md index d9a2080253f..b12b3b29ec2 100644 --- a/docs/framework/angular/reference/interfaces/MutateOptions.md +++ b/docs/framework/angular/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:744 +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:744 optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:746 +Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) #### Parameters @@ -63,7 +63,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:746 optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:747 +Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1282) #### Parameters @@ -99,7 +99,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:747 optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:745 +Defined in: [packages/query-core/src/types.ts:1270](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1270) #### Parameters diff --git a/docs/framework/angular/reference/interfaces/MutationCacheConfig.md b/docs/framework/angular/reference/interfaces/MutationCacheConfig.md index 9834d8b1fd0..c38d2dc26f4 100644 --- a/docs/framework/angular/reference/interfaces/MutationCacheConfig.md +++ b/docs/framework/angular/reference/interfaces/MutationCacheConfig.md @@ -3,7 +3,7 @@ id: MutationCacheConfig title: MutationCacheConfig --- -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:16 +Defined in: [packages/query-core/src/mutationCache.ts:26](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L26) Global callbacks that fire for every mutation handled by a `MutationCache`, regardless of which component or observer triggered it. They differ from the `defaultOptions` provided to a @@ -20,7 +20,7 @@ If a callback returns a promise, it will be awaited before the mutation continue optional onError: (error, variables, onMutateResult, mutation, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:18 +Defined in: [packages/query-core/src/mutationCache.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L28) Called when any mutation in the cache encounters an error. @@ -58,7 +58,7 @@ Called when any mutation in the cache encounters an error. optional onMutate: (variables, mutation, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:22 +Defined in: [packages/query-core/src/mutationCache.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L44) Called before any mutation in the cache executes. @@ -88,7 +88,7 @@ Called before any mutation in the cache executes. optional onSettled: (data, error, variables, onMutateResult, mutation, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:24 +Defined in: [packages/query-core/src/mutationCache.ts:50](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L50) Called when any mutation in the cache is settled, either successfully or with an error. @@ -130,7 +130,7 @@ Called when any mutation in the cache is settled, either successfully or with an optional onSuccess: (data, variables, onMutateResult, mutation, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:20 +Defined in: [packages/query-core/src/mutationCache.ts:36](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L36) Called when any mutation in the cache is successful. diff --git a/docs/framework/angular/reference/interfaces/MutationFilters.md b/docs/framework/angular/reference/interfaces/MutationFilters.md index e4a6959ffbf..fbc0208e8e1 100644 --- a/docs/framework/angular/reference/interfaces/MutationFilters.md +++ b/docs/framework/angular/reference/interfaces/MutationFilters.md @@ -3,7 +3,7 @@ id: MutationFilters title: MutationFilters --- -Defined in: packages/query-core/dist-ts/src/utils.d.ts:43 +Defined in: [packages/query-core/src/utils.ts:64](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L64) Filters used to select mutations, for example in `mutationCache.findAll` or `queryClient.isMutating`. All provided filters must match; filters that are left unspecified are ignored. @@ -34,7 +34,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:47 +Defined in: [packages/query-core/src/utils.ts:73](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L73) Match mutation key exactly @@ -46,7 +46,7 @@ Match mutation key exactly optional mutationKey: readonly unknown[]; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:55 +Defined in: [packages/query-core/src/utils.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L83) Include mutations matching this mutation key @@ -58,7 +58,7 @@ Include mutations matching this mutation key optional predicate: (mutation) => boolean; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:51 +Defined in: [packages/query-core/src/utils.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L77) Include mutations matching this predicate function @@ -80,6 +80,6 @@ Include mutations matching this predicate function optional status: MutationStatus; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:59 +Defined in: [packages/query-core/src/utils.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L87) Filter by mutation status diff --git a/docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md index df0b4edaeca..e1c09a56737 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:757 +Defined in: [packages/query-core/src/types.ts:1315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1315) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -45,7 +45,7 @@ that observer results (e.g. `MutationObserverResult`) are derived from. context: TOnMutateResult | undefined; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:22 +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) The value returned by `onMutate`, if defined. Passed to `onSuccess`, `onError` and `onSettled` as the mutation's context. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:761 +Defined in: [packages/query-core/src/types.ts:1324](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1324) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:770 +Defined in: [packages/query-core/src/types.ts:1333](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1333) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -95,7 +95,7 @@ The error object for the mutation, if an error was encountered. failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:35 +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) The number of times the mutation function has failed for the current attempt. @@ -111,7 +111,7 @@ The number of times the mutation function has failed for the current attempt. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:39 +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) The reason the current attempt failed, as reported by the retryer. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:775 +Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:780 +Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -153,7 +153,7 @@ A boolean variable derived from `status`. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:44 +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) Whether the mutation is currently paused (see network mode), or is waiting for another mutation with the same `scope` to finish. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:785 +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:790 +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:810 +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:814 +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:799 +Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) The status of the mutation. - Will be: @@ -266,7 +266,7 @@ The status of the mutation. submittedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:56 +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) The timestamp for when the mutation was submitted. @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:765 +Defined in: [packages/query-core/src/types.ts:1328](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1328) The variables object passed to the `mutationFn`. diff --git a/docs/framework/angular/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/angular/reference/interfaces/MutationObserverErrorResult.md index d22b2ec7e46..cce591e3465 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:836 +Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -38,7 +38,7 @@ that observer results (e.g. `MutationObserverResult`) are derived from. context: TOnMutateResult | undefined; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:22 +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) The value returned by `onMutate`, if defined. Passed to `onSuccess`, `onError` and `onSettled` as the mutation's context. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:837 +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:838 +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -88,7 +88,7 @@ The error object for the mutation, if an error was encountered. failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:35 +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) The number of times the mutation function has failed for the current attempt. @@ -104,7 +104,7 @@ The number of times the mutation function has failed for the current attempt. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:39 +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) The reason the current attempt failed, as reported by the retryer. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:840 +Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:841 +Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -154,7 +154,7 @@ A boolean variable derived from `status`. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:44 +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) Whether the mutation is currently paused (see network mode), or is waiting for another mutation with the same `scope` to finish. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:842 +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:843 +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:810 +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:814 +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:844 +Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) The status of the mutation. - Will be: @@ -283,7 +283,7 @@ The status of the mutation. submittedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:56 +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) The timestamp for when the mutation was submitted. @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:839 +Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) The variables object passed to the `mutationFn`. diff --git a/docs/framework/angular/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/angular/reference/interfaces/MutationObserverIdleResult.md index 7b5c3034542..b7892846a6c 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:816 +Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -38,7 +38,7 @@ that observer results (e.g. `MutationObserverResult`) are derived from. context: TOnMutateResult | undefined; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:22 +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) The value returned by `onMutate`, if defined. Passed to `onSuccess`, `onError` and `onSettled` as the mutation's context. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:817 +Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:819 +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -88,7 +88,7 @@ The error object for the mutation, if an error was encountered. failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:35 +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) The number of times the mutation function has failed for the current attempt. @@ -104,7 +104,7 @@ The number of times the mutation function has failed for the current attempt. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:39 +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) The reason the current attempt failed, as reported by the retryer. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:820 +Defined in: [packages/query-core/src/types.ts:1394](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1394) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:821 +Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -154,7 +154,7 @@ A boolean variable derived from `status`. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:44 +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) Whether the mutation is currently paused (see network mode), or is waiting for another mutation with the same `scope` to finish. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:822 +Defined in: [packages/query-core/src/types.ts:1396](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1396) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:823 +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:810 +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:814 +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:824 +Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) The status of the mutation. - Will be: @@ -283,7 +283,7 @@ The status of the mutation. submittedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:56 +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) The timestamp for when the mutation was submitted. @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:818 +Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) The variables object passed to the `mutationFn`. diff --git a/docs/framework/angular/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/angular/reference/interfaces/MutationObserverLoadingResult.md index 0b3fa2d6f82..d4368822213 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:826 +Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -38,7 +38,7 @@ that observer results (e.g. `MutationObserverResult`) are derived from. context: TOnMutateResult | undefined; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:22 +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) The value returned by `onMutate`, if defined. Passed to `onSuccess`, `onError` and `onSettled` as the mutation's context. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:827 +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:829 +Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -88,7 +88,7 @@ The error object for the mutation, if an error was encountered. failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:35 +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) The number of times the mutation function has failed for the current attempt. @@ -104,7 +104,7 @@ The number of times the mutation function has failed for the current attempt. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:39 +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) The reason the current attempt failed, as reported by the retryer. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:830 +Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:831 +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -154,7 +154,7 @@ A boolean variable derived from `status`. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:44 +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) Whether the mutation is currently paused (see network mode), or is waiting for another mutation with the same `scope` to finish. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:832 +Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:833 +Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:810 +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:814 +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:834 +Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) The status of the mutation. - Will be: @@ -283,7 +283,7 @@ The status of the mutation. submittedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:56 +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) The timestamp for when the mutation was submitted. @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:828 +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) The variables object passed to the `mutationFn`. diff --git a/docs/framework/angular/reference/interfaces/MutationObserverOptions.md b/docs/framework/angular/reference/interfaces/MutationObserverOptions.md index 2c5721c22f7..1e609be9bf1 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:741 +Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1255) ## Extends @@ -35,7 +35,12 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:741 optional gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:735 +Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) + +The time in milliseconds that an unused/inactive mutation remains in memory before it is +garbage collected. + +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. #### Inherited from @@ -49,7 +54,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:735 optional meta: Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:738 +Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) #### Inherited from @@ -63,7 +68,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:738 optional mutationFn: MutationFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:726 +Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) #### Inherited from @@ -77,7 +82,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:726 optional mutationKey: readonly unknown[]; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:727 +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) #### Inherited from @@ -91,7 +96,13 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:727 optional networkMode: NetworkMode; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:734 +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. #### Inherited from @@ -105,7 +116,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:734 optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:730 +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -141,7 +152,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:730 optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:728 +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) #### Parameters @@ -169,7 +180,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:728 optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:731 +Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) #### Parameters @@ -209,7 +220,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:731 optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:729 +Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) #### Parameters @@ -245,7 +256,14 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:729 optional retry: RetryValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:732 +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) + +If `false`, failed mutations will not retry by default. +If `true`, failed mutations will retry infinitely. +If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. +If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + +Defaults to `0`. #### Inherited from @@ -259,7 +277,12 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:732 optional retryDelay: RetryDelayValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:733 +Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +Defaults to a function that applies exponential backoff, capped at 30 seconds. #### Inherited from @@ -273,7 +296,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:733 optional scope: MutationScope; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:739 +Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) #### Inherited from @@ -287,4 +310,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:739 optional throwOnError: boolean | (error) => boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:742 +Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) diff --git a/docs/framework/angular/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/angular/reference/interfaces/MutationObserverSuccessResult.md index a80cfc3d10a..52cdcc4883e 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:846 +Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -38,7 +38,7 @@ that observer results (e.g. `MutationObserverResult`) are derived from. context: TOnMutateResult | undefined; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:22 +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) The value returned by `onMutate`, if defined. Passed to `onSuccess`, `onError` and `onSettled` as the mutation's context. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:847 +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:848 +Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -88,7 +88,7 @@ The error object for the mutation, if an error was encountered. failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:35 +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) The number of times the mutation function has failed for the current attempt. @@ -104,7 +104,7 @@ The number of times the mutation function has failed for the current attempt. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:39 +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) The reason the current attempt failed, as reported by the retryer. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:850 +Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:851 +Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -154,7 +154,7 @@ A boolean variable derived from `status`. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:44 +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) Whether the mutation is currently paused (see network mode), or is waiting for another mutation with the same `scope` to finish. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:852 +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:853 +Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:810 +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:814 +Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:854 +Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) The status of the mutation. - Will be: @@ -283,7 +283,7 @@ The status of the mutation. submittedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:56 +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) The timestamp for when the mutation was submitted. @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:849 +Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) The variables object passed to the `mutationFn`. diff --git a/docs/framework/angular/reference/interfaces/MutationOptions.md b/docs/framework/angular/reference/interfaces/MutationOptions.md index f98c35a8118..49f2b8f4f19 100644 --- a/docs/framework/angular/reference/interfaces/MutationOptions.md +++ b/docs/framework/angular/reference/interfaces/MutationOptions.md @@ -3,7 +3,7 @@ id: MutationOptions title: MutationOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:725 +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) ## Extended by @@ -35,7 +35,12 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:725 optional gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:735 +Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) + +The time in milliseconds that an unused/inactive mutation remains in memory before it is +garbage collected. + +Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. *** @@ -45,7 +50,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:735 optional meta: Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:738 +Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) *** @@ -55,7 +60,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:738 optional mutationFn: MutationFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:726 +Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) *** @@ -65,7 +70,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:726 optional mutationKey: readonly unknown[]; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:727 +Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) *** @@ -75,7 +80,13 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:727 optional networkMode: NetworkMode; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:734 +Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) + +Defaults to `'online'`. + +#### See + +[Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. *** @@ -85,7 +96,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:734 optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:730 +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -117,7 +128,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:730 optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:728 +Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) #### Parameters @@ -141,7 +152,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:728 optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:731 +Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) #### Parameters @@ -177,7 +188,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:731 optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:729 +Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) #### Parameters @@ -209,7 +220,14 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:729 optional retry: RetryValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:732 +Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) + +If `false`, failed mutations will not retry by default. +If `true`, failed mutations will retry infinitely. +If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number. +If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false. + +Defaults to `0`. *** @@ -219,7 +237,12 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:732 optional retryDelay: RetryDelayValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:733 +Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) + +This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the +next attempt in milliseconds. + +Defaults to a function that applies exponential backoff, capped at 30 seconds. *** @@ -229,4 +252,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:733 optional scope: MutationScope; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:739 +Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) diff --git a/docs/framework/angular/reference/interfaces/MutationState.md b/docs/framework/angular/reference/interfaces/MutationState.md index a23ec056f2b..bec050ec1d3 100644 --- a/docs/framework/angular/reference/interfaces/MutationState.md +++ b/docs/framework/angular/reference/interfaces/MutationState.md @@ -3,7 +3,7 @@ id: MutationState title: MutationState --- -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:17 +Defined in: [packages/query-core/src/mutation.ts:30](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L30) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -38,7 +38,7 @@ that observer results (e.g. `MutationObserverResult`) are derived from. context: TOnMutateResult | undefined; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:22 +Defined in: [packages/query-core/src/mutation.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L40) The value returned by `onMutate`, if defined. Passed to `onSuccess`, `onError` and `onSettled` as the mutation's context. @@ -51,7 +51,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:26 +Defined in: [packages/query-core/src/mutation.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L44) The last successfully resolved data for the mutation. @@ -63,7 +63,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:31 +Defined in: [packages/query-core/src/mutation.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L49) The error object for the mutation, if the last attempt resulted in an error. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the mutation, if the last attempt resulted in an error. failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:35 +Defined in: [packages/query-core/src/mutation.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L53) The number of times the mutation function has failed for the current attempt. @@ -88,7 +88,7 @@ The number of times the mutation function has failed for the current attempt. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:39 +Defined in: [packages/query-core/src/mutation.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L57) The reason the current attempt failed, as reported by the retryer. @@ -100,7 +100,7 @@ The reason the current attempt failed, as reported by the retryer. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:44 +Defined in: [packages/query-core/src/mutation.ts:62](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L62) Whether the mutation is currently paused (see network mode), or is waiting for another mutation with the same `scope` to finish. @@ -113,7 +113,7 @@ waiting for another mutation with the same `scope` to finish. status: MutationStatus; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:48 +Defined in: [packages/query-core/src/mutation.ts:66](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L66) The status of the mutation. @@ -125,7 +125,7 @@ The status of the mutation. submittedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:56 +Defined in: [packages/query-core/src/mutation.ts:74](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L74) The timestamp for when the mutation was submitted. @@ -137,6 +137,6 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: packages/query-core/dist-ts/src/mutation.d.ts:52 +Defined in: [packages/query-core/src/mutation.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L70) The variables the mutation was last called with. diff --git a/docs/framework/angular/reference/interfaces/NotifyEvent.md b/docs/framework/angular/reference/interfaces/NotifyEvent.md index 59890a48254..5e7875d41b8 100644 --- a/docs/framework/angular/reference/interfaces/NotifyEvent.md +++ b/docs/framework/angular/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:886 +Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1519) ## Properties @@ -13,4 +13,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:886 type: NotifyEventType; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:887 +Defined in: [packages/query-core/src/types.ts:1520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1520) diff --git a/docs/framework/angular/reference/interfaces/OnlineManager.md b/docs/framework/angular/reference/interfaces/OnlineManager.md index d6b19b09e62..1a936c91ed9 100644 --- a/docs/framework/angular/reference/interfaces/OnlineManager.md +++ b/docs/framework/angular/reference/interfaces/OnlineManager.md @@ -3,7 +3,7 @@ id: OnlineManager title: OnlineManager --- -Defined in: packages/query-core/dist-ts/src/onlineManager.d.ts:13 +Defined in: [packages/query-core/src/onlineManager.ts:15](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L15) The `OnlineManager` manages the online state within TanStack Query. It can be used to change the default event listeners or to manually change the @@ -25,7 +25,7 @@ detect changes. protected listeners: Set; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:2 +Defined in: [packages/query-core/src/subscribable.ts:2](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L2) #### Inherited from @@ -41,7 +41,7 @@ Subscribable.listeners hasListeners(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:5 +Defined in: [packages/query-core/src/subscribable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L19) #### Returns @@ -61,7 +61,7 @@ Subscribable.hasListeners isOnline(): boolean; ``` -Defined in: packages/query-core/dist-ts/src/onlineManager.d.ts:55 +Defined in: [packages/query-core/src/onlineManager.ts:109](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L109) `isOnline` can be used to get the current online state. @@ -77,7 +77,7 @@ Defined in: packages/query-core/dist-ts/src/onlineManager.d.ts:55 protected onSubscribe(): void; ``` -Defined in: packages/query-core/dist-ts/src/onlineManager.d.ts:16 +Defined in: [packages/query-core/src/onlineManager.ts:44](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L44) #### Returns @@ -97,7 +97,7 @@ Subscribable.onSubscribe protected onUnsubscribe(): void; ``` -Defined in: packages/query-core/dist-ts/src/onlineManager.d.ts:17 +Defined in: [packages/query-core/src/onlineManager.ts:50](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L50) #### Returns @@ -117,7 +117,7 @@ Subscribable.onUnsubscribe setEventListener(setup): void; ``` -Defined in: packages/query-core/dist-ts/src/onlineManager.d.ts:36 +Defined in: [packages/query-core/src/onlineManager.ts:75](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L75) `setEventListener` can be used to set a custom event listener that will be used to determine the online state. The provided `setup` function @@ -155,7 +155,7 @@ onlineManager.setEventListener((setOnline) => { setOnline(online): void; ``` -Defined in: packages/query-core/dist-ts/src/onlineManager.d.ts:51 +Defined in: [packages/query-core/src/onlineManager.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L95) `setOnline` can be used to manually set the online state. @@ -189,7 +189,7 @@ onlineManager.setOnline(false) subscribe(listener): () => void; ``` -Defined in: packages/query-core/dist-ts/src/subscribable.d.ts:4 +Defined in: [packages/query-core/src/subscribable.ts:8](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L8) #### Parameters diff --git a/docs/framework/angular/reference/interfaces/QueriesObserverOptions.md b/docs/framework/angular/reference/interfaces/QueriesObserverOptions.md index 2702657fb0b..68e7913885d 100644 --- a/docs/framework/angular/reference/interfaces/QueriesObserverOptions.md +++ b/docs/framework/angular/reference/interfaces/QueriesObserverOptions.md @@ -3,7 +3,7 @@ id: QueriesObserverOptions title: QueriesObserverOptions --- -Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:7 +Defined in: [packages/query-core/src/queriesObserver.ts:23](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L23) ## Type Parameters @@ -19,9 +19,11 @@ Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:7 optional combine: CombineFn; ``` -Defined in: packages/query-core/dist-ts/src/queriesObserver.d.ts:14 +Defined in: [packages/query-core/src/queriesObserver.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L34) A function that combines the array of `QueryObserverResult`s (one per observed query) into a single value. The combined value is memoized and only recomputed when one of the underlying results, the query hashes, or the `combine` function itself changes. + +Defaults to returning the array of `QueryObserverResult`s unchanged. diff --git a/docs/framework/angular/reference/interfaces/QueryCacheConfig.md b/docs/framework/angular/reference/interfaces/QueryCacheConfig.md index fbfdc5735f2..3c6aebe496f 100644 --- a/docs/framework/angular/reference/interfaces/QueryCacheConfig.md +++ b/docs/framework/angular/reference/interfaces/QueryCacheConfig.md @@ -3,7 +3,7 @@ id: QueryCacheConfig title: QueryCacheConfig --- -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:14 +Defined in: [packages/query-core/src/queryCache.ts:25](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L25) Global callbacks that fire for every query handled by a `QueryCache`, regardless of which component or observer triggered it. Unlike `QueryClient`'s `defaultOptions`, which a query can @@ -18,7 +18,7 @@ are fire-and-forget: their return value is not awaited before the query settles. optional onError: (error, query) => void; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:16 +Defined in: [packages/query-core/src/queryCache.ts:27](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L27) Called when any query in the cache encounters an error. @@ -44,7 +44,7 @@ Called when any query in the cache encounters an error. optional onSettled: (data, error, query) => void; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:20 +Defined in: [packages/query-core/src/queryCache.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L34) Called when any query in the cache is settled, either successfully or with an error. @@ -74,7 +74,7 @@ Called when any query in the cache is settled, either successfully or with an er optional onSuccess: (data, query) => void; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:18 +Defined in: [packages/query-core/src/queryCache.ts:32](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L32) Called when any query in the cache is successful. diff --git a/docs/framework/angular/reference/interfaces/QueryClientConfig.md b/docs/framework/angular/reference/interfaces/QueryClientConfig.md index d6ccb67158e..411eb0b2fb2 100644 --- a/docs/framework/angular/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/angular/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:857 +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) ## Properties @@ -13,7 +13,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:857 optional defaultOptions: DefaultOptions; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:866 +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) Default options for all queries and mutations created through this client. @@ -25,7 +25,7 @@ Default options for all queries and mutations created through this client. optional mutationCache: MutationCache; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:864 +Defined in: [packages/query-core/src/types.ts:1482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1482) The mutation cache this client is connected to. A new `MutationCache` is created if not provided. @@ -38,6 +38,6 @@ provided. optional queryCache: QueryCache; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:859 +Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/angular/reference/interfaces/QueryExecuteOptions.md b/docs/framework/angular/reference/interfaces/QueryExecuteOptions.md index 6ce7fce21a2..1e844c5ba10 100644 --- a/docs/framework/angular/reference/interfaces/QueryExecuteOptions.md +++ b/docs/framework/angular/reference/interfaces/QueryExecuteOptions.md @@ -3,7 +3,7 @@ id: QueryExecuteOptions title: QueryExecuteOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:303 +Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) ## Extends @@ -43,7 +43,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:303 optional gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:120 +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -70,7 +70,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:160 +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -93,7 +93,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:164 +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -111,7 +111,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:304 +Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L577) *** @@ -121,7 +121,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:304 optional maxPages: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:185 +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -139,7 +139,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:181 +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -158,7 +158,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:109 +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -180,7 +180,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:133 +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -201,7 +201,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:128 +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -223,7 +223,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:138 +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -242,7 +242,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:147 +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -265,7 +265,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:151 +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -283,12 +283,13 @@ WithRequired.queryKeyHashFn optional retry: RetryValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:94 +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -305,7 +306,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:104 +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -329,7 +330,7 @@ WithRequired.retryDelay optional select: (data) => TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:305 +Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L578) #### Parameters @@ -349,7 +350,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:305 optional staleTime: StaleTimeFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:310 +Defined in: [packages/query-core/src/types.ts:583](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L583) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -362,10 +363,11 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:172 +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/QueryFilters.md b/docs/framework/angular/reference/interfaces/QueryFilters.md index af6418db837..749e4283d0d 100644 --- a/docs/framework/angular/reference/interfaces/QueryFilters.md +++ b/docs/framework/angular/reference/interfaces/QueryFilters.md @@ -3,7 +3,7 @@ id: QueryFilters title: QueryFilters --- -Defined in: packages/query-core/dist-ts/src/utils.d.ts:13 +Defined in: [packages/query-core/src/utils.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L31) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -27,7 +27,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:21 +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -39,7 +39,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:37 +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -51,7 +51,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:25 +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -73,7 +73,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:29 +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -85,7 +85,7 @@ Include queries matching this query key optional stale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:33 +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -97,6 +97,8 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:17 +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries + +Defaults to `'all'`. diff --git a/docs/framework/angular/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/angular/reference/interfaces/QueryObserverBaseResult.md index 7d9acb5dc6a..1b54d6f8041 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:397 +Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) ## Extended by @@ -33,7 +33,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:397 data: TData | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:401 +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:405 +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:410 +Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:429 +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:414 +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:420 +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:517 +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:497 +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:497 isError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:434 +Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:438 +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:443 +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:448 +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:466 +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:461 +Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:457 +Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:475 +Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:479 +Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:493 +Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:501 +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:509 +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/angular/reference/interfaces/QueryObserverLoadingErrorResult.md index ab6f2c64a18..7a4f855305f 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:542 +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:542 data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:543 +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:405 +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:544 +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:429 +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:414 +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:420 +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:517 +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:497 +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:497 isError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:545 +Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:438 +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:443 +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:448 +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:466 +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:547 +Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:548 +Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:546 +Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:551 +Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:549 +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:550 +Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:501 +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:552 +Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/angular/reference/interfaces/QueryObserverLoadingResult.md index 412b9f547b3..8f94574bcca 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:530 +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:530 data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:531 +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:405 +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:532 +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:429 +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:414 +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:420 +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:517 +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:497 +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:497 isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:533 +Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:438 +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:443 +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:448 +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:466 +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:535 +Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:536 +Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:534 +Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:539 +Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:537 +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:538 +Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:501 +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:540 +Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverOptions.md b/docs/framework/angular/reference/interfaces/QueryObserverOptions.md index 8cfd8b82561..d9fba419fe7 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverOptions.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverOptions.md @@ -3,7 +3,7 @@ id: QueryObserverOptions title: QueryObserverOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:203 +Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L375) ## Extends @@ -48,11 +48,12 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:203 optional enabled: QueryBooleanOption; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:210 +Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. + Defaults to `true`. *** @@ -63,7 +64,7 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:120 +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -90,7 +91,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:160 +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -113,7 +114,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:164 +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -131,7 +132,7 @@ WithRequired.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:185 +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -149,7 +150,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:181 +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -168,7 +169,7 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:109 +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -190,7 +191,7 @@ WithRequired.networkMode optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:267 +Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. @@ -206,7 +207,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:133 +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -227,7 +228,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:292 +Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -241,7 +242,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:128 +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -263,7 +264,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:138 +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -282,7 +283,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:147 +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -305,7 +306,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:151 +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -323,10 +324,11 @@ WithRequired.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:224 +Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency + Defaults to `false`. *** @@ -337,7 +339,7 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:229 +Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) If set to `true`, the query will continue to refetch while their tab/window is in the background. Defaults to `false`. @@ -350,12 +352,13 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:253 +Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value + Defaults to `true`. *** @@ -366,12 +369,13 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:245 +Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true` unless `networkMode` is `'always'`. *** @@ -382,12 +386,13 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:237 +Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. + Defaults to `true`. *** @@ -398,12 +403,13 @@ Defaults to `true`. optional retry: RetryValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:94 +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. #### Inherited from @@ -420,7 +426,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:104 +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -444,10 +450,11 @@ WithRequired.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:259 +Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. + Defaults to `true`. *** @@ -458,7 +465,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:282 +Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -483,12 +490,13 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:218 +Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. + Defaults to `0`. *** @@ -499,10 +507,11 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:172 +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. #### Inherited from @@ -519,10 +528,11 @@ WithRequired.structuralSharing optional suspense: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:288 +Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. + Defaults to `false`. *** @@ -533,10 +543,11 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:275 +Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + Defaults to `false`. diff --git a/docs/framework/angular/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/angular/reference/interfaces/QueryObserverPendingResult.md index bc233dd8c64..41a101c7c8c 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:519 +Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:519 data: undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:520 +Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:405 +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:521 +Defined in: [packages/query-core/src/types.ts:887](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L887) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:429 +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:414 +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:420 +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:517 +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:497 +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:497 isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:522 +Defined in: [packages/query-core/src/types.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L888) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:438 +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:443 +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:448 +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:466 +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:453 +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:524 +Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:523 +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:527 +Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:525 +Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:526 +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:501 +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:528 +Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/angular/reference/interfaces/QueryObserverPlaceholderResult.md index 1717a64e43b..cce7cffcc9b 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:578 +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:578 data: TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:579 +Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:405 +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:581 +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:429 +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:414 +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:420 +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:517 +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:497 +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:497 isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:580 +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:438 +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:443 +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:448 +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:466 +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:583 +Defined in: [packages/query-core/src/types.ts:969](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L969) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:584 +Defined in: [packages/query-core/src/types.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L970) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:582 +Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:587 +Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:585 +Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:586 +Defined in: [packages/query-core/src/types.ts:972](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L972) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:501 +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:588 +Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/angular/reference/interfaces/QueryObserverRefetchErrorResult.md index 2fd52a94249..8486e8cf4cb 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:554 +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:554 data: TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:555 +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:405 +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:556 +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:429 +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:414 +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:420 +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:517 +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:497 +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:497 isError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:557 +Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:438 +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:443 +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:448 +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:466 +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:559 +Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:560 +Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:558 +Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:563 +Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:561 +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:562 +Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:501 +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:564 +Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/angular/reference/interfaces/QueryObserverSuccessResult.md index 4da4d4d92d3..f126bea0f70 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:566 +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) ## Extends @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:566 data: TData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:567 +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:405 +Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:568 +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:429 +Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:414 +Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:420 +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:425 +Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:517 +Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:497 +Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:497 isError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:569 +Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:438 +Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:443 +Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:448 +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:466 +Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:571 +Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:572 +Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:471 +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:570 +Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:575 +Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:573 +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:484 +Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:488 +Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:574 +Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:501 +Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:576 +Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryOptions.md b/docs/framework/angular/reference/interfaces/QueryOptions.md index 3f4bcc9b526..bb82dd0f56a 100644 --- a/docs/framework/angular/reference/interfaces/QueryOptions.md +++ b/docs/framework/angular/reference/interfaces/QueryOptions.md @@ -3,7 +3,7 @@ id: QueryOptions title: QueryOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:86 +Defined in: [packages/query-core/src/types.ts:231](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L231) ## Type Parameters @@ -35,7 +35,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:86 optional gcTime: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:120 +Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. @@ -56,7 +56,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:160 +Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -73,7 +73,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:164 +Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -85,7 +85,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:185 +Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) Maximum number of pages to store in the data of an infinite query. @@ -97,7 +97,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:181 +Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -110,7 +110,7 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:109 +Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) Defaults to `'online'`. @@ -126,7 +126,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:133 +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -141,7 +141,7 @@ optional queryFn: | typeof skipToken; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:128 +Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -157,7 +157,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:138 +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -170,7 +170,7 @@ as the actual cache key internally. optional queryKey: TQueryKey; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:147 +Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) The query key to use for this query. @@ -187,7 +187,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:151 +Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) If specified, this function is used to hash the `queryKey` to a string. @@ -199,12 +199,13 @@ If specified, this function is used to hash the `queryKey` to a string. optional retry: RetryValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:94 +Defined in: [packages/query-core/src/types.ts:246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L246) If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + Defaults to `3` on the client and `0` on the server. *** @@ -215,7 +216,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:104 +Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -233,8 +234,9 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:172 +Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + Defaults to `true`. diff --git a/docs/framework/angular/reference/interfaces/QueryState.md b/docs/framework/angular/reference/interfaces/QueryState.md index c0449d51e59..7dce476d743 100644 --- a/docs/framework/angular/reference/interfaces/QueryState.md +++ b/docs/framework/angular/reference/interfaces/QueryState.md @@ -3,7 +3,7 @@ id: QueryState title: QueryState --- -Defined in: packages/query-core/dist-ts/src/query.d.ts:17 +Defined in: [packages/query-core/src/query.ts:52](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L52) The raw state stored on a `Query` instance. This is the underlying state that observer results (e.g. `QueryObserverResult`) are derived from. @@ -26,7 +26,7 @@ that observer results (e.g. `QueryObserverResult`) are derived from. data: TData | undefined; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:21 +Defined in: [packages/query-core/src/query.ts:56](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L56) The last successfully resolved data for the query. @@ -38,7 +38,7 @@ The last successfully resolved data for the query. dataUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:25 +Defined in: [packages/query-core/src/query.ts:60](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L60) The number of times the query has successfully resolved. @@ -50,7 +50,7 @@ The number of times the query has successfully resolved. dataUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:29 +Defined in: [packages/query-core/src/query.ts:64](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L64) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -62,7 +62,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:34 +Defined in: [packages/query-core/src/query.ts:69](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L69) The error object for the query, if the last attempt resulted in an error. - Defaults to `null`. @@ -75,7 +75,7 @@ The error object for the query, if the last attempt resulted in an error. errorUpdateCount: number; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:38 +Defined in: [packages/query-core/src/query.ts:73](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L73) The sum of all errors, incremented every time the query resolves with an error. @@ -87,7 +87,7 @@ The sum of all errors, incremented every time the query resolves with an error. errorUpdatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:42 +Defined in: [packages/query-core/src/query.ts:77](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L77) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -99,7 +99,7 @@ The timestamp for when the query most recently returned the `status` as `"error" fetchFailureCount: number; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:48 +Defined in: [packages/query-core/src/query.ts:83](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L83) The failure count for the current fetch. - Incremented every time the fetch fails. @@ -113,7 +113,7 @@ The failure count for the current fetch. fetchFailureReason: TError | null; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:53 +Defined in: [packages/query-core/src/query.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L88) The reason the current fetch failed, as reported by the retryer. - Reset to `null` when the fetch succeeds. @@ -126,7 +126,7 @@ The reason the current fetch failed, as reported by the retryer. fetchMeta: FetchMeta | null; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:58 +Defined in: [packages/query-core/src/query.ts:93](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L93) Metadata passed to the currently in-flight (or most recent) fetch, e.g. the `fetchMore` direction for infinite queries. @@ -139,7 +139,7 @@ Metadata passed to the currently in-flight (or most recent) fetch, e.g. the fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:77 +Defined in: [packages/query-core/src/query.ts:112](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L112) The fetch status of the query. - `fetching`: the `queryFn` is currently executing. @@ -154,7 +154,7 @@ The fetch status of the query. isInvalidated: boolean; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:63 +Defined in: [packages/query-core/src/query.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L98) Whether the query has been marked as invalidated via `invalidate()`. - Reset to `false` whenever the query resolves successfully. @@ -167,7 +167,7 @@ Whether the query has been marked as invalidated via `invalidate()`. status: QueryStatus; ``` -Defined in: packages/query-core/dist-ts/src/query.d.ts:70 +Defined in: [packages/query-core/src/query.ts:105](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L105) The status of the query. - `pending` if there's no cached data and no attempt was finished yet. diff --git a/docs/framework/angular/reference/interfaces/RefetchOptions.md b/docs/framework/angular/reference/interfaces/RefetchOptions.md index c12c1e20a12..104412c5bac 100644 --- a/docs/framework/angular/reference/interfaces/RefetchOptions.md +++ b/docs/framework/angular/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:346 +Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) ## Extends @@ -22,7 +22,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:346 optional cancelRefetch: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:354 +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,7 +38,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:344 +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/angular/reference/interfaces/RefetchQueryFilters.md b/docs/framework/angular/reference/interfaces/RefetchQueryFilters.md index e0ad9b35c96..bde28360fa1 100644 --- a/docs/framework/angular/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/angular/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:367 +Defined in: [packages/query-core/src/types.ts:720](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L720) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -26,7 +26,7 @@ All provided filters must match; filters that are left unspecified are ignored. optional exact: boolean; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:21 +Defined in: [packages/query-core/src/utils.ts:41](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L41) Match query key exactly @@ -42,7 +42,7 @@ Match query key exactly optional fetchStatus: FetchStatus; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:37 +Defined in: [packages/query-core/src/utils.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L57) Include queries matching their fetchStatus @@ -58,7 +58,7 @@ Include queries matching their fetchStatus optional predicate: (query) => boolean; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:25 +Defined in: [packages/query-core/src/utils.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L45) Include queries matching this predicate function @@ -84,7 +84,7 @@ Include queries matching this predicate function optional queryKey: TQueryKey | TuplePrefixes; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:29 +Defined in: [packages/query-core/src/utils.ts:49](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L49) Include queries matching this query key @@ -100,7 +100,7 @@ Include queries matching this query key optional stale: boolean; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:33 +Defined in: [packages/query-core/src/utils.ts:53](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L53) Include or exclude stale queries @@ -116,10 +116,12 @@ Include or exclude stale queries optional type: QueryTypeFilter; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:17 +Defined in: [packages/query-core/src/utils.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L37) Filter to active queries, inactive queries or all queries +Defaults to `'all'`. + #### Inherited from [`QueryFilters`](QueryFilters.md).[`type`](QueryFilters.md#type) diff --git a/docs/framework/angular/reference/interfaces/Register.md b/docs/framework/angular/reference/interfaces/Register.md index 68e892cf726..4f442442b48 100644 --- a/docs/framework/angular/reference/interfaces/Register.md +++ b/docs/framework/angular/reference/interfaces/Register.md @@ -3,4 +3,4 @@ id: Register title: Register --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:15 +Defined in: [packages/query-core/src/types.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L37) diff --git a/docs/framework/angular/reference/interfaces/ResetOptions.md b/docs/framework/angular/reference/interfaces/ResetOptions.md index 033b02f0b9e..6d3a8398fbb 100644 --- a/docs/framework/angular/reference/interfaces/ResetOptions.md +++ b/docs/framework/angular/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:371 +Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) ## Extends @@ -17,7 +17,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:371 optional cancelRefetch: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:354 +Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,7 +37,7 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:344 +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/angular/reference/interfaces/ResultOptions.md b/docs/framework/angular/reference/interfaces/ResultOptions.md index 7120fe1e661..f3da151a3ec 100644 --- a/docs/framework/angular/reference/interfaces/ResultOptions.md +++ b/docs/framework/angular/reference/interfaces/ResultOptions.md @@ -3,7 +3,7 @@ id: ResultOptions title: ResultOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:338 +Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L686) ## Extended by @@ -19,7 +19,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:338 optional throwOnError: boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:344 +Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) If set to `true`, the method throws if any of the underlying query refetch tasks fail. Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the diff --git a/docs/framework/angular/reference/interfaces/SetDataOptions.md b/docs/framework/angular/reference/interfaces/SetDataOptions.md index da79f9f093c..cac83e9312a 100644 --- a/docs/framework/angular/reference/interfaces/SetDataOptions.md +++ b/docs/framework/angular/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: packages/query-core/dist-ts/src/types.d.ts:882 +Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1506) ## Properties @@ -13,4 +13,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:882 optional updatedAt: number; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:883 +Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) diff --git a/docs/framework/angular/reference/interfaces/TimeoutManager.md b/docs/framework/angular/reference/interfaces/TimeoutManager.md index f1cf5b869a4..95ff07b2ccc 100644 --- a/docs/framework/angular/reference/interfaces/TimeoutManager.md +++ b/docs/framework/angular/reference/interfaces/TimeoutManager.md @@ -3,7 +3,7 @@ id: TimeoutManager title: TimeoutManager --- -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:46 +Defined in: [packages/query-core/src/timeoutManager.ts:70](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L70) Allows customization of how timeouts are created. @@ -27,7 +27,7 @@ coalesces timeouts. clearInterval(intervalId): void; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:148 +Defined in: [packages/query-core/src/timeoutManager.ts:224](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L224) `clearInterval` can be used to cancel an interval, like the global `clearInterval` function. It should be called with an interval ID @@ -68,7 +68,7 @@ timeoutManager.clearInterval(intervalId) clearTimeout(timeoutId): void; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:112 +Defined in: [packages/query-core/src/timeoutManager.ts:179](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L179) `clearTimeout` cancels a timeout callback scheduled with `setTimeout`, like the global `clearTimeout` function. It should be called with a @@ -109,7 +109,7 @@ timeoutManager.clearTimeout(timeoutId) setInterval(callback, delay): ManagedTimerId; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:130 +Defined in: [packages/query-core/src/timeoutManager.ts:200](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L200) `setInterval` schedules a callback to be called approximately every `delay` milliseconds, like the global `setInterval` function. @@ -154,7 +154,7 @@ const intervalId = timeoutManager.setInterval( setTimeout(callback, delay): ManagedTimerId; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:94 +Defined in: [packages/query-core/src/timeoutManager.ts:155](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L155) `setTimeout` schedules a callback to run after approximately `delay` milliseconds, like the global `setTimeout` function. The callback can be @@ -202,7 +202,7 @@ const timeoutIdNumber: number = Number(timeoutId) setTimeoutProvider(provider): void; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:73 +Defined in: [packages/query-core/src/timeoutManager.ts:106](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L106) `setTimeoutProvider` can be used to set a custom implementation of the `setTimeout`, `clearTimeout`, `setInterval`, `clearInterval` functions, diff --git a/docs/framework/angular/reference/type-aliases/AnyDataTag.md b/docs/framework/angular/reference/type-aliases/AnyDataTag.md index 72172d8055e..d3d5e33bb3e 100644 --- a/docs/framework/angular/reference/type-aliases/AnyDataTag.md +++ b/docs/framework/angular/reference/type-aliases/AnyDataTag.md @@ -7,7 +7,7 @@ title: AnyDataTag type AnyDataTag = object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:29 +Defined in: [packages/query-core/src/types.ts:67](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L67) ## Properties @@ -17,7 +17,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:29 [dataTagErrorSymbol]: any; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:31 +Defined in: [packages/query-core/src/types.ts:69](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L69) *** @@ -27,4 +27,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:31 [dataTagSymbol]: any; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:30 +Defined in: [packages/query-core/src/types.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L68) diff --git a/docs/framework/angular/reference/type-aliases/DataTag.md b/docs/framework/angular/reference/type-aliases/DataTag.md index 625108004be..904ca124464 100644 --- a/docs/framework/angular/reference/type-aliases/DataTag.md +++ b/docs/framework/angular/reference/type-aliases/DataTag.md @@ -7,7 +7,7 @@ title: DataTag type DataTag = TType extends AnyDataTag ? TType : TType & object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:33 +Defined in: [packages/query-core/src/types.ts:71](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L71) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/DefaultError.md b/docs/framework/angular/reference/type-aliases/DefaultError.md index 470a0cbe9b7..da9f615482f 100644 --- a/docs/framework/angular/reference/type-aliases/DefaultError.md +++ b/docs/framework/angular/reference/type-aliases/DefaultError.md @@ -7,4 +7,4 @@ title: DefaultError type DefaultError = Register extends object ? TError : Error; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:17 +Defined in: [packages/query-core/src/types.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L45) diff --git a/docs/framework/angular/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/angular/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md index 6ce38df0aa3..4412ad00c8e 100644 --- a/docs/framework/angular/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md +++ b/docs/framework/angular/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedInfiniteQueryObserverOptions type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:302 +Defined in: [packages/query-core/src/types.ts:549](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L549) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/angular/reference/type-aliases/DefaultedQueryObserverOptions.md index 16295c87bca..9ce8401b128 100644 --- a/docs/framework/angular/reference/type-aliases/DefaultedQueryObserverOptions.md +++ b/docs/framework/angular/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedQueryObserverOptions type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:299 +Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index 920021ae2c5..cec33b142b7 100644 --- a/docs/framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:707 +Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/angular/reference/type-aliases/DefinedQueryObserverResult.md index aa4eb6fb0fd..b4480af3810 100644 --- a/docs/framework/angular/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/angular/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:590 +Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/DistributiveOmit.md b/docs/framework/angular/reference/type-aliases/DistributiveOmit.md index d710c6aaa83..33b87a5cd6e 100644 --- a/docs/framework/angular/reference/type-aliases/DistributiveOmit.md +++ b/docs/framework/angular/reference/type-aliases/DistributiveOmit.md @@ -7,7 +7,7 @@ title: DistributiveOmit type DistributiveOmit = TObject extends any ? Omit : never; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:10 +Defined in: [packages/query-core/src/types.ts:14](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L14) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/angular/reference/type-aliases/EnsureInfiniteQueryDataOptions.md index 251a65fd131..ff75b1c3449 100644 --- a/docs/framework/angular/reference/type-aliases/EnsureInfiniteQueryDataOptions.md +++ b/docs/framework/angular/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -7,7 +7,7 @@ title: EnsureInfiniteQueryDataOptions type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:326 +Defined in: [packages/query-core/src/types.ts:623](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L623) ## Type Declaration diff --git a/docs/framework/angular/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/angular/reference/type-aliases/FetchInfiniteQueryOptions.md index f3f02a26062..c926bbd3ae5 100644 --- a/docs/framework/angular/reference/type-aliases/FetchInfiniteQueryOptions.md +++ b/docs/framework/angular/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: FetchInfiniteQueryOptions type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:337 +Defined in: [packages/query-core/src/types.ts:667](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L667) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/FetchStatus.md b/docs/framework/angular/reference/type-aliases/FetchStatus.md index 85d190a2c72..b347069e97e 100644 --- a/docs/framework/angular/reference/type-aliases/FetchStatus.md +++ b/docs/framework/angular/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:396 +Defined in: [packages/query-core/src/types.ts:752](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L752) diff --git a/docs/framework/angular/reference/type-aliases/GetNextPageParamFunction.md b/docs/framework/angular/reference/type-aliases/GetNextPageParamFunction.md index 9eb463cbdde..81d1a1544ab 100644 --- a/docs/framework/angular/reference/type-aliases/GetNextPageParamFunction.md +++ b/docs/framework/angular/reference/type-aliases/GetNextPageParamFunction.md @@ -7,7 +7,7 @@ title: GetNextPageParamFunction type GetNextPageParamFunction = (lastPage, allPages, lastPageParam, allPageParams) => TPageParam | undefined | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:76 +Defined in: [packages/query-core/src/types.ts:203](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L203) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/GetPreviousPageParamFunction.md b/docs/framework/angular/reference/type-aliases/GetPreviousPageParamFunction.md index 32342382c21..5a6d9b93d7e 100644 --- a/docs/framework/angular/reference/type-aliases/GetPreviousPageParamFunction.md +++ b/docs/framework/angular/reference/type-aliases/GetPreviousPageParamFunction.md @@ -7,7 +7,7 @@ title: GetPreviousPageParamFunction type GetPreviousPageParamFunction = (firstPage, allPages, firstPageParam, allPageParams) => TPageParam | undefined | null; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:75 +Defined in: [packages/query-core/src/types.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L196) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/InferDataFromTag.md b/docs/framework/angular/reference/type-aliases/InferDataFromTag.md index 5002e47659c..09a15ca4b1c 100644 --- a/docs/framework/angular/reference/type-aliases/InferDataFromTag.md +++ b/docs/framework/angular/reference/type-aliases/InferDataFromTag.md @@ -7,7 +7,7 @@ title: InferDataFromTag type InferDataFromTag = TTaggedQueryKey extends DataTag ? TaggedValue : TQueryFnData; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:40 +Defined in: [packages/query-core/src/types.ts:90](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L90) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/InferErrorFromTag.md b/docs/framework/angular/reference/type-aliases/InferErrorFromTag.md index d09b9c92ff3..cd94e4b5c3f 100644 --- a/docs/framework/angular/reference/type-aliases/InferErrorFromTag.md +++ b/docs/framework/angular/reference/type-aliases/InferErrorFromTag.md @@ -7,7 +7,7 @@ title: InferErrorFromTag type InferErrorFromTag = TTaggedQueryKey extends DataTag ? TaggedError extends UnsetMarker ? TError : TaggedError : TError; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:41 +Defined in: [packages/query-core/src/types.ts:95](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L95) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/angular/reference/type-aliases/InfiniteQueryExecuteOptions.md index a898492d34e..c198662a319 100644 --- a/docs/framework/angular/reference/type-aliases/InfiniteQueryExecuteOptions.md +++ b/docs/framework/angular/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -7,7 +7,7 @@ title: InfiniteQueryExecuteOptions type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:335 +Defined in: [packages/query-core/src/types.ts:646](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L646) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/angular/reference/type-aliases/InfiniteQueryObserverResult.md index 092de84271f..42279b19c00 100644 --- a/docs/framework/angular/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/angular/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:708 +Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/InitialDataFunction.md b/docs/framework/angular/reference/type-aliases/InitialDataFunction.md index 716025e656c..6ba4aaabe61 100644 --- a/docs/framework/angular/reference/type-aliases/InitialDataFunction.md +++ b/docs/framework/angular/reference/type-aliases/InitialDataFunction.md @@ -7,7 +7,7 @@ title: InitialDataFunction type InitialDataFunction = () => T | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:70 +Defined in: [packages/query-core/src/types.ts:173](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L173) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/ManagedTimerId.md b/docs/framework/angular/reference/type-aliases/ManagedTimerId.md index 48ac22cfbde..d7833e3e4f0 100644 --- a/docs/framework/angular/reference/type-aliases/ManagedTimerId.md +++ b/docs/framework/angular/reference/type-aliases/ManagedTimerId.md @@ -11,7 +11,7 @@ type ManagedTimerId = }; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:16 +Defined in: [packages/query-core/src/timeoutManager.ts:17](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L17) Wrapping `setTimeout` is awkward from a typing perspective because platform typings may extend the return type of `setTimeout`. For example, NodeJS diff --git a/docs/framework/angular/reference/type-aliases/MutateFunction.md b/docs/framework/angular/reference/type-aliases/MutateFunction.md index d7d5b74e21c..558040d3439 100644 --- a/docs/framework/angular/reference/type-aliases/MutateFunction.md +++ b/docs/framework/angular/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:756 +Defined in: [packages/query-core/src/types.ts:1306](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1306) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/MutateFunctionRest.md b/docs/framework/angular/reference/type-aliases/MutateFunctionRest.md index 16c670cdd56..3e7a5217482 100644 --- a/docs/framework/angular/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/angular/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:749 +Defined in: [packages/query-core/src/types.ts:1291](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1291) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/MutationCacheNotifyEvent.md b/docs/framework/angular/reference/type-aliases/MutationCacheNotifyEvent.md index ac7423a48e7..aa5e196bc72 100644 --- a/docs/framework/angular/reference/type-aliases/MutationCacheNotifyEvent.md +++ b/docs/framework/angular/reference/type-aliases/MutationCacheNotifyEvent.md @@ -13,7 +13,7 @@ type MutationCacheNotifyEvent = | NotifyEventMutationUpdated; ``` -Defined in: packages/query-core/dist-ts/src/mutationCache.d.ts:59 +Defined in: [packages/query-core/src/mutationCache.ts:98](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L98) The event passed to a `MutationCache` subscriber. Fired whenever a mutation is added or removed from the cache, its state is updated, or one of its observers is added, removed, or has its diff --git a/docs/framework/angular/reference/type-aliases/MutationFunction.md b/docs/framework/angular/reference/type-aliases/MutationFunction.md index 344a658ee9f..330af1ef65a 100644 --- a/docs/framework/angular/reference/type-aliases/MutationFunction.md +++ b/docs/framework/angular/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:724 +Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/MutationFunctionContext.md b/docs/framework/angular/reference/type-aliases/MutationFunctionContext.md index f5a39e5e547..97de2f1c220 100644 --- a/docs/framework/angular/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/angular/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:719 +Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) ## Properties @@ -17,7 +17,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:719 client: QueryClient; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:720 +Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1180) *** @@ -27,7 +27,7 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:720 meta: MutationMeta | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:721 +Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) *** @@ -37,4 +37,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:721 optional mutationKey: MutationKey; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:722 +Defined in: [packages/query-core/src/types.ts:1182](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1182) diff --git a/docs/framework/angular/reference/type-aliases/MutationKey.md b/docs/framework/angular/reference/type-aliases/MutationKey.md index 6df59e8b0ac..8e9d3bc3b3a 100644 --- a/docs/framework/angular/reference/type-aliases/MutationKey.md +++ b/docs/framework/angular/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:709 +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) diff --git a/docs/framework/angular/reference/type-aliases/MutationMeta.md b/docs/framework/angular/reference/type-aliases/MutationMeta.md index 0dcd9a48865..474c593e206 100644 --- a/docs/framework/angular/reference/type-aliases/MutationMeta.md +++ b/docs/framework/angular/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:716 +Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) diff --git a/docs/framework/angular/reference/type-aliases/MutationObserverResult.md b/docs/framework/angular/reference/type-aliases/MutationObserverResult.md index 4edbb46566d..21e43836bf6 100644 --- a/docs/framework/angular/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/angular/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:856 +Defined in: [packages/query-core/src/types.ts:1464](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1464) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/MutationScope.md b/docs/framework/angular/reference/type-aliases/MutationScope.md index 6f9c7619c08..feac9d9d17a 100644 --- a/docs/framework/angular/reference/type-aliases/MutationScope.md +++ b/docs/framework/angular/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:713 +Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1167) ## Properties @@ -17,4 +17,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:713 id: string; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:714 +Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) diff --git a/docs/framework/angular/reference/type-aliases/MutationStatus.md b/docs/framework/angular/reference/type-aliases/MutationStatus.md index 79b6078e8b6..4cd2d3c9535 100644 --- a/docs/framework/angular/reference/type-aliases/MutationStatus.md +++ b/docs/framework/angular/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:712 +Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) diff --git a/docs/framework/angular/reference/type-aliases/NetworkMode.md b/docs/framework/angular/reference/type-aliases/NetworkMode.md index bf1d4beb5b2..94ae0ba76ed 100644 --- a/docs/framework/angular/reference/type-aliases/NetworkMode.md +++ b/docs/framework/angular/reference/type-aliases/NetworkMode.md @@ -7,4 +7,4 @@ title: NetworkMode type NetworkMode = "online" | "always" | "offlineFirst"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:84 +Defined in: [packages/query-core/src/types.ts:223](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L223) diff --git a/docs/framework/angular/reference/type-aliases/NonUndefinedGuard.md b/docs/framework/angular/reference/type-aliases/NonUndefinedGuard.md index 2b3d791fe6b..4aaf208013b 100644 --- a/docs/framework/angular/reference/type-aliases/NonUndefinedGuard.md +++ b/docs/framework/angular/reference/type-aliases/NonUndefinedGuard.md @@ -7,7 +7,7 @@ title: NonUndefinedGuard type NonUndefinedGuard = T extends undefined ? never : T; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:9 +Defined in: [packages/query-core/src/types.ts:12](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L12) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/NotifyEventType.md b/docs/framework/angular/reference/type-aliases/NotifyEventType.md index 170b153e290..9bbc85e4ce8 100644 --- a/docs/framework/angular/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/angular/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:885 +Defined in: [packages/query-core/src/types.ts:1510](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1510) diff --git a/docs/framework/angular/reference/type-aliases/NotifyOnChangeProps.md b/docs/framework/angular/reference/type-aliases/NotifyOnChangeProps.md index df9661cae57..7de194fa10b 100644 --- a/docs/framework/angular/reference/type-aliases/NotifyOnChangeProps.md +++ b/docs/framework/angular/reference/type-aliases/NotifyOnChangeProps.md @@ -14,4 +14,4 @@ type NotifyOnChangeProps = | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:85 +Defined in: [packages/query-core/src/types.ts:225](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L225) diff --git a/docs/framework/angular/reference/type-aliases/OmitKeyof.md b/docs/framework/angular/reference/type-aliases/OmitKeyof.md index 111b9a8793e..690a7b0a5d2 100644 --- a/docs/framework/angular/reference/type-aliases/OmitKeyof.md +++ b/docs/framework/angular/reference/type-aliases/OmitKeyof.md @@ -7,7 +7,7 @@ title: OmitKeyof type OmitKeyof = Omit; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:11 +Defined in: [packages/query-core/src/types.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L19) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/Override.md b/docs/framework/angular/reference/type-aliases/Override.md index ae9348d04df..8abcecd1e1b 100644 --- a/docs/framework/angular/reference/type-aliases/Override.md +++ b/docs/framework/angular/reference/type-aliases/Override.md @@ -7,7 +7,7 @@ title: Override type Override = { [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey] }; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:12 +Defined in: [packages/query-core/src/types.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L31) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/PlaceholderDataFunction.md b/docs/framework/angular/reference/type-aliases/PlaceholderDataFunction.md index 4565cc4bb51..cd40f28b41e 100644 --- a/docs/framework/angular/reference/type-aliases/PlaceholderDataFunction.md +++ b/docs/framework/angular/reference/type-aliases/PlaceholderDataFunction.md @@ -7,7 +7,7 @@ title: PlaceholderDataFunction type PlaceholderDataFunction = (previousData, previousQuery) => TQueryData | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:72 +Defined in: [packages/query-core/src/types.ts:177](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L177) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/QueriesPlaceholderDataFunction.md b/docs/framework/angular/reference/type-aliases/QueriesPlaceholderDataFunction.md index ef02e6aea3b..5d3fca8c9e0 100644 --- a/docs/framework/angular/reference/type-aliases/QueriesPlaceholderDataFunction.md +++ b/docs/framework/angular/reference/type-aliases/QueriesPlaceholderDataFunction.md @@ -7,7 +7,7 @@ title: QueriesPlaceholderDataFunction type QueriesPlaceholderDataFunction = (previousData, previousQuery) => TQueryData | undefined; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:73 +Defined in: [packages/query-core/src/types.ts:187](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L187) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/QueryBooleanOption.md b/docs/framework/angular/reference/type-aliases/QueryBooleanOption.md index ac3db8265dd..9759e3ddb42 100644 --- a/docs/framework/angular/reference/type-aliases/QueryBooleanOption.md +++ b/docs/framework/angular/reference/type-aliases/QueryBooleanOption.md @@ -7,7 +7,7 @@ title: QueryBooleanOption type QueryBooleanOption = boolean | (query) => boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:45 +Defined in: [packages/query-core/src/types.ts:119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L119) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/QueryCacheNotifyEvent.md b/docs/framework/angular/reference/type-aliases/QueryCacheNotifyEvent.md index d6485450a3d..b92c76fb826 100644 --- a/docs/framework/angular/reference/type-aliases/QueryCacheNotifyEvent.md +++ b/docs/framework/angular/reference/type-aliases/QueryCacheNotifyEvent.md @@ -14,7 +14,7 @@ type QueryCacheNotifyEvent = | NotifyEventQueryObserverOptionsUpdated; ``` -Defined in: packages/query-core/dist-ts/src/queryCache.d.ts:59 +Defined in: [packages/query-core/src/queryCache.ts:85](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L85) The event passed to a `QueryCache` subscriber. Fired whenever a query is added or removed from the cache, its state is updated (e.g. via `query.setState` or `queryClient.removeQueries`), or diff --git a/docs/framework/angular/reference/type-aliases/QueryFunction.md b/docs/framework/angular/reference/type-aliases/QueryFunction.md index 19002dc23ef..306367388a1 100644 --- a/docs/framework/angular/reference/type-aliases/QueryFunction.md +++ b/docs/framework/angular/reference/type-aliases/QueryFunction.md @@ -7,7 +7,7 @@ title: QueryFunction type QueryFunction = (context) => T | Promise; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:42 +Defined in: [packages/query-core/src/types.ts:102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L102) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/QueryFunctionContext.md b/docs/framework/angular/reference/type-aliases/QueryFunctionContext.md index 827204a9f79..d2c9fe3e2b2 100644 --- a/docs/framework/angular/reference/type-aliases/QueryFunctionContext.md +++ b/docs/framework/angular/reference/type-aliases/QueryFunctionContext.md @@ -7,7 +7,7 @@ title: QueryFunctionContext type QueryFunctionContext = [TPageParam] extends [never] ? object : object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:47 +Defined in: [packages/query-core/src/types.ts:144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L144) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/QueryKey.md b/docs/framework/angular/reference/type-aliases/QueryKey.md index 029efdb5756..1a3f34cde18 100644 --- a/docs/framework/angular/reference/type-aliases/QueryKey.md +++ b/docs/framework/angular/reference/type-aliases/QueryKey.md @@ -7,4 +7,4 @@ title: QueryKey type QueryKey = Register extends object ? TQueryKey extends ReadonlyArray ? TQueryKey : TQueryKey extends unknown[] ? TQueryKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:20 +Defined in: [packages/query-core/src/types.ts:51](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L51) diff --git a/docs/framework/angular/reference/type-aliases/QueryKeyHashFunction.md b/docs/framework/angular/reference/type-aliases/QueryKeyHashFunction.md index a72fc668ede..feda96373cc 100644 --- a/docs/framework/angular/reference/type-aliases/QueryKeyHashFunction.md +++ b/docs/framework/angular/reference/type-aliases/QueryKeyHashFunction.md @@ -7,7 +7,7 @@ title: QueryKeyHashFunction type QueryKeyHashFunction = (queryKey) => string; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:74 +Defined in: [packages/query-core/src/types.ts:192](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L192) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/QueryKeyWithDataTag.md b/docs/framework/angular/reference/type-aliases/QueryKeyWithDataTag.md index 8d165d440ee..6613f74be9e 100644 --- a/docs/framework/angular/reference/type-aliases/QueryKeyWithDataTag.md +++ b/docs/framework/angular/reference/type-aliases/QueryKeyWithDataTag.md @@ -7,7 +7,7 @@ title: QueryKeyWithDataTag type QueryKeyWithDataTag = object; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:37 +Defined in: [packages/query-core/src/types.ts:82](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L82) ## Type Parameters @@ -31,4 +31,4 @@ Defined in: packages/query-core/dist-ts/src/types.d.ts:37 queryKey: DataTag; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:38 +Defined in: [packages/query-core/src/types.ts:87](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L87) diff --git a/docs/framework/angular/reference/type-aliases/QueryMeta.md b/docs/framework/angular/reference/type-aliases/QueryMeta.md index bc344eb6a6b..c12917b2cce 100644 --- a/docs/framework/angular/reference/type-aliases/QueryMeta.md +++ b/docs/framework/angular/reference/type-aliases/QueryMeta.md @@ -7,4 +7,4 @@ title: QueryMeta type QueryMeta = Register extends object ? TQueryMeta extends Record ? TQueryMeta : Record : Record; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:81 +Defined in: [packages/query-core/src/types.ts:215](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L215) diff --git a/docs/framework/angular/reference/type-aliases/QueryObserverResult.md b/docs/framework/angular/reference/type-aliases/QueryObserverResult.md index 091c81e5d36..4fc661a6c9d 100644 --- a/docs/framework/angular/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/angular/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:591 +Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/QueryPersister.md b/docs/framework/angular/reference/type-aliases/QueryPersister.md index ae2aac53628..72e80165b0d 100644 --- a/docs/framework/angular/reference/type-aliases/QueryPersister.md +++ b/docs/framework/angular/reference/type-aliases/QueryPersister.md @@ -7,7 +7,7 @@ title: QueryPersister type QueryPersister = [TPageParam] extends [never] ? (queryFn, context, query) => T | Promise : (queryFn, context, query) => T | Promise; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:46 +Defined in: [packages/query-core/src/types.ts:128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L128) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/QueryStatus.md b/docs/framework/angular/reference/type-aliases/QueryStatus.md index b8208b1b575..6679b8b17c6 100644 --- a/docs/framework/angular/reference/type-aliases/QueryStatus.md +++ b/docs/framework/angular/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:395 +Defined in: [packages/query-core/src/types.ts:751](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L751) diff --git a/docs/framework/angular/reference/type-aliases/SkipToken.md b/docs/framework/angular/reference/type-aliases/SkipToken.md index 1844f3508c9..3a5791b982e 100644 --- a/docs/framework/angular/reference/type-aliases/SkipToken.md +++ b/docs/framework/angular/reference/type-aliases/SkipToken.md @@ -7,6 +7,6 @@ title: SkipToken type SkipToken = typeof skipToken; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:184 +Defined in: [packages/query-core/src/utils.ts:526](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L526) The type of the [skipToken](../variables/skipToken.md) sentinel value. diff --git a/docs/framework/angular/reference/type-aliases/StaleTime.md b/docs/framework/angular/reference/type-aliases/StaleTime.md index c67335d2b64..3e7e21608be 100644 --- a/docs/framework/angular/reference/type-aliases/StaleTime.md +++ b/docs/framework/angular/reference/type-aliases/StaleTime.md @@ -7,4 +7,4 @@ title: StaleTime type StaleTime = number | "static"; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:43 +Defined in: [packages/query-core/src/types.ts:108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L108) diff --git a/docs/framework/angular/reference/type-aliases/StaleTimeFunction.md b/docs/framework/angular/reference/type-aliases/StaleTimeFunction.md index 92275e24061..b1c541fa64e 100644 --- a/docs/framework/angular/reference/type-aliases/StaleTimeFunction.md +++ b/docs/framework/angular/reference/type-aliases/StaleTimeFunction.md @@ -7,7 +7,7 @@ title: StaleTimeFunction type StaleTimeFunction = StaleTime | (query) => StaleTime; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:44 +Defined in: [packages/query-core/src/types.ts:110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L110) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/ThrowOnError.md b/docs/framework/angular/reference/type-aliases/ThrowOnError.md index 438480ec438..613549e4d52 100644 --- a/docs/framework/angular/reference/type-aliases/ThrowOnError.md +++ b/docs/framework/angular/reference/type-aliases/ThrowOnError.md @@ -7,7 +7,7 @@ title: ThrowOnError type ThrowOnError = boolean | (error, query) => boolean; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:202 +Defined in: [packages/query-core/src/types.ts:363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L363) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/TimeoutCallback.md b/docs/framework/angular/reference/type-aliases/TimeoutCallback.md index 926ce927d09..773b5fdaeb9 100644 --- a/docs/framework/angular/reference/type-aliases/TimeoutCallback.md +++ b/docs/framework/angular/reference/type-aliases/TimeoutCallback.md @@ -7,7 +7,7 @@ title: TimeoutCallback type TimeoutCallback = (_) => void; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:9 +Defined in: [packages/query-core/src/timeoutManager.ts:9](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L9) [TimeoutManager](../interfaces/TimeoutManager.md) does not support passing arguments to the callback. diff --git a/docs/framework/angular/reference/type-aliases/TimeoutProvider.md b/docs/framework/angular/reference/type-aliases/TimeoutProvider.md index 24ad323cb2c..3509105bcd1 100644 --- a/docs/framework/angular/reference/type-aliases/TimeoutProvider.md +++ b/docs/framework/angular/reference/type-aliases/TimeoutProvider.md @@ -7,7 +7,7 @@ title: TimeoutProvider type TimeoutProvider = object; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:28 +Defined in: [packages/query-core/src/timeoutManager.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L28) Backend for timer functions. @@ -31,7 +31,7 @@ also support delays longer than the ~24-day maximum of the global `setTimeout`. readonly clearInterval: (intervalId) => void; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:32 +Defined in: [packages/query-core/src/timeoutManager.ts:34](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L34) #### Parameters @@ -51,7 +51,7 @@ Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:32 readonly clearTimeout: (timeoutId) => void; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:30 +Defined in: [packages/query-core/src/timeoutManager.ts:31](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L31) #### Parameters @@ -71,7 +71,7 @@ Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:30 readonly setInterval: (callback, delay) => TTimerId; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:31 +Defined in: [packages/query-core/src/timeoutManager.ts:33](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L33) #### Parameters @@ -95,7 +95,7 @@ Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:31 readonly setTimeout: (callback, delay) => TTimerId; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:29 +Defined in: [packages/query-core/src/timeoutManager.ts:30](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L30) #### Parameters diff --git a/docs/framework/angular/reference/type-aliases/UnsetMarker.md b/docs/framework/angular/reference/type-aliases/UnsetMarker.md index 43e02873465..8b9c14e1907 100644 --- a/docs/framework/angular/reference/type-aliases/UnsetMarker.md +++ b/docs/framework/angular/reference/type-aliases/UnsetMarker.md @@ -7,4 +7,4 @@ title: UnsetMarker type UnsetMarker = typeof unsetMarker; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:28 +Defined in: [packages/query-core/src/types.ts:66](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L66) diff --git a/docs/framework/angular/reference/type-aliases/Updater.md b/docs/framework/angular/reference/type-aliases/Updater.md index eb2c7ee2f91..7a0c2f30503 100644 --- a/docs/framework/angular/reference/type-aliases/Updater.md +++ b/docs/framework/angular/reference/type-aliases/Updater.md @@ -7,7 +7,7 @@ title: Updater type Updater = TOutput | (input) => TOutput; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:76 +Defined in: [packages/query-core/src/utils.ts:105](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L105) Either a plain value of type `TOutput`, or a function that receives `TInput` and returns `TOutput`. Used for example by `setQueryData`-style updaters, which accept either the new data directly or a diff --git a/docs/framework/angular/reference/type-aliases/WithRequired.md b/docs/framework/angular/reference/type-aliases/WithRequired.md index 74ffe926792..deb87dfe4a4 100644 --- a/docs/framework/angular/reference/type-aliases/WithRequired.md +++ b/docs/framework/angular/reference/type-aliases/WithRequired.md @@ -7,7 +7,7 @@ title: WithRequired type WithRequired = TTarget & { [_ in TKey]: {} }; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:296 +Defined in: [packages/query-core/src/types.ts:516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L516) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/dataTagErrorSymbol.md b/docs/framework/angular/reference/type-aliases/dataTagErrorSymbol.md index c1c29257408..26148a94d6e 100644 --- a/docs/framework/angular/reference/type-aliases/dataTagErrorSymbol.md +++ b/docs/framework/angular/reference/type-aliases/dataTagErrorSymbol.md @@ -7,4 +7,4 @@ title: dataTagErrorSymbol type dataTagErrorSymbol = typeof dataTagErrorSymbol; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:25 +Defined in: [packages/query-core/src/types.ts:63](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L63) diff --git a/docs/framework/angular/reference/type-aliases/dataTagSymbol.md b/docs/framework/angular/reference/type-aliases/dataTagSymbol.md index 0935b5bd1a6..0012c108cc5 100644 --- a/docs/framework/angular/reference/type-aliases/dataTagSymbol.md +++ b/docs/framework/angular/reference/type-aliases/dataTagSymbol.md @@ -7,4 +7,4 @@ title: dataTagSymbol type dataTagSymbol = typeof dataTagSymbol; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:23 +Defined in: [packages/query-core/src/types.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L61) diff --git a/docs/framework/angular/reference/variables/dataTagErrorSymbol.md b/docs/framework/angular/reference/variables/dataTagErrorSymbol.md index 73f8a605c98..20bab62fb01 100644 --- a/docs/framework/angular/reference/variables/dataTagErrorSymbol.md +++ b/docs/framework/angular/reference/variables/dataTagErrorSymbol.md @@ -4,7 +4,7 @@ title: dataTagErrorSymbol --- ```ts -const dataTagErrorSymbol: unique symbol; +const dataTagErrorSymbol: typeof dataTagErrorSymbol; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:25 +Defined in: [packages/query-core/src/types.ts:63](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L63) diff --git a/docs/framework/angular/reference/variables/dataTagSymbol.md b/docs/framework/angular/reference/variables/dataTagSymbol.md index 14cbc63ec9b..83dd68a56e9 100644 --- a/docs/framework/angular/reference/variables/dataTagSymbol.md +++ b/docs/framework/angular/reference/variables/dataTagSymbol.md @@ -4,7 +4,7 @@ title: dataTagSymbol --- ```ts -const dataTagSymbol: unique symbol; +const dataTagSymbol: typeof dataTagSymbol; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:23 +Defined in: [packages/query-core/src/types.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L61) diff --git a/docs/framework/angular/reference/variables/defaultScheduler.md b/docs/framework/angular/reference/variables/defaultScheduler.md index 260ac9572c2..70e14d3f846 100644 --- a/docs/framework/angular/reference/variables/defaultScheduler.md +++ b/docs/framework/angular/reference/variables/defaultScheduler.md @@ -4,10 +4,10 @@ title: defaultScheduler --- ```ts -const defaultScheduler: ScheduleFunction; +const defaultScheduler: ScheduleFunction = systemSetTimeoutZero; ``` -Defined in: packages/query-core/dist-ts/src/notifyManager.d.ts:10 +Defined in: [packages/query-core/src/notifyManager.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L19) Default scheduling function used by the notify manager. Schedules the callback with the system's `setTimeout(callback, 0)`. diff --git a/docs/framework/angular/reference/variables/environmentManager.md b/docs/framework/angular/reference/variables/environmentManager.md index e2975e30dec..e207cfd2484 100644 --- a/docs/framework/angular/reference/variables/environmentManager.md +++ b/docs/framework/angular/reference/variables/environmentManager.md @@ -7,7 +7,7 @@ title: environmentManager const environmentManager: object; ``` -Defined in: packages/query-core/dist-ts/src/environmentManager.d.ts:23 +Defined in: [packages/query-core/src/environmentManager.ts:29](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L29) Manages how TanStack Query detects whether the current runtime should be treated as server-side. By default, this uses the same detection as the exported `isServer` utility. @@ -17,12 +17,18 @@ extension workers), where the default detection would give the wrong answer. ## Type Declaration -### isServer +### isServer() ```ts -isServer: typeof isServer; +isServer: () => boolean; ``` +Returns whether the current runtime should be treated as a server environment. + +#### Returns + +`boolean` + ### setIsServer() ```ts diff --git a/docs/framework/angular/reference/variables/focusManager.md b/docs/framework/angular/reference/variables/focusManager.md index 88f85eea879..86477849e06 100644 --- a/docs/framework/angular/reference/variables/focusManager.md +++ b/docs/framework/angular/reference/variables/focusManager.md @@ -7,6 +7,6 @@ title: focusManager const focusManager: FocusManager; ``` -Defined in: packages/query-core/dist-ts/src/focusManager.d.ts:71 +Defined in: [packages/query-core/src/focusManager.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L142) Singleton instance of [FocusManager](../interfaces/FocusManager.md), used to manage and observe the focus state within TanStack Query. diff --git a/docs/framework/angular/reference/variables/isServer.md b/docs/framework/angular/reference/variables/isServer.md index ad725a61580..16aa39d1244 100644 --- a/docs/framework/angular/reference/variables/isServer.md +++ b/docs/framework/angular/reference/variables/isServer.md @@ -7,7 +7,7 @@ title: isServer const isServer: boolean; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:81 +Defined in: [packages/query-core/src/utils.ts:114](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L114) ## Deprecated diff --git a/docs/framework/angular/reference/variables/notifyManager.md b/docs/framework/angular/reference/variables/notifyManager.md index 862acf71bd9..4bdf3478be0 100644 --- a/docs/framework/angular/reference/variables/notifyManager.md +++ b/docs/framework/angular/reference/variables/notifyManager.md @@ -7,7 +7,7 @@ title: notifyManager const notifyManager: object; ``` -Defined in: packages/query-core/dist-ts/src/notifyManager.d.ts:70 +Defined in: [packages/query-core/src/notifyManager.ts:144](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L144) Handles scheduling and batching callbacks in TanStack Query. @@ -67,7 +67,7 @@ All calls to the wrapped function will be batched. ### schedule() ```ts -readonly schedule: (callback) => void; +schedule: (callback) => void; ``` Schedules a function to be run on the next batch. diff --git a/docs/framework/angular/reference/variables/onlineManager.md b/docs/framework/angular/reference/variables/onlineManager.md index c62e2a55362..2eeec5385d8 100644 --- a/docs/framework/angular/reference/variables/onlineManager.md +++ b/docs/framework/angular/reference/variables/onlineManager.md @@ -7,6 +7,6 @@ title: onlineManager const onlineManager: OnlineManager; ``` -Defined in: packages/query-core/dist-ts/src/onlineManager.d.ts:60 +Defined in: [packages/query-core/src/onlineManager.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L117) Singleton instance of [OnlineManager](../interfaces/OnlineManager.md), used to manage and observe the online state within TanStack Query. diff --git a/docs/framework/angular/reference/variables/skipToken.md b/docs/framework/angular/reference/variables/skipToken.md index 8c964c7d8e6..a390d0b7b66 100644 --- a/docs/framework/angular/reference/variables/skipToken.md +++ b/docs/framework/angular/reference/variables/skipToken.md @@ -4,10 +4,10 @@ title: skipToken --- ```ts -const skipToken: unique symbol; +const skipToken: typeof skipToken; ``` -Defined in: packages/query-core/dist-ts/src/utils.d.ts:180 +Defined in: [packages/query-core/src/utils.ts:522](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L522) Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`, diff --git a/docs/framework/angular/reference/variables/timeoutManager.md b/docs/framework/angular/reference/variables/timeoutManager.md index f99ede3311a..1eca1a5f343 100644 --- a/docs/framework/angular/reference/variables/timeoutManager.md +++ b/docs/framework/angular/reference/variables/timeoutManager.md @@ -7,6 +7,6 @@ title: timeoutManager const timeoutManager: TimeoutManager; ``` -Defined in: packages/query-core/dist-ts/src/timeoutManager.d.ts:153 +Defined in: [packages/query-core/src/timeoutManager.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L232) Singleton instance of [TimeoutManager](../interfaces/TimeoutManager.md), used throughout TanStack Query to schedule and cancel timers. diff --git a/docs/framework/angular/reference/variables/unsetMarker.md b/docs/framework/angular/reference/variables/unsetMarker.md index 1a34fc7d2e0..d19ee65b38e 100644 --- a/docs/framework/angular/reference/variables/unsetMarker.md +++ b/docs/framework/angular/reference/variables/unsetMarker.md @@ -4,7 +4,7 @@ title: unsetMarker --- ```ts -const unsetMarker: unique symbol; +const unsetMarker: typeof unsetMarker; ``` -Defined in: packages/query-core/dist-ts/src/types.d.ts:27 +Defined in: [packages/query-core/src/types.ts:65](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L65) diff --git a/packages/query-devtools/tsconfig.json b/packages/query-devtools/tsconfig.json index 7f3c629b174..126986ae135 100644 --- a/packages/query-devtools/tsconfig.json +++ b/packages/query-devtools/tsconfig.json @@ -12,6 +12,5 @@ "*.config.ts", "*.config.js", "package.json" - ], - "references": [{ "path": "../query-core" }] + ] } From 3ffe314281cdd31e424325809827ec1c6485fca5 Mon Sep 17 00:00:00 2001 From: Wonsuk Choi Date: Mon, 7 Sep 2026 05:19:20 +0900 Subject: [PATCH 8/9] docs(query-core): document missing default values and normalize 'Defaults to' spacing --- .../reference/interfaces/CancelOptions.md | 6 +- .../interfaces/CreateBaseQueryOptions.md | 62 +++++++++------- .../interfaces/CreateInfiniteQueryOptions.md | 66 +++++++++-------- .../interfaces/CreateMutationOptions.md | 35 ++++++---- .../interfaces/CreateQueryOptions.md | 60 +++++++++------- .../reference/interfaces/DefaultOptions.md | 10 +-- .../interfaces/EnsureQueryDataOptions.md | 39 ++++++----- .../interfaces/FetchNextPageOptions.md | 7 +- .../interfaces/FetchPreviousPageOptions.md | 7 +- .../reference/interfaces/FetchQueryOptions.md | 37 +++++----- .../InfiniteQueryObserverBaseResult.md | 68 +++++++++--------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 +++++++++--------- .../InfiniteQueryObserverLoadingResult.md | 68 +++++++++--------- .../InfiniteQueryObserverOptions.md | 70 +++++++++++-------- .../InfiniteQueryObserverPendingResult.md | 68 +++++++++--------- .../InfiniteQueryObserverPlaceholderResult.md | 68 +++++++++--------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 +++++++++--------- .../InfiniteQueryObserverSuccessResult.md | 68 +++++++++--------- .../InfiniteQueryPageParamsOptions.md | 8 +-- .../reference/interfaces/InitialPageParam.md | 4 +- .../reference/interfaces/InvalidateOptions.md | 7 +- .../interfaces/InvalidateQueryFilters.md | 5 +- .../reference/interfaces/MutateOptions.md | 8 +-- .../interfaces/MutationObserverBaseResult.md | 22 +++--- .../interfaces/MutationObserverErrorResult.md | 22 +++--- .../interfaces/MutationObserverIdleResult.md | 22 +++--- .../MutationObserverLoadingResult.md | 22 +++--- .../interfaces/MutationObserverOptions.md | 37 ++++++---- .../MutationObserverSuccessResult.md | 22 +++--- .../reference/interfaces/MutationOptions.md | 28 ++++---- .../reference/interfaces/NotifyEvent.md | 4 +- .../reference/interfaces/QueryClientConfig.md | 8 +-- .../interfaces/QueryExecuteOptions.md | 39 ++++++----- .../interfaces/QueryObserverBaseResult.md | 52 +++++++------- .../QueryObserverLoadingErrorResult.md | 52 +++++++------- .../interfaces/QueryObserverLoadingResult.md | 52 +++++++------- .../interfaces/QueryObserverOptions.md | 64 +++++++++-------- .../interfaces/QueryObserverPendingResult.md | 52 +++++++------- .../QueryObserverPlaceholderResult.md | 52 +++++++------- .../QueryObserverRefetchErrorResult.md | 52 +++++++------- .../interfaces/QueryObserverSuccessResult.md | 52 +++++++------- .../reference/interfaces/QueryOptions.md | 31 ++++---- .../reference/interfaces/RefetchOptions.md | 7 +- .../interfaces/RefetchQueryFilters.md | 2 +- .../reference/interfaces/ResetOptions.md | 7 +- .../reference/interfaces/ResultOptions.md | 5 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../DefaultedInfiniteQueryObserverOptions.md | 2 +- .../DefaultedQueryObserverOptions.md | 2 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../EnsureInfiniteQueryDataOptions.md | 2 +- .../type-aliases/FetchInfiniteQueryOptions.md | 2 +- .../reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryExecuteOptions.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +-- .../reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/ThrowOnError.md | 2 +- .../reference/type-aliases/WithRequired.md | 2 +- .../lit/reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 10 +-- .../interfaces/EnsureQueryDataOptions.md | 39 ++++++----- .../interfaces/FetchNextPageOptions.md | 7 +- .../interfaces/FetchPreviousPageOptions.md | 7 +- .../reference/interfaces/FetchQueryOptions.md | 37 +++++----- .../InfiniteQueryObserverBaseResult.md | 68 +++++++++--------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 +++++++++--------- .../InfiniteQueryObserverLoadingResult.md | 68 +++++++++--------- .../InfiniteQueryObserverOptions.md | 70 +++++++++++-------- .../InfiniteQueryObserverPendingResult.md | 68 +++++++++--------- .../InfiniteQueryObserverPlaceholderResult.md | 68 +++++++++--------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 +++++++++--------- .../InfiniteQueryObserverSuccessResult.md | 68 +++++++++--------- .../InfiniteQueryPageParamsOptions.md | 8 +-- .../reference/interfaces/InitialPageParam.md | 4 +- .../reference/interfaces/InvalidateOptions.md | 7 +- .../interfaces/InvalidateQueryFilters.md | 5 +- .../lit/reference/interfaces/MutateOptions.md | 8 +-- .../interfaces/MutationObserverBaseResult.md | 22 +++--- .../interfaces/MutationObserverErrorResult.md | 22 +++--- .../interfaces/MutationObserverIdleResult.md | 22 +++--- .../MutationObserverLoadingResult.md | 22 +++--- .../interfaces/MutationObserverOptions.md | 37 ++++++---- .../MutationObserverSuccessResult.md | 22 +++--- .../reference/interfaces/MutationOptions.md | 28 ++++---- .../lit/reference/interfaces/NotifyEvent.md | 4 +- .../reference/interfaces/QueryClientConfig.md | 8 +-- .../interfaces/QueryExecuteOptions.md | 39 ++++++----- .../interfaces/QueryObserverBaseResult.md | 52 +++++++------- .../QueryObserverLoadingErrorResult.md | 52 +++++++------- .../interfaces/QueryObserverLoadingResult.md | 52 +++++++------- .../interfaces/QueryObserverOptions.md | 64 +++++++++-------- .../interfaces/QueryObserverPendingResult.md | 52 +++++++------- .../QueryObserverPlaceholderResult.md | 52 +++++++------- .../QueryObserverRefetchErrorResult.md | 52 +++++++------- .../interfaces/QueryObserverSuccessResult.md | 52 +++++++------- .../lit/reference/interfaces/QueryOptions.md | 31 ++++---- .../reference/interfaces/RefetchOptions.md | 7 +- .../interfaces/RefetchQueryFilters.md | 2 +- .../lit/reference/interfaces/ResetOptions.md | 7 +- .../lit/reference/interfaces/ResultOptions.md | 5 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../DefaultedInfiniteQueryObserverOptions.md | 2 +- .../DefaultedQueryObserverOptions.md | 2 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../EnsureInfiniteQueryDataOptions.md | 2 +- .../type-aliases/FetchInfiniteQueryOptions.md | 2 +- .../lit/reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryExecuteOptions.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +-- .../lit/reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../lit/reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/ThrowOnError.md | 2 +- .../reference/type-aliases/WithRequired.md | 2 +- .../reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 10 +-- .../interfaces/EnsureQueryDataOptions.md | 39 ++++++----- .../interfaces/FetchNextPageOptions.md | 7 +- .../interfaces/FetchPreviousPageOptions.md | 7 +- .../reference/interfaces/FetchQueryOptions.md | 37 +++++----- .../InfiniteQueryObserverBaseResult.md | 68 +++++++++--------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 +++++++++--------- .../InfiniteQueryObserverLoadingResult.md | 68 +++++++++--------- .../InfiniteQueryObserverOptions.md | 70 +++++++++++-------- .../InfiniteQueryObserverPendingResult.md | 68 +++++++++--------- .../InfiniteQueryObserverPlaceholderResult.md | 68 +++++++++--------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 +++++++++--------- .../InfiniteQueryObserverSuccessResult.md | 68 +++++++++--------- .../InfiniteQueryPageParamsOptions.md | 8 +-- .../reference/interfaces/InitialPageParam.md | 4 +- .../reference/interfaces/InvalidateOptions.md | 7 +- .../interfaces/InvalidateQueryFilters.md | 5 +- .../reference/interfaces/MutateOptions.md | 8 +-- .../interfaces/MutationObserverBaseResult.md | 22 +++--- .../interfaces/MutationObserverErrorResult.md | 22 +++--- .../interfaces/MutationObserverIdleResult.md | 22 +++--- .../MutationObserverLoadingResult.md | 22 +++--- .../interfaces/MutationObserverOptions.md | 37 ++++++---- .../MutationObserverSuccessResult.md | 22 +++--- .../reference/interfaces/MutationOptions.md | 28 ++++---- .../reference/interfaces/NotifyEvent.md | 4 +- .../reference/interfaces/QueryClientConfig.md | 8 +-- .../interfaces/QueryExecuteOptions.md | 39 ++++++----- .../interfaces/QueryObserverBaseResult.md | 52 +++++++------- .../QueryObserverLoadingErrorResult.md | 52 +++++++------- .../interfaces/QueryObserverLoadingResult.md | 52 +++++++------- .../interfaces/QueryObserverOptions.md | 64 +++++++++-------- .../interfaces/QueryObserverPendingResult.md | 52 +++++++------- .../QueryObserverPlaceholderResult.md | 52 +++++++------- .../QueryObserverRefetchErrorResult.md | 52 +++++++------- .../interfaces/QueryObserverSuccessResult.md | 52 +++++++------- .../reference/interfaces/QueryOptions.md | 31 ++++---- .../reference/interfaces/RefetchOptions.md | 7 +- .../interfaces/RefetchQueryFilters.md | 2 +- .../reference/interfaces/ResetOptions.md | 7 +- .../reference/interfaces/ResultOptions.md | 5 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../interfaces/UseBaseQueryOptions.md | 62 +++++++++------- .../interfaces/UseInfiniteQueryOptions.md | 66 +++++++++-------- .../interfaces/UseMutationOptions.md | 35 ++++++---- .../reference/interfaces/UseQueryOptions.md | 60 +++++++++------- .../UseSuspenseInfiniteQueryOptions.md | 58 ++++++++------- .../interfaces/UseSuspenseQueryOptions.md | 52 ++++++++------ .../DefaultedInfiniteQueryObserverOptions.md | 2 +- .../DefaultedQueryObserverOptions.md | 2 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../EnsureInfiniteQueryDataOptions.md | 2 +- .../type-aliases/FetchInfiniteQueryOptions.md | 2 +- .../reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryExecuteOptions.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +-- .../reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/ThrowOnError.md | 2 +- .../reference/type-aliases/WithRequired.md | 2 +- .../reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 10 +-- .../interfaces/EnsureQueryDataOptions.md | 39 ++++++----- .../interfaces/FetchNextPageOptions.md | 7 +- .../interfaces/FetchPreviousPageOptions.md | 7 +- .../reference/interfaces/FetchQueryOptions.md | 37 +++++----- .../InfiniteQueryObserverBaseResult.md | 68 +++++++++--------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 +++++++++--------- .../InfiniteQueryObserverLoadingResult.md | 68 +++++++++--------- .../InfiniteQueryObserverOptions.md | 70 +++++++++++-------- .../InfiniteQueryObserverPendingResult.md | 68 +++++++++--------- .../InfiniteQueryObserverPlaceholderResult.md | 68 +++++++++--------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 +++++++++--------- .../InfiniteQueryObserverSuccessResult.md | 68 +++++++++--------- .../InfiniteQueryPageParamsOptions.md | 8 +-- .../reference/interfaces/InitialPageParam.md | 4 +- .../reference/interfaces/InvalidateOptions.md | 7 +- .../interfaces/InvalidateQueryFilters.md | 5 +- .../reference/interfaces/MutateOptions.md | 8 +-- .../interfaces/MutationObserverBaseResult.md | 22 +++--- .../interfaces/MutationObserverErrorResult.md | 22 +++--- .../interfaces/MutationObserverIdleResult.md | 22 +++--- .../MutationObserverLoadingResult.md | 22 +++--- .../interfaces/MutationObserverOptions.md | 37 ++++++---- .../MutationObserverSuccessResult.md | 22 +++--- .../reference/interfaces/MutationOptions.md | 28 ++++---- .../react/reference/interfaces/NotifyEvent.md | 4 +- .../reference/interfaces/QueryClientConfig.md | 8 +-- .../interfaces/QueryExecuteOptions.md | 39 ++++++----- .../interfaces/QueryObserverBaseResult.md | 52 +++++++------- .../QueryObserverLoadingErrorResult.md | 52 +++++++------- .../interfaces/QueryObserverLoadingResult.md | 52 +++++++------- .../interfaces/QueryObserverOptions.md | 64 +++++++++-------- .../interfaces/QueryObserverPendingResult.md | 52 +++++++------- .../QueryObserverPlaceholderResult.md | 52 +++++++------- .../QueryObserverRefetchErrorResult.md | 52 +++++++------- .../interfaces/QueryObserverSuccessResult.md | 52 +++++++------- .../reference/interfaces/QueryOptions.md | 31 ++++---- .../reference/interfaces/RefetchOptions.md | 7 +- .../interfaces/RefetchQueryFilters.md | 2 +- .../reference/interfaces/ResetOptions.md | 7 +- .../reference/interfaces/ResultOptions.md | 5 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../interfaces/UseBaseQueryOptions.md | 62 +++++++++------- .../interfaces/UseInfiniteQueryOptions.md | 66 +++++++++-------- .../interfaces/UseMutationOptions.md | 35 ++++++---- .../reference/interfaces/UseQueryOptions.md | 60 +++++++++------- .../UseSuspenseInfiniteQueryOptions.md | 58 ++++++++------- .../interfaces/UseSuspenseQueryOptions.md | 52 ++++++++------ .../DefaultedInfiniteQueryObserverOptions.md | 2 +- .../DefaultedQueryObserverOptions.md | 2 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../EnsureInfiniteQueryDataOptions.md | 2 +- .../type-aliases/FetchInfiniteQueryOptions.md | 2 +- .../reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryExecuteOptions.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +-- .../reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/ThrowOnError.md | 2 +- .../reference/type-aliases/WithRequired.md | 2 +- .../reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 6 +- .../interfaces/EnsureQueryDataOptions.md | 39 ++++++----- .../interfaces/FetchNextPageOptions.md | 7 +- .../interfaces/FetchPreviousPageOptions.md | 7 +- .../reference/interfaces/FetchQueryOptions.md | 37 +++++----- .../InfiniteQueryObserverBaseResult.md | 68 +++++++++--------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 +++++++++--------- .../InfiniteQueryObserverLoadingResult.md | 68 +++++++++--------- .../InfiniteQueryObserverOptions.md | 66 +++++++++-------- .../InfiniteQueryObserverPendingResult.md | 68 +++++++++--------- .../InfiniteQueryObserverPlaceholderResult.md | 68 +++++++++--------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 +++++++++--------- .../InfiniteQueryObserverSuccessResult.md | 68 +++++++++--------- .../interfaces/InfiniteQueryOptions.md | 62 +++++++++------- .../InfiniteQueryPageParamsOptions.md | 8 +-- .../reference/interfaces/InitialPageParam.md | 4 +- .../reference/interfaces/InvalidateOptions.md | 7 +- .../interfaces/InvalidateQueryFilters.md | 5 +- .../reference/interfaces/MutateOptions.md | 8 +-- .../interfaces/MutationObserverBaseResult.md | 22 +++--- .../interfaces/MutationObserverErrorResult.md | 22 +++--- .../interfaces/MutationObserverIdleResult.md | 22 +++--- .../MutationObserverLoadingResult.md | 22 +++--- .../interfaces/MutationObserverOptions.md | 37 ++++++---- .../MutationObserverSuccessResult.md | 22 +++--- .../reference/interfaces/MutationOptions.md | 35 ++++++---- .../solid/reference/interfaces/NotifyEvent.md | 4 +- .../reference/interfaces/QueryClientConfig.md | 4 +- .../interfaces/QueryExecuteOptions.md | 39 ++++++----- .../interfaces/QueryObserverBaseResult.md | 52 +++++++------- .../QueryObserverLoadingErrorResult.md | 52 +++++++------- .../interfaces/QueryObserverLoadingResult.md | 52 +++++++------- .../interfaces/QueryObserverOptions.md | 60 +++++++++------- .../interfaces/QueryObserverPendingResult.md | 52 +++++++------- .../QueryObserverPlaceholderResult.md | 52 +++++++------- .../QueryObserverRefetchErrorResult.md | 52 +++++++------- .../interfaces/QueryObserverSuccessResult.md | 52 +++++++------- .../reference/interfaces/QueryOptions.md | 58 ++++++++------- .../reference/interfaces/RefetchOptions.md | 7 +- .../interfaces/RefetchQueryFilters.md | 2 +- .../reference/interfaces/ResetOptions.md | 7 +- .../reference/interfaces/ResultOptions.md | 5 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../interfaces/UseBaseQueryOptions.md | 58 ++++++++------- .../DefaultedInfiniteQueryObserverOptions.md | 2 +- .../DefaultedQueryObserverOptions.md | 2 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../EnsureInfiniteQueryDataOptions.md | 2 +- .../type-aliases/FetchInfiniteQueryOptions.md | 2 +- .../reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryExecuteOptions.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +-- .../reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/ThrowOnError.md | 2 +- .../reference/type-aliases/WithRequired.md | 2 +- .../reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 10 +-- .../interfaces/EnsureQueryDataOptions.md | 39 ++++++----- .../interfaces/FetchNextPageOptions.md | 7 +- .../interfaces/FetchPreviousPageOptions.md | 7 +- .../reference/interfaces/FetchQueryOptions.md | 37 +++++----- .../InfiniteQueryObserverBaseResult.md | 68 +++++++++--------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 +++++++++--------- .../InfiniteQueryObserverLoadingResult.md | 68 +++++++++--------- .../InfiniteQueryObserverOptions.md | 70 +++++++++++-------- .../InfiniteQueryObserverPendingResult.md | 68 +++++++++--------- .../InfiniteQueryObserverPlaceholderResult.md | 68 +++++++++--------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 +++++++++--------- .../InfiniteQueryObserverSuccessResult.md | 68 +++++++++--------- .../InfiniteQueryPageParamsOptions.md | 8 +-- .../reference/interfaces/InitialPageParam.md | 4 +- .../reference/interfaces/InvalidateOptions.md | 7 +- .../interfaces/InvalidateQueryFilters.md | 5 +- .../reference/interfaces/MutateOptions.md | 8 +-- .../interfaces/MutationObserverBaseResult.md | 22 +++--- .../interfaces/MutationObserverErrorResult.md | 22 +++--- .../interfaces/MutationObserverIdleResult.md | 22 +++--- .../MutationObserverLoadingResult.md | 22 +++--- .../interfaces/MutationObserverOptions.md | 37 ++++++---- .../MutationObserverSuccessResult.md | 22 +++--- .../reference/interfaces/MutationOptions.md | 28 ++++---- .../reference/interfaces/NotifyEvent.md | 4 +- .../reference/interfaces/QueryClientConfig.md | 8 +-- .../interfaces/QueryExecuteOptions.md | 39 ++++++----- .../interfaces/QueryObserverBaseResult.md | 52 +++++++------- .../QueryObserverLoadingErrorResult.md | 52 +++++++------- .../interfaces/QueryObserverLoadingResult.md | 52 +++++++------- .../interfaces/QueryObserverOptions.md | 64 +++++++++-------- .../interfaces/QueryObserverPendingResult.md | 52 +++++++------- .../QueryObserverPlaceholderResult.md | 52 +++++++------- .../QueryObserverRefetchErrorResult.md | 52 +++++++------- .../interfaces/QueryObserverSuccessResult.md | 52 +++++++------- .../reference/interfaces/QueryOptions.md | 31 ++++---- .../reference/interfaces/RefetchOptions.md | 7 +- .../interfaces/RefetchQueryFilters.md | 2 +- .../reference/interfaces/ResetOptions.md | 7 +- .../reference/interfaces/ResultOptions.md | 5 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../DefaultedInfiniteQueryObserverOptions.md | 2 +- .../DefaultedQueryObserverOptions.md | 2 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../EnsureInfiniteQueryDataOptions.md | 2 +- .../type-aliases/FetchInfiniteQueryOptions.md | 2 +- .../reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryExecuteOptions.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +-- .../reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/ThrowOnError.md | 2 +- .../reference/type-aliases/WithRequired.md | 2 +- .../vue/reference/interfaces/CancelOptions.md | 6 +- .../reference/interfaces/DefaultOptions.md | 10 +-- .../interfaces/EnsureQueryDataOptions.md | 39 ++++++----- .../interfaces/FetchNextPageOptions.md | 7 +- .../interfaces/FetchPreviousPageOptions.md | 7 +- .../reference/interfaces/FetchQueryOptions.md | 37 +++++----- .../InfiniteQueryObserverBaseResult.md | 68 +++++++++--------- ...InfiniteQueryObserverLoadingErrorResult.md | 68 +++++++++--------- .../InfiniteQueryObserverLoadingResult.md | 68 +++++++++--------- .../InfiniteQueryObserverOptions.md | 70 +++++++++++-------- .../InfiniteQueryObserverPendingResult.md | 68 +++++++++--------- .../InfiniteQueryObserverPlaceholderResult.md | 68 +++++++++--------- ...InfiniteQueryObserverRefetchErrorResult.md | 68 +++++++++--------- .../InfiniteQueryObserverSuccessResult.md | 68 +++++++++--------- .../InfiniteQueryPageParamsOptions.md | 8 +-- .../reference/interfaces/InitialPageParam.md | 4 +- .../reference/interfaces/InvalidateOptions.md | 7 +- .../interfaces/InvalidateQueryFilters.md | 5 +- .../vue/reference/interfaces/MutateOptions.md | 8 +-- .../interfaces/MutationObserverBaseResult.md | 22 +++--- .../interfaces/MutationObserverErrorResult.md | 22 +++--- .../interfaces/MutationObserverIdleResult.md | 22 +++--- .../MutationObserverLoadingResult.md | 22 +++--- .../interfaces/MutationObserverOptions.md | 37 ++++++---- .../MutationObserverSuccessResult.md | 22 +++--- .../vue/reference/interfaces/NotifyEvent.md | 4 +- .../reference/interfaces/QueryClientConfig.md | 8 +-- .../interfaces/QueryExecuteOptions.md | 39 ++++++----- .../interfaces/QueryObserverBaseResult.md | 52 +++++++------- .../QueryObserverLoadingErrorResult.md | 52 +++++++------- .../interfaces/QueryObserverLoadingResult.md | 52 +++++++------- .../interfaces/QueryObserverOptions.md | 64 +++++++++-------- .../interfaces/QueryObserverPendingResult.md | 52 +++++++------- .../QueryObserverPlaceholderResult.md | 52 +++++++------- .../QueryObserverRefetchErrorResult.md | 52 +++++++------- .../interfaces/QueryObserverSuccessResult.md | 52 +++++++------- .../reference/interfaces/RefetchOptions.md | 7 +- .../interfaces/RefetchQueryFilters.md | 2 +- .../vue/reference/interfaces/ResetOptions.md | 7 +- .../vue/reference/interfaces/ResultOptions.md | 5 +- .../reference/interfaces/SetDataOptions.md | 4 +- .../DefaultedInfiniteQueryObserverOptions.md | 2 +- .../DefaultedQueryObserverOptions.md | 2 +- .../DefinedInfiniteQueryObserverResult.md | 2 +- .../DefinedQueryObserverResult.md | 2 +- .../EnsureInfiniteQueryDataOptions.md | 2 +- .../type-aliases/FetchInfiniteQueryOptions.md | 2 +- .../vue/reference/type-aliases/FetchStatus.md | 2 +- .../InfiniteQueryExecuteOptions.md | 2 +- .../InfiniteQueryObserverResult.md | 2 +- .../reference/type-aliases/MutateFunction.md | 2 +- .../type-aliases/MutateFunctionRest.md | 2 +- .../type-aliases/MutationFunction.md | 2 +- .../type-aliases/MutationFunctionContext.md | 8 +-- .../vue/reference/type-aliases/MutationKey.md | 2 +- .../reference/type-aliases/MutationMeta.md | 2 +- .../type-aliases/MutationObserverResult.md | 2 +- .../reference/type-aliases/MutationScope.md | 4 +- .../reference/type-aliases/MutationStatus.md | 2 +- .../reference/type-aliases/NotifyEventType.md | 2 +- .../type-aliases/QueryObserverResult.md | 2 +- .../vue/reference/type-aliases/QueryStatus.md | 2 +- .../reference/type-aliases/ThrowOnError.md | 2 +- .../reference/type-aliases/WithRequired.md | 2 +- packages/query-core/src/types.ts | 22 +++++- 479 files changed, 5837 insertions(+), 5289 deletions(-) diff --git a/docs/framework/angular/reference/interfaces/CancelOptions.md b/docs/framework/angular/reference/interfaces/CancelOptions.md index f52c729f3b1..b7464c48e50 100644 --- a/docs/framework/angular/reference/interfaces/CancelOptions.md +++ b/docs/framework/angular/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1501) +Defined in: [packages/query-core/src/types.ts:1521](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1521) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) +Defined in: [packages/query-core/src/types.ts:1522](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1522) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1503) +Defined in: [packages/query-core/src/types.ts:1523](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1523) diff --git a/docs/framework/angular/reference/interfaces/CreateBaseQueryOptions.md b/docs/framework/angular/reference/interfaces/CreateBaseQueryOptions.md index 80f89af69d7..c2f4508ffbc 100644 --- a/docs/framework/angular/reference/interfaces/CreateBaseQueryOptions.md +++ b/docs/framework/angular/reference/interfaces/CreateBaseQueryOptions.md @@ -55,7 +55,7 @@ The type of your `queryKey`. optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -75,12 +75,13 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -100,7 +101,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -121,7 +122,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -137,7 +138,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -153,7 +154,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -170,7 +171,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -190,13 +193,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -210,7 +215,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -273,7 +278,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -291,7 +296,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -311,7 +316,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -328,7 +333,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -349,7 +354,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -365,7 +370,7 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -384,9 +389,10 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -401,7 +407,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -422,7 +428,7 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -443,7 +449,7 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -485,7 +491,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -495,6 +501,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) @@ -507,7 +515,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -526,7 +534,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -555,7 +563,7 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -576,7 +584,7 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -595,7 +603,7 @@ Defaults to `true`. optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -614,7 +622,7 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/angular/reference/interfaces/CreateInfiniteQueryOptions.md b/docs/framework/angular/reference/interfaces/CreateInfiniteQueryOptions.md index 496ce36b7e6..a56340bfd6c 100644 --- a/docs/framework/angular/reference/interfaces/CreateInfiniteQueryOptions.md +++ b/docs/framework/angular/reference/interfaces/CreateInfiniteQueryOptions.md @@ -56,7 +56,7 @@ The type of the parameter passed to `queryFn` to fetch a given page. optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -78,12 +78,13 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -101,7 +102,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -120,7 +121,7 @@ OmitKeyof.getNextPageParam optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -141,7 +142,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -164,7 +165,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -182,7 +183,7 @@ OmitKeyof.initialDataUpdatedAt initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from @@ -198,7 +199,7 @@ OmitKeyof.initialPageParam optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -214,7 +215,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -231,7 +232,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -251,13 +254,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -271,7 +276,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -292,7 +297,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -312,7 +317,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -334,7 +339,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -351,7 +356,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -374,7 +379,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -392,7 +397,7 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -413,9 +418,10 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -430,7 +436,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -453,7 +459,7 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -476,7 +482,7 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -522,7 +528,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -532,6 +538,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -546,7 +554,7 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -567,7 +575,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -598,7 +606,7 @@ OmitKeyof.select optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -621,7 +629,7 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -642,7 +650,7 @@ OmitKeyof.structuralSharing optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/angular/reference/interfaces/CreateMutationOptions.md b/docs/framework/angular/reference/interfaces/CreateMutationOptions.md index 76ed90b426a..b1f61fbbbb1 100644 --- a/docs/framework/angular/reference/interfaces/CreateMutationOptions.md +++ b/docs/framework/angular/reference/interfaces/CreateMutationOptions.md @@ -47,7 +47,7 @@ their `onMutateResult` parameter — useful for optimistic-update rollback data. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) +Defined in: [packages/query-core/src/types.ts:1260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1260) The time in milliseconds that an unused/inactive mutation remains in memory before it is garbage collected. @@ -66,7 +66,7 @@ Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) +Defined in: [packages/query-core/src/types.ts:1263](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1263) #### Inherited from @@ -80,7 +80,7 @@ Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) +Defined in: [packages/query-core/src/types.ts:1206](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1206) #### Inherited from @@ -96,7 +96,7 @@ OmitKeyof.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) #### Inherited from @@ -110,7 +110,9 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1253](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1253) + +Controls whether a mutation is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -130,7 +132,7 @@ Defaults to `'online'`. optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) +Defined in: [packages/query-core/src/types.ts:1218](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1218) #### Parameters @@ -168,7 +170,7 @@ OmitKeyof.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -198,7 +200,7 @@ OmitKeyof.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) +Defined in: [packages/query-core/src/types.ts:1224](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1224) #### Parameters @@ -240,7 +242,7 @@ OmitKeyof.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Parameters @@ -278,7 +280,7 @@ OmitKeyof.onSuccess optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1239](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1239) If `false`, failed mutations will not retry by default. If `true`, failed mutations will retry infinitely. @@ -301,7 +303,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) +Defined in: [packages/query-core/src/types.ts:1246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1246) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -322,7 +324,7 @@ OmitKeyof.retryDelay optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) #### Inherited from @@ -336,7 +338,14 @@ Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) +Defined in: [packages/query-core/src/types.ts:1281](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1281) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true`, all errors will be thrown to the nearest error boundary. +If set to a function, it will be passed the error and should return a boolean indicating whether to throw the +error (`true`) or return it as state (`false`). + +Defaults to `false`. #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/CreateQueryOptions.md b/docs/framework/angular/reference/interfaces/CreateQueryOptions.md index 4c690e9a0ea..1982a488ea3 100644 --- a/docs/framework/angular/reference/interfaces/CreateQueryOptions.md +++ b/docs/framework/angular/reference/interfaces/CreateQueryOptions.md @@ -47,7 +47,7 @@ The type of your `queryKey`. optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -69,12 +69,13 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -94,7 +95,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -117,7 +118,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -135,7 +136,7 @@ OmitKeyof.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -151,7 +152,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -168,7 +169,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -188,13 +191,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -208,7 +213,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -273,7 +278,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -293,7 +298,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -315,7 +320,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -332,7 +337,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -355,7 +360,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -373,7 +378,7 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -394,9 +399,10 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -411,7 +417,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -434,7 +440,7 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -457,7 +463,7 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -503,7 +509,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -513,6 +519,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -527,7 +535,7 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -548,7 +556,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -579,7 +587,7 @@ OmitKeyof.select optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -602,7 +610,7 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -623,7 +631,7 @@ OmitKeyof.structuralSharing optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/angular/reference/interfaces/DefaultOptions.md b/docs/framework/angular/reference/interfaces/DefaultOptions.md index 67ae012f9ee..e45a56f075f 100644 --- a/docs/framework/angular/reference/interfaces/DefaultOptions.md +++ b/docs/framework/angular/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1487) +Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) ## Type Parameters @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/ optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1498](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1498) +Defined in: [packages/query-core/src/types.ts:1518](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1518) Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). @@ -31,7 +31,7 @@ Default options used when dehydrating the client's caches; see [DehydrateOptions optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1496](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1496) +Defined in: [packages/query-core/src/types.ts:1516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1516) Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). @@ -67,7 +67,7 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1494](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1494) +Defined in: [packages/query-core/src/types.ts:1514](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1514) Default options applied to every mutation, unless overridden per-mutation. @@ -79,6 +79,6 @@ Default options applied to every mutation, unless overridden per-mutation. optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: [packages/query-core/src/types.ts:1489](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1489) +Defined in: [packages/query-core/src/types.ts:1509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1509) Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/angular/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/angular/reference/interfaces/EnsureQueryDataOptions.md index d71a60902e6..a67082af57e 100644 --- a/docs/framework/angular/reference/interfaces/EnsureQueryDataOptions.md +++ b/docs/framework/angular/reference/interfaces/EnsureQueryDataOptions.md @@ -3,7 +3,7 @@ id: EnsureQueryDataOptions title: EnsureQueryDataOptions --- -Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L606) +Defined in: [packages/query-core/src/types.ts:614](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L614) ## Deprecated @@ -41,12 +41,13 @@ Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -66,7 +67,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -87,7 +88,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -103,7 +104,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) +Defined in: [packages/query-core/src/types.ts:605](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L605) #### Inherited from @@ -117,7 +118,7 @@ Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -133,7 +134,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -150,7 +151,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -170,7 +173,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -189,7 +192,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -209,7 +212,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -226,7 +229,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -247,7 +250,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -284,7 +287,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -294,6 +297,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`FetchQueryOptions`](FetchQueryOptions.md).[`retryDelay`](FetchQueryOptions.md#retrydelay) @@ -306,7 +311,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional revalidateIfStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L619) +Defined in: [packages/query-core/src/types.ts:627](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L627) *** @@ -316,7 +321,7 @@ Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) +Defined in: [packages/query-core/src/types.ts:610](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L610) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -333,7 +338,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/angular/reference/interfaces/FetchNextPageOptions.md b/docs/framework/angular/reference/interfaces/FetchNextPageOptions.md index 2c0be977140..b79cdbe19b3 100644 --- a/docs/framework/angular/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/angular/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:736](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L736) +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,9 +34,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/angular/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/angular/reference/interfaces/FetchPreviousPageOptions.md index 683e789ee52..fd5a08767b6 100644 --- a/docs/framework/angular/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/angular/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L739) +Defined in: [packages/query-core/src/types.ts:749](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L749) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:748](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L748) +Defined in: [packages/query-core/src/types.ts:758](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L758) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,9 +34,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/angular/reference/interfaces/FetchQueryOptions.md b/docs/framework/angular/reference/interfaces/FetchQueryOptions.md index 634ae0e09f9..b00973badc0 100644 --- a/docs/framework/angular/reference/interfaces/FetchQueryOptions.md +++ b/docs/framework/angular/reference/interfaces/FetchQueryOptions.md @@ -3,7 +3,7 @@ id: FetchQueryOptions title: FetchQueryOptions --- -Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L587) +Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) ## Deprecated @@ -45,12 +45,13 @@ Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -72,7 +73,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -95,7 +96,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -113,7 +114,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) +Defined in: [packages/query-core/src/types.ts:605](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L605) *** @@ -123,7 +124,7 @@ Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -141,7 +142,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -160,7 +161,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -182,7 +185,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -203,7 +206,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -225,7 +228,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -244,7 +247,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -267,7 +270,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -308,7 +311,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -318,6 +321,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -332,7 +337,7 @@ WithRequired.retryDelay optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) +Defined in: [packages/query-core/src/types.ts:610](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L610) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -345,7 +350,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult.md index 9195e0727f8..0aa01962aa5 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L991) +Defined in: [packages/query-core/src/types.ts:1001](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1001) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:771](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L771) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) +Defined in: [packages/query-core/src/types.ts:804](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L804) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) +Defined in: [packages/query-core/src/types.ts:827](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L827) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) +Defined in: [packages/query-core/src/types.ts:845](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L845) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) +Defined in: [packages/query-core/src/types.ts:849](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L849) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 2841b5ab116..f5e3352f27c 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) +Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1076](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1076) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1077](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1077) +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult.md index 95ff84b3ef3..b7aa67744c0 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverOptions.md index 7d5b0dd1a4d..7670bd8e24b 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverOptions.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverOptions title: InfiniteQueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L531) +Defined in: [packages/query-core/src/types.ts:539](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L539) ## Extends @@ -39,7 +39,7 @@ Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/q optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -59,12 +59,13 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -82,7 +83,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -99,7 +100,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -118,7 +119,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -139,7 +140,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -155,7 +156,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from @@ -169,7 +170,7 @@ Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -185,7 +186,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -202,7 +203,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -222,13 +225,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -242,7 +247,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -261,7 +266,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -279,7 +284,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -299,7 +304,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -316,7 +321,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -337,7 +342,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -353,7 +358,7 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -372,9 +377,10 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -389,7 +395,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -410,7 +416,7 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -431,7 +437,7 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -473,7 +479,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -483,6 +489,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) @@ -495,7 +503,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -514,7 +522,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -543,7 +551,7 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -564,7 +572,7 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -583,7 +591,7 @@ Defaults to `true`. optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -602,7 +610,7 @@ Defaults to `false`. optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult.md index c3e8b022cdb..a09301ab6c4 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1042](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1042) +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index e62579744ba..58193a987d1 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) +Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) +Defined in: [packages/query-core/src/types.ts:1136](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1136) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) +Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1133](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1133) +Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1128) +Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1129](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1129) +Defined in: [packages/query-core/src/types.ts:1139](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1139) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) +Defined in: [packages/query-core/src/types.ts:1137](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1137) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1132](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1132) +Defined in: [packages/query-core/src/types.ts:1142](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1142) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) +Defined in: [packages/query-core/src/types.ts:1140](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1140) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) +Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) +Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index a67e877f083..4ce469bceed 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1094](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1094) +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 0b875662cbc..131f6d01ae7 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) +Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) +Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) +Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) +Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) +Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/angular/reference/interfaces/InfiniteQueryPageParamsOptions.md index afe27785edc..c091cc15456 100644 --- a/docs/framework/angular/reference/interfaces/InfiniteQueryPageParamsOptions.md +++ b/docs/framework/angular/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryPageParamsOptions title: InfiniteQueryPageParamsOptions --- -Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L347) +Defined in: [packages/query-core/src/types.ts:352](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L352) ## Extends @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/q getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -44,7 +44,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -57,7 +57,7 @@ The result will also be used to determine the value of `hasPreviousPage`. initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from diff --git a/docs/framework/angular/reference/interfaces/InitialPageParam.md b/docs/framework/angular/reference/interfaces/InitialPageParam.md index 2d42bf029a4..46d2b219ea4 100644 --- a/docs/framework/angular/reference/interfaces/InitialPageParam.md +++ b/docs/framework/angular/reference/interfaces/InitialPageParam.md @@ -3,7 +3,7 @@ id: InitialPageParam title: InitialPageParam --- -Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L343) +Defined in: [packages/query-core/src/types.ts:348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L348) ## Extended by @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/q initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) diff --git a/docs/framework/angular/reference/interfaces/InvalidateOptions.md b/docs/framework/angular/reference/interfaces/InvalidateOptions.md index d83ecd43ec0..8a81428b035 100644 --- a/docs/framework/angular/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/angular/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) +Defined in: [packages/query-core/src/types.ts:734](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L734) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,9 +37,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/angular/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/angular/reference/interfaces/InvalidateQueryFilters.md index 36eb3f27998..569e42a4e1b 100644 --- a/docs/framework/angular/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/angular/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) +Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -100,9 +100,10 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:717](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L717) +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) Controls which of the matched (now-invalidated) queries are refetched in the background. + Defaults to `'active'`. - `'active'`: only queries with at least one active observer are refetched. - `'inactive'`: only queries with no active observer are refetched. diff --git a/docs/framework/angular/reference/interfaces/MutateOptions.md b/docs/framework/angular/reference/interfaces/MutateOptions.md index b12b3b29ec2..34e2a4d4d7e 100644 --- a/docs/framework/angular/reference/interfaces/MutateOptions.md +++ b/docs/framework/angular/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) +Defined in: [packages/query-core/src/types.ts:1284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1284) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) +Defined in: [packages/query-core/src/types.ts:1296](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1296) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1282) +Defined in: [packages/query-core/src/types.ts:1302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1302) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1270](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1270) +Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) #### Parameters diff --git a/docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md index e1c09a56737..340a38cc9cc 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1315) +Defined in: [packages/query-core/src/types.ts:1335](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1335) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1324](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1324) +Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1333](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1333) +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) +Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) +Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) +Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1328](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1328) +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) The variables object passed to the `mutationFn`. diff --git a/docs/framework/angular/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/angular/reference/interfaces/MutationObserverErrorResult.md index cce591e3465..72e459a2e0b 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) +Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) +Defined in: [packages/query-core/src/types.ts:1453](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1453) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) +Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) +Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) +Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) +Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) The variables object passed to the `mutationFn`. diff --git a/docs/framework/angular/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/angular/reference/interfaces/MutationObserverIdleResult.md index b7892846a6c..cd8d6eb3130 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) +Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) +Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1394](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1394) +Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) +Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1396](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1396) +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) +Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) +Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) The variables object passed to the `mutationFn`. diff --git a/docs/framework/angular/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/angular/reference/interfaces/MutationObserverLoadingResult.md index d4368822213..9b70a8558e7 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) +Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) +Defined in: [packages/query-core/src/types.ts:1432](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1432) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) +Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) +Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) +Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) The variables object passed to the `mutationFn`. diff --git a/docs/framework/angular/reference/interfaces/MutationObserverOptions.md b/docs/framework/angular/reference/interfaces/MutationObserverOptions.md index 1e609be9bf1..5bab2840a6d 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1255) +Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) ## Extends @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) +Defined in: [packages/query-core/src/types.ts:1260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1260) The time in milliseconds that an unused/inactive mutation remains in memory before it is garbage collected. @@ -54,7 +54,7 @@ Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) +Defined in: [packages/query-core/src/types.ts:1263](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1263) #### Inherited from @@ -68,7 +68,7 @@ Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) +Defined in: [packages/query-core/src/types.ts:1206](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1206) #### Inherited from @@ -82,7 +82,7 @@ Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) #### Inherited from @@ -96,7 +96,9 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1253](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1253) + +Controls whether a mutation is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -116,7 +118,7 @@ Defaults to `'online'`. optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) +Defined in: [packages/query-core/src/types.ts:1218](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1218) #### Parameters @@ -152,7 +154,7 @@ Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -180,7 +182,7 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) +Defined in: [packages/query-core/src/types.ts:1224](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1224) #### Parameters @@ -220,7 +222,7 @@ Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Parameters @@ -256,7 +258,7 @@ Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1239](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1239) If `false`, failed mutations will not retry by default. If `true`, failed mutations will retry infinitely. @@ -277,7 +279,7 @@ Defaults to `0`. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) +Defined in: [packages/query-core/src/types.ts:1246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1246) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -296,7 +298,7 @@ Defaults to a function that applies exponential backoff, capped at 30 seconds. optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) #### Inherited from @@ -310,4 +312,11 @@ Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) +Defined in: [packages/query-core/src/types.ts:1281](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1281) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true`, all errors will be thrown to the nearest error boundary. +If set to a function, it will be passed the error and should return a boolean indicating whether to throw the +error (`true`) or return it as state (`false`). + +Defaults to `false`. diff --git a/docs/framework/angular/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/angular/reference/interfaces/MutationObserverSuccessResult.md index 52cdcc4883e..e2e03642f82 100644 --- a/docs/framework/angular/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/angular/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) +Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) +Defined in: [packages/query-core/src/types.ts:1474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1474) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) +Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) +Defined in: [packages/query-core/src/types.ts:1478](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1478) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) +Defined in: [packages/query-core/src/types.ts:1479](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1479) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) +Defined in: [packages/query-core/src/types.ts:1480](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1480) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1481](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1481) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) +Defined in: [packages/query-core/src/types.ts:1476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1476) The variables object passed to the `mutationFn`. diff --git a/docs/framework/angular/reference/interfaces/MutationOptions.md b/docs/framework/angular/reference/interfaces/MutationOptions.md index 49f2b8f4f19..5aabeeb0ca4 100644 --- a/docs/framework/angular/reference/interfaces/MutationOptions.md +++ b/docs/framework/angular/reference/interfaces/MutationOptions.md @@ -3,7 +3,7 @@ id: MutationOptions title: MutationOptions --- -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) ## Extended by @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) +Defined in: [packages/query-core/src/types.ts:1260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1260) The time in milliseconds that an unused/inactive mutation remains in memory before it is garbage collected. @@ -50,7 +50,7 @@ Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) +Defined in: [packages/query-core/src/types.ts:1263](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1263) *** @@ -60,7 +60,7 @@ Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) +Defined in: [packages/query-core/src/types.ts:1206](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1206) *** @@ -70,7 +70,7 @@ Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) *** @@ -80,7 +80,9 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1253](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1253) + +Controls whether a mutation is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -96,7 +98,7 @@ Defaults to `'online'`. optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) +Defined in: [packages/query-core/src/types.ts:1218](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1218) #### Parameters @@ -128,7 +130,7 @@ Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -152,7 +154,7 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) +Defined in: [packages/query-core/src/types.ts:1224](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1224) #### Parameters @@ -188,7 +190,7 @@ Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Parameters @@ -220,7 +222,7 @@ Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1239](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1239) If `false`, failed mutations will not retry by default. If `true`, failed mutations will retry infinitely. @@ -237,7 +239,7 @@ Defaults to `0`. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) +Defined in: [packages/query-core/src/types.ts:1246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1246) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -252,4 +254,4 @@ Defaults to a function that applies exponential backoff, capped at 30 seconds. optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) diff --git a/docs/framework/angular/reference/interfaces/NotifyEvent.md b/docs/framework/angular/reference/interfaces/NotifyEvent.md index 5e7875d41b8..4f5b023f49a 100644 --- a/docs/framework/angular/reference/interfaces/NotifyEvent.md +++ b/docs/framework/angular/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1519) +Defined in: [packages/query-core/src/types.ts:1539](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1539) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1520) +Defined in: [packages/query-core/src/types.ts:1540](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1540) diff --git a/docs/framework/angular/reference/interfaces/QueryClientConfig.md b/docs/framework/angular/reference/interfaces/QueryClientConfig.md index 411eb0b2fb2..070e249491f 100644 --- a/docs/framework/angular/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/angular/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) +Defined in: [packages/query-core/src/types.ts:1495](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1495) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/ optional defaultOptions: DefaultOptions; ``` -Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) +Defined in: [packages/query-core/src/types.ts:1504](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1504) Default options for all queries and mutations created through this client. @@ -25,7 +25,7 @@ Default options for all queries and mutations created through this client. optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1482) +Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) The mutation cache this client is connected to. A new `MutationCache` is created if not provided. @@ -38,6 +38,6 @@ provided. optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) +Defined in: [packages/query-core/src/types.ts:1497](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1497) The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/angular/reference/interfaces/QueryExecuteOptions.md b/docs/framework/angular/reference/interfaces/QueryExecuteOptions.md index 1e844c5ba10..23d272eb25f 100644 --- a/docs/framework/angular/reference/interfaces/QueryExecuteOptions.md +++ b/docs/framework/angular/reference/interfaces/QueryExecuteOptions.md @@ -3,7 +3,7 @@ id: QueryExecuteOptions title: QueryExecuteOptions --- -Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) +Defined in: [packages/query-core/src/types.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L574) ## Extends @@ -43,12 +43,13 @@ Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -70,7 +71,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -93,7 +94,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -111,7 +112,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L577) +Defined in: [packages/query-core/src/types.ts:585](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L585) *** @@ -121,7 +122,7 @@ Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -139,7 +140,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -158,7 +159,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -180,7 +183,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -201,7 +204,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -223,7 +226,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -242,7 +245,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -265,7 +268,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -306,7 +309,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -316,6 +319,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -330,7 +335,7 @@ WithRequired.retryDelay optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L578) +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) #### Parameters @@ -350,7 +355,7 @@ Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:583](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L583) +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -363,7 +368,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/angular/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/angular/reference/interfaces/QueryObserverBaseResult.md index 1b54d6f8041..ef5fe0ad757 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:764](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L764) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:771](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L771) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) +Defined in: [packages/query-core/src/types.ts:804](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L804) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) +Defined in: [packages/query-core/src/types.ts:827](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L827) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) +Defined in: [packages/query-core/src/types.ts:845](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L845) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) +Defined in: [packages/query-core/src/types.ts:849](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L849) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/angular/reference/interfaces/QueryObserverLoadingErrorResult.md index 7a4f855305f..21b39fbffe3 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) +Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/angular/reference/interfaces/QueryObserverLoadingResult.md index 8f94574bcca..4966390127f 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) +Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverOptions.md b/docs/framework/angular/reference/interfaces/QueryObserverOptions.md index d9fba419fe7..5e171652c26 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverOptions.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverOptions.md @@ -3,7 +3,7 @@ id: QueryObserverOptions title: QueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L375) +Defined in: [packages/query-core/src/types.ts:380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L380) ## Extends @@ -48,7 +48,7 @@ Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/q optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -64,12 +64,13 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -91,7 +92,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -114,7 +115,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -132,7 +133,7 @@ WithRequired.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -150,7 +151,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -169,7 +170,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -191,13 +194,15 @@ WithRequired.networkMode optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. *** @@ -207,7 +212,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -228,7 +233,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -242,7 +247,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -264,7 +269,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -283,7 +288,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -306,7 +311,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -324,7 +329,7 @@ WithRequired.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -339,9 +344,10 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. *** @@ -352,7 +358,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -369,7 +375,7 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -386,7 +392,7 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -426,7 +432,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -436,6 +442,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -450,7 +458,7 @@ WithRequired.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -465,7 +473,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -490,7 +498,7 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -507,7 +515,7 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -528,7 +536,7 @@ WithRequired.structuralSharing optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -543,7 +551,7 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/angular/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/angular/reference/interfaces/QueryObserverPendingResult.md index 41a101c7c8c..8f00c426b64 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:887](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L887) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L888) +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) +Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/angular/reference/interfaces/QueryObserverPlaceholderResult.md index cce7cffcc9b..bbf3da387f9 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) +Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) +Defined in: [packages/query-core/src/types.ts:975](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L975) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) +Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) +Defined in: [packages/query-core/src/types.ts:976](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L976) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:969](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L969) +Defined in: [packages/query-core/src/types.ts:979](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L979) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L970) +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) +Defined in: [packages/query-core/src/types.ts:978](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L978) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) +Defined in: [packages/query-core/src/types.ts:983](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L983) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) +Defined in: [packages/query-core/src/types.ts:981](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L981) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:972](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L972) +Defined in: [packages/query-core/src/types.ts:982](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L982) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/angular/reference/interfaces/QueryObserverRefetchErrorResult.md index 8486e8cf4cb..345ecab35e1 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) +Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/angular/reference/interfaces/QueryObserverSuccessResult.md index f126bea0f70..3942655c627 100644 --- a/docs/framework/angular/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/angular/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) +Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) +Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) +Defined in: [packages/query-core/src/types.ts:964](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L964) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) +Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) +Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) +Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) The status of the query. - Will be: diff --git a/docs/framework/angular/reference/interfaces/QueryOptions.md b/docs/framework/angular/reference/interfaces/QueryOptions.md index bb82dd0f56a..7e059d3a1d6 100644 --- a/docs/framework/angular/reference/interfaces/QueryOptions.md +++ b/docs/framework/angular/reference/interfaces/QueryOptions.md @@ -35,12 +35,13 @@ Defined in: [packages/query-core/src/types.ts:231](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -56,7 +57,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -73,7 +74,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -85,7 +86,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -97,7 +98,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -110,7 +111,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -126,7 +129,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -141,7 +144,7 @@ optional queryFn: | typeof skipToken; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -157,7 +160,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -170,7 +173,7 @@ as the actual cache key internally. optional queryKey: TQueryKey; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -187,7 +190,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -216,7 +219,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -226,6 +229,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + *** ### structuralSharing? @@ -234,7 +239,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/angular/reference/interfaces/RefetchOptions.md b/docs/framework/angular/reference/interfaces/RefetchOptions.md index 104412c5bac..cfcc0498799 100644 --- a/docs/framework/angular/reference/interfaces/RefetchOptions.md +++ b/docs/framework/angular/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) +Defined in: [packages/query-core/src/types.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L704) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,9 +38,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/angular/reference/interfaces/RefetchQueryFilters.md b/docs/framework/angular/reference/interfaces/RefetchQueryFilters.md index bde28360fa1..c45dfa953f1 100644 --- a/docs/framework/angular/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/angular/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:720](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L720) +Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. diff --git a/docs/framework/angular/reference/interfaces/ResetOptions.md b/docs/framework/angular/reference/interfaces/ResetOptions.md index 6d3a8398fbb..9f12324ba27 100644 --- a/docs/framework/angular/reference/interfaces/ResetOptions.md +++ b/docs/framework/angular/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) +Defined in: [packages/query-core/src/types.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L735) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,9 +37,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/angular/reference/interfaces/ResultOptions.md b/docs/framework/angular/reference/interfaces/ResultOptions.md index f3da151a3ec..42917f20bf0 100644 --- a/docs/framework/angular/reference/interfaces/ResultOptions.md +++ b/docs/framework/angular/reference/interfaces/ResultOptions.md @@ -3,7 +3,7 @@ id: ResultOptions title: ResultOptions --- -Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L686) +Defined in: [packages/query-core/src/types.ts:694](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L694) ## Extended by @@ -19,8 +19,9 @@ Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/angular/reference/interfaces/SetDataOptions.md b/docs/framework/angular/reference/interfaces/SetDataOptions.md index cac83e9312a..bb668fbf162 100644 --- a/docs/framework/angular/reference/interfaces/SetDataOptions.md +++ b/docs/framework/angular/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1506) +Defined in: [packages/query-core/src/types.ts:1526](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1526) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) +Defined in: [packages/query-core/src/types.ts:1527](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1527) diff --git a/docs/framework/angular/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/angular/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md index 4412ad00c8e..82c7ddbb886 100644 --- a/docs/framework/angular/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md +++ b/docs/framework/angular/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedInfiniteQueryObserverOptions type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:549](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L549) +Defined in: [packages/query-core/src/types.ts:557](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L557) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/angular/reference/type-aliases/DefaultedQueryObserverOptions.md index 9ce8401b128..7687d8c24f6 100644 --- a/docs/framework/angular/reference/type-aliases/DefaultedQueryObserverOptions.md +++ b/docs/framework/angular/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedQueryObserverOptions type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) +Defined in: [packages/query-core/src/types.ts:528](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L528) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index cec33b142b7..38dac7cfe2b 100644 --- a/docs/framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/angular/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) +Defined in: [packages/query-core/src/types.ts:1148](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1148) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/angular/reference/type-aliases/DefinedQueryObserverResult.md index b4480af3810..ae77ddcc22d 100644 --- a/docs/framework/angular/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/angular/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/angular/reference/type-aliases/EnsureInfiniteQueryDataOptions.md index ff75b1c3449..7648331fca2 100644 --- a/docs/framework/angular/reference/type-aliases/EnsureInfiniteQueryDataOptions.md +++ b/docs/framework/angular/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -7,7 +7,7 @@ title: EnsureInfiniteQueryDataOptions type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; ``` -Defined in: [packages/query-core/src/types.ts:623](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L623) +Defined in: [packages/query-core/src/types.ts:631](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L631) ## Type Declaration diff --git a/docs/framework/angular/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/angular/reference/type-aliases/FetchInfiniteQueryOptions.md index c926bbd3ae5..d00a2455889 100644 --- a/docs/framework/angular/reference/type-aliases/FetchInfiniteQueryOptions.md +++ b/docs/framework/angular/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: FetchInfiniteQueryOptions type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:667](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L667) +Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/FetchStatus.md b/docs/framework/angular/reference/type-aliases/FetchStatus.md index b347069e97e..d50002355ca 100644 --- a/docs/framework/angular/reference/type-aliases/FetchStatus.md +++ b/docs/framework/angular/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:752](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L752) +Defined in: [packages/query-core/src/types.ts:762](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L762) diff --git a/docs/framework/angular/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/angular/reference/type-aliases/InfiniteQueryExecuteOptions.md index c198662a319..259c97c96bb 100644 --- a/docs/framework/angular/reference/type-aliases/InfiniteQueryExecuteOptions.md +++ b/docs/framework/angular/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -7,7 +7,7 @@ title: InfiniteQueryExecuteOptions type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:646](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L646) +Defined in: [packages/query-core/src/types.ts:654](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L654) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/angular/reference/type-aliases/InfiniteQueryObserverResult.md index 42279b19c00..aa27563b9cd 100644 --- a/docs/framework/angular/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/angular/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/MutateFunction.md b/docs/framework/angular/reference/type-aliases/MutateFunction.md index 558040d3439..e12b7a80291 100644 --- a/docs/framework/angular/reference/type-aliases/MutateFunction.md +++ b/docs/framework/angular/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1306](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1306) +Defined in: [packages/query-core/src/types.ts:1326](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1326) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/MutateFunctionRest.md b/docs/framework/angular/reference/type-aliases/MutateFunctionRest.md index 3e7a5217482..3902f1082f9 100644 --- a/docs/framework/angular/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/angular/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1291](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1291) +Defined in: [packages/query-core/src/types.ts:1311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1311) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/MutationFunction.md b/docs/framework/angular/reference/type-aliases/MutationFunction.md index 330af1ef65a..9bafb3db56b 100644 --- a/docs/framework/angular/reference/type-aliases/MutationFunction.md +++ b/docs/framework/angular/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1195](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1195) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/MutationFunctionContext.md b/docs/framework/angular/reference/type-aliases/MutationFunctionContext.md index 97de2f1c220..0207256c702 100644 --- a/docs/framework/angular/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/angular/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) +Defined in: [packages/query-core/src/types.ts:1189](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1189) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1180) +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1182](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1182) +Defined in: [packages/query-core/src/types.ts:1192](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1192) diff --git a/docs/framework/angular/reference/type-aliases/MutationKey.md b/docs/framework/angular/reference/type-aliases/MutationKey.md index 8e9d3bc3b3a..9d1d7f0f77b 100644 --- a/docs/framework/angular/reference/type-aliases/MutationKey.md +++ b/docs/framework/angular/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) +Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) diff --git a/docs/framework/angular/reference/type-aliases/MutationMeta.md b/docs/framework/angular/reference/type-aliases/MutationMeta.md index 474c593e206..ff1f9b4bf94 100644 --- a/docs/framework/angular/reference/type-aliases/MutationMeta.md +++ b/docs/framework/angular/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) +Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) diff --git a/docs/framework/angular/reference/type-aliases/MutationObserverResult.md b/docs/framework/angular/reference/type-aliases/MutationObserverResult.md index 21e43836bf6..c21fc3ac591 100644 --- a/docs/framework/angular/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/angular/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1464](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1464) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/MutationScope.md b/docs/framework/angular/reference/type-aliases/MutationScope.md index feac9d9d17a..1d6a91bd434 100644 --- a/docs/framework/angular/reference/type-aliases/MutationScope.md +++ b/docs/framework/angular/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1167) +Defined in: [packages/query-core/src/types.ts:1177](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1177) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) diff --git a/docs/framework/angular/reference/type-aliases/MutationStatus.md b/docs/framework/angular/reference/type-aliases/MutationStatus.md index 4cd2d3c9535..cf12d3d3ee3 100644 --- a/docs/framework/angular/reference/type-aliases/MutationStatus.md +++ b/docs/framework/angular/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) +Defined in: [packages/query-core/src/types.ts:1175](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1175) diff --git a/docs/framework/angular/reference/type-aliases/NotifyEventType.md b/docs/framework/angular/reference/type-aliases/NotifyEventType.md index 9bbc85e4ce8..ffa60b016e3 100644 --- a/docs/framework/angular/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/angular/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1510](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1510) +Defined in: [packages/query-core/src/types.ts:1530](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1530) diff --git a/docs/framework/angular/reference/type-aliases/QueryObserverResult.md b/docs/framework/angular/reference/type-aliases/QueryObserverResult.md index 4fc661a6c9d..5138b635f2c 100644 --- a/docs/framework/angular/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/angular/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/QueryStatus.md b/docs/framework/angular/reference/type-aliases/QueryStatus.md index 6679b8b17c6..bab00f6f423 100644 --- a/docs/framework/angular/reference/type-aliases/QueryStatus.md +++ b/docs/framework/angular/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:751](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L751) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) diff --git a/docs/framework/angular/reference/type-aliases/ThrowOnError.md b/docs/framework/angular/reference/type-aliases/ThrowOnError.md index 613549e4d52..134683388ef 100644 --- a/docs/framework/angular/reference/type-aliases/ThrowOnError.md +++ b/docs/framework/angular/reference/type-aliases/ThrowOnError.md @@ -7,7 +7,7 @@ title: ThrowOnError type ThrowOnError = boolean | (error, query) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L363) +Defined in: [packages/query-core/src/types.ts:368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L368) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/WithRequired.md b/docs/framework/angular/reference/type-aliases/WithRequired.md index deb87dfe4a4..a40a48c865b 100644 --- a/docs/framework/angular/reference/type-aliases/WithRequired.md +++ b/docs/framework/angular/reference/type-aliases/WithRequired.md @@ -7,7 +7,7 @@ title: WithRequired type WithRequired = TTarget & { [_ in TKey]: {} }; ``` -Defined in: [packages/query-core/src/types.ts:516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L516) +Defined in: [packages/query-core/src/types.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L524) ## Type Parameters diff --git a/docs/framework/lit/reference/interfaces/CancelOptions.md b/docs/framework/lit/reference/interfaces/CancelOptions.md index f52c729f3b1..b7464c48e50 100644 --- a/docs/framework/lit/reference/interfaces/CancelOptions.md +++ b/docs/framework/lit/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1501) +Defined in: [packages/query-core/src/types.ts:1521](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1521) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) +Defined in: [packages/query-core/src/types.ts:1522](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1522) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1503) +Defined in: [packages/query-core/src/types.ts:1523](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1523) diff --git a/docs/framework/lit/reference/interfaces/DefaultOptions.md b/docs/framework/lit/reference/interfaces/DefaultOptions.md index 67ae012f9ee..e45a56f075f 100644 --- a/docs/framework/lit/reference/interfaces/DefaultOptions.md +++ b/docs/framework/lit/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1487) +Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) ## Type Parameters @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/ optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1498](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1498) +Defined in: [packages/query-core/src/types.ts:1518](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1518) Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). @@ -31,7 +31,7 @@ Default options used when dehydrating the client's caches; see [DehydrateOptions optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1496](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1496) +Defined in: [packages/query-core/src/types.ts:1516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1516) Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). @@ -67,7 +67,7 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1494](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1494) +Defined in: [packages/query-core/src/types.ts:1514](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1514) Default options applied to every mutation, unless overridden per-mutation. @@ -79,6 +79,6 @@ Default options applied to every mutation, unless overridden per-mutation. optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: [packages/query-core/src/types.ts:1489](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1489) +Defined in: [packages/query-core/src/types.ts:1509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1509) Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/lit/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/lit/reference/interfaces/EnsureQueryDataOptions.md index 3974323fd21..f6d78f3f882 100644 --- a/docs/framework/lit/reference/interfaces/EnsureQueryDataOptions.md +++ b/docs/framework/lit/reference/interfaces/EnsureQueryDataOptions.md @@ -3,7 +3,7 @@ id: EnsureQueryDataOptions title: EnsureQueryDataOptions --- -Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L606) +Defined in: [packages/query-core/src/types.ts:614](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L614) ## Deprecated @@ -41,12 +41,13 @@ Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -66,7 +67,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -87,7 +88,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -103,7 +104,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) +Defined in: [packages/query-core/src/types.ts:605](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L605) #### Inherited from @@ -117,7 +118,7 @@ Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -133,7 +134,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -150,7 +151,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -170,7 +173,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -189,7 +192,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -209,7 +212,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -226,7 +229,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -247,7 +250,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -284,7 +287,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -294,6 +297,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`FetchQueryOptions`](FetchQueryOptions.md).[`retryDelay`](FetchQueryOptions.md#retrydelay) @@ -306,7 +311,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional revalidateIfStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L619) +Defined in: [packages/query-core/src/types.ts:627](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L627) *** @@ -316,7 +321,7 @@ Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) +Defined in: [packages/query-core/src/types.ts:610](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L610) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -333,7 +338,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/lit/reference/interfaces/FetchNextPageOptions.md b/docs/framework/lit/reference/interfaces/FetchNextPageOptions.md index 2c0be977140..b79cdbe19b3 100644 --- a/docs/framework/lit/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/lit/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:736](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L736) +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,9 +34,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/lit/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/lit/reference/interfaces/FetchPreviousPageOptions.md index 683e789ee52..fd5a08767b6 100644 --- a/docs/framework/lit/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/lit/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L739) +Defined in: [packages/query-core/src/types.ts:749](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L749) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:748](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L748) +Defined in: [packages/query-core/src/types.ts:758](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L758) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,9 +34,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/lit/reference/interfaces/FetchQueryOptions.md b/docs/framework/lit/reference/interfaces/FetchQueryOptions.md index 709ddd27897..561b68de853 100644 --- a/docs/framework/lit/reference/interfaces/FetchQueryOptions.md +++ b/docs/framework/lit/reference/interfaces/FetchQueryOptions.md @@ -3,7 +3,7 @@ id: FetchQueryOptions title: FetchQueryOptions --- -Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L587) +Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) ## Deprecated @@ -45,12 +45,13 @@ Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -72,7 +73,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -95,7 +96,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -113,7 +114,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) +Defined in: [packages/query-core/src/types.ts:605](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L605) *** @@ -123,7 +124,7 @@ Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -141,7 +142,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -160,7 +161,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -182,7 +185,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -203,7 +206,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -225,7 +228,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -244,7 +247,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -267,7 +270,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -308,7 +311,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -318,6 +321,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -332,7 +337,7 @@ WithRequired.retryDelay optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) +Defined in: [packages/query-core/src/types.ts:610](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L610) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -345,7 +350,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult.md index 9195e0727f8..0aa01962aa5 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L991) +Defined in: [packages/query-core/src/types.ts:1001](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1001) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:771](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L771) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) +Defined in: [packages/query-core/src/types.ts:804](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L804) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) +Defined in: [packages/query-core/src/types.ts:827](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L827) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) +Defined in: [packages/query-core/src/types.ts:845](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L845) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) +Defined in: [packages/query-core/src/types.ts:849](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L849) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 2841b5ab116..f5e3352f27c 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) +Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1076](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1076) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1077](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1077) +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult.md index 95ff84b3ef3..b7aa67744c0 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverOptions.md index 90f19ed98b5..404c8e34519 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverOptions.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverOptions title: InfiniteQueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L531) +Defined in: [packages/query-core/src/types.ts:539](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L539) ## Extends @@ -39,7 +39,7 @@ Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/q optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -59,12 +59,13 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -82,7 +83,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -99,7 +100,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -118,7 +119,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -139,7 +140,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -155,7 +156,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from @@ -169,7 +170,7 @@ Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -185,7 +186,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -202,7 +203,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -222,13 +225,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -242,7 +247,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -261,7 +266,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -279,7 +284,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -299,7 +304,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -316,7 +321,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -337,7 +342,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -353,7 +358,7 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -372,9 +377,10 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -389,7 +395,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -410,7 +416,7 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -431,7 +437,7 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -473,7 +479,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -483,6 +489,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) @@ -495,7 +503,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -514,7 +522,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -543,7 +551,7 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -564,7 +572,7 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -583,7 +591,7 @@ Defaults to `true`. optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -602,7 +610,7 @@ Defaults to `false`. optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult.md index c3e8b022cdb..a09301ab6c4 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1042](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1042) +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index e62579744ba..58193a987d1 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) +Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) +Defined in: [packages/query-core/src/types.ts:1136](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1136) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) +Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1133](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1133) +Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1128) +Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1129](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1129) +Defined in: [packages/query-core/src/types.ts:1139](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1139) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) +Defined in: [packages/query-core/src/types.ts:1137](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1137) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1132](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1132) +Defined in: [packages/query-core/src/types.ts:1142](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1142) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) +Defined in: [packages/query-core/src/types.ts:1140](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1140) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) +Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) +Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index a67e877f083..4ce469bceed 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1094](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1094) +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 0b875662cbc..131f6d01ae7 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) +Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) +Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) +Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) +Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) +Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/lit/reference/interfaces/InfiniteQueryPageParamsOptions.md index afe27785edc..c091cc15456 100644 --- a/docs/framework/lit/reference/interfaces/InfiniteQueryPageParamsOptions.md +++ b/docs/framework/lit/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryPageParamsOptions title: InfiniteQueryPageParamsOptions --- -Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L347) +Defined in: [packages/query-core/src/types.ts:352](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L352) ## Extends @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/q getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -44,7 +44,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -57,7 +57,7 @@ The result will also be used to determine the value of `hasPreviousPage`. initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from diff --git a/docs/framework/lit/reference/interfaces/InitialPageParam.md b/docs/framework/lit/reference/interfaces/InitialPageParam.md index 2d42bf029a4..46d2b219ea4 100644 --- a/docs/framework/lit/reference/interfaces/InitialPageParam.md +++ b/docs/framework/lit/reference/interfaces/InitialPageParam.md @@ -3,7 +3,7 @@ id: InitialPageParam title: InitialPageParam --- -Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L343) +Defined in: [packages/query-core/src/types.ts:348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L348) ## Extended by @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/q initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) diff --git a/docs/framework/lit/reference/interfaces/InvalidateOptions.md b/docs/framework/lit/reference/interfaces/InvalidateOptions.md index d83ecd43ec0..8a81428b035 100644 --- a/docs/framework/lit/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/lit/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) +Defined in: [packages/query-core/src/types.ts:734](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L734) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,9 +37,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/lit/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/lit/reference/interfaces/InvalidateQueryFilters.md index 36eb3f27998..569e42a4e1b 100644 --- a/docs/framework/lit/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/lit/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) +Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -100,9 +100,10 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:717](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L717) +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) Controls which of the matched (now-invalidated) queries are refetched in the background. + Defaults to `'active'`. - `'active'`: only queries with at least one active observer are refetched. - `'inactive'`: only queries with no active observer are refetched. diff --git a/docs/framework/lit/reference/interfaces/MutateOptions.md b/docs/framework/lit/reference/interfaces/MutateOptions.md index b12b3b29ec2..34e2a4d4d7e 100644 --- a/docs/framework/lit/reference/interfaces/MutateOptions.md +++ b/docs/framework/lit/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) +Defined in: [packages/query-core/src/types.ts:1284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1284) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) +Defined in: [packages/query-core/src/types.ts:1296](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1296) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1282) +Defined in: [packages/query-core/src/types.ts:1302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1302) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1270](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1270) +Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) #### Parameters diff --git a/docs/framework/lit/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/lit/reference/interfaces/MutationObserverBaseResult.md index e1c09a56737..340a38cc9cc 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1315) +Defined in: [packages/query-core/src/types.ts:1335](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1335) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1324](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1324) +Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1333](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1333) +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) +Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) +Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) +Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1328](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1328) +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) The variables object passed to the `mutationFn`. diff --git a/docs/framework/lit/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/lit/reference/interfaces/MutationObserverErrorResult.md index cce591e3465..72e459a2e0b 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) +Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) +Defined in: [packages/query-core/src/types.ts:1453](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1453) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) +Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) +Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) +Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) +Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) The variables object passed to the `mutationFn`. diff --git a/docs/framework/lit/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/lit/reference/interfaces/MutationObserverIdleResult.md index b7892846a6c..cd8d6eb3130 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) +Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) +Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1394](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1394) +Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) +Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1396](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1396) +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) +Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) +Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) The variables object passed to the `mutationFn`. diff --git a/docs/framework/lit/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/lit/reference/interfaces/MutationObserverLoadingResult.md index d4368822213..9b70a8558e7 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) +Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) +Defined in: [packages/query-core/src/types.ts:1432](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1432) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) +Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) +Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) +Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) The variables object passed to the `mutationFn`. diff --git a/docs/framework/lit/reference/interfaces/MutationObserverOptions.md b/docs/framework/lit/reference/interfaces/MutationObserverOptions.md index 1e609be9bf1..5bab2840a6d 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1255) +Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) ## Extends @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) +Defined in: [packages/query-core/src/types.ts:1260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1260) The time in milliseconds that an unused/inactive mutation remains in memory before it is garbage collected. @@ -54,7 +54,7 @@ Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) +Defined in: [packages/query-core/src/types.ts:1263](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1263) #### Inherited from @@ -68,7 +68,7 @@ Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) +Defined in: [packages/query-core/src/types.ts:1206](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1206) #### Inherited from @@ -82,7 +82,7 @@ Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) #### Inherited from @@ -96,7 +96,9 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1253](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1253) + +Controls whether a mutation is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -116,7 +118,7 @@ Defaults to `'online'`. optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) +Defined in: [packages/query-core/src/types.ts:1218](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1218) #### Parameters @@ -152,7 +154,7 @@ Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -180,7 +182,7 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) +Defined in: [packages/query-core/src/types.ts:1224](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1224) #### Parameters @@ -220,7 +222,7 @@ Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Parameters @@ -256,7 +258,7 @@ Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1239](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1239) If `false`, failed mutations will not retry by default. If `true`, failed mutations will retry infinitely. @@ -277,7 +279,7 @@ Defaults to `0`. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) +Defined in: [packages/query-core/src/types.ts:1246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1246) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -296,7 +298,7 @@ Defaults to a function that applies exponential backoff, capped at 30 seconds. optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) #### Inherited from @@ -310,4 +312,11 @@ Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) +Defined in: [packages/query-core/src/types.ts:1281](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1281) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true`, all errors will be thrown to the nearest error boundary. +If set to a function, it will be passed the error and should return a boolean indicating whether to throw the +error (`true`) or return it as state (`false`). + +Defaults to `false`. diff --git a/docs/framework/lit/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/lit/reference/interfaces/MutationObserverSuccessResult.md index 52cdcc4883e..e2e03642f82 100644 --- a/docs/framework/lit/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/lit/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) +Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) +Defined in: [packages/query-core/src/types.ts:1474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1474) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) +Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) +Defined in: [packages/query-core/src/types.ts:1478](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1478) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) +Defined in: [packages/query-core/src/types.ts:1479](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1479) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) +Defined in: [packages/query-core/src/types.ts:1480](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1480) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1481](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1481) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) +Defined in: [packages/query-core/src/types.ts:1476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1476) The variables object passed to the `mutationFn`. diff --git a/docs/framework/lit/reference/interfaces/MutationOptions.md b/docs/framework/lit/reference/interfaces/MutationOptions.md index 49f2b8f4f19..5aabeeb0ca4 100644 --- a/docs/framework/lit/reference/interfaces/MutationOptions.md +++ b/docs/framework/lit/reference/interfaces/MutationOptions.md @@ -3,7 +3,7 @@ id: MutationOptions title: MutationOptions --- -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) ## Extended by @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) +Defined in: [packages/query-core/src/types.ts:1260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1260) The time in milliseconds that an unused/inactive mutation remains in memory before it is garbage collected. @@ -50,7 +50,7 @@ Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) +Defined in: [packages/query-core/src/types.ts:1263](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1263) *** @@ -60,7 +60,7 @@ Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) +Defined in: [packages/query-core/src/types.ts:1206](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1206) *** @@ -70,7 +70,7 @@ Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) *** @@ -80,7 +80,9 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1253](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1253) + +Controls whether a mutation is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -96,7 +98,7 @@ Defaults to `'online'`. optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) +Defined in: [packages/query-core/src/types.ts:1218](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1218) #### Parameters @@ -128,7 +130,7 @@ Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -152,7 +154,7 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) +Defined in: [packages/query-core/src/types.ts:1224](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1224) #### Parameters @@ -188,7 +190,7 @@ Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Parameters @@ -220,7 +222,7 @@ Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1239](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1239) If `false`, failed mutations will not retry by default. If `true`, failed mutations will retry infinitely. @@ -237,7 +239,7 @@ Defaults to `0`. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) +Defined in: [packages/query-core/src/types.ts:1246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1246) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -252,4 +254,4 @@ Defaults to a function that applies exponential backoff, capped at 30 seconds. optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) diff --git a/docs/framework/lit/reference/interfaces/NotifyEvent.md b/docs/framework/lit/reference/interfaces/NotifyEvent.md index 5e7875d41b8..4f5b023f49a 100644 --- a/docs/framework/lit/reference/interfaces/NotifyEvent.md +++ b/docs/framework/lit/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1519) +Defined in: [packages/query-core/src/types.ts:1539](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1539) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1520) +Defined in: [packages/query-core/src/types.ts:1540](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1540) diff --git a/docs/framework/lit/reference/interfaces/QueryClientConfig.md b/docs/framework/lit/reference/interfaces/QueryClientConfig.md index 411eb0b2fb2..070e249491f 100644 --- a/docs/framework/lit/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/lit/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) +Defined in: [packages/query-core/src/types.ts:1495](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1495) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/ optional defaultOptions: DefaultOptions; ``` -Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) +Defined in: [packages/query-core/src/types.ts:1504](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1504) Default options for all queries and mutations created through this client. @@ -25,7 +25,7 @@ Default options for all queries and mutations created through this client. optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1482) +Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) The mutation cache this client is connected to. A new `MutationCache` is created if not provided. @@ -38,6 +38,6 @@ provided. optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) +Defined in: [packages/query-core/src/types.ts:1497](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1497) The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/lit/reference/interfaces/QueryExecuteOptions.md b/docs/framework/lit/reference/interfaces/QueryExecuteOptions.md index 388889fb6e7..0b20b761718 100644 --- a/docs/framework/lit/reference/interfaces/QueryExecuteOptions.md +++ b/docs/framework/lit/reference/interfaces/QueryExecuteOptions.md @@ -3,7 +3,7 @@ id: QueryExecuteOptions title: QueryExecuteOptions --- -Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) +Defined in: [packages/query-core/src/types.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L574) ## Extends @@ -43,12 +43,13 @@ Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -70,7 +71,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -93,7 +94,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -111,7 +112,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L577) +Defined in: [packages/query-core/src/types.ts:585](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L585) *** @@ -121,7 +122,7 @@ Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -139,7 +140,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -158,7 +159,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -180,7 +183,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -201,7 +204,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -223,7 +226,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -242,7 +245,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -265,7 +268,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -306,7 +309,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -316,6 +319,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -330,7 +335,7 @@ WithRequired.retryDelay optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L578) +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) #### Parameters @@ -350,7 +355,7 @@ Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:583](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L583) +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -363,7 +368,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/lit/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/lit/reference/interfaces/QueryObserverBaseResult.md index 1b54d6f8041..ef5fe0ad757 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:764](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L764) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:771](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L771) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) +Defined in: [packages/query-core/src/types.ts:804](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L804) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) +Defined in: [packages/query-core/src/types.ts:827](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L827) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) +Defined in: [packages/query-core/src/types.ts:845](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L845) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) +Defined in: [packages/query-core/src/types.ts:849](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L849) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/lit/reference/interfaces/QueryObserverLoadingErrorResult.md index 7a4f855305f..21b39fbffe3 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) +Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/lit/reference/interfaces/QueryObserverLoadingResult.md index 8f94574bcca..4966390127f 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) +Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverOptions.md b/docs/framework/lit/reference/interfaces/QueryObserverOptions.md index c5c6bb0a300..3d6dc9c42ce 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverOptions.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverOptions.md @@ -3,7 +3,7 @@ id: QueryObserverOptions title: QueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L375) +Defined in: [packages/query-core/src/types.ts:380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L380) ## Extends @@ -47,7 +47,7 @@ Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/q optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -63,12 +63,13 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -90,7 +91,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -113,7 +114,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -131,7 +132,7 @@ WithRequired.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -149,7 +150,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -168,7 +169,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -190,13 +193,15 @@ WithRequired.networkMode optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. *** @@ -206,7 +211,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -227,7 +232,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -241,7 +246,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -263,7 +268,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -282,7 +287,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -305,7 +310,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -323,7 +328,7 @@ WithRequired.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -338,9 +343,10 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. *** @@ -351,7 +357,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -368,7 +374,7 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -385,7 +391,7 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -425,7 +431,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -435,6 +441,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -449,7 +457,7 @@ WithRequired.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -464,7 +472,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -489,7 +497,7 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -506,7 +514,7 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -527,7 +535,7 @@ WithRequired.structuralSharing optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -542,7 +550,7 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/lit/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/lit/reference/interfaces/QueryObserverPendingResult.md index 41a101c7c8c..8f00c426b64 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:887](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L887) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L888) +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) +Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/lit/reference/interfaces/QueryObserverPlaceholderResult.md index cce7cffcc9b..bbf3da387f9 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) +Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) +Defined in: [packages/query-core/src/types.ts:975](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L975) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) +Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) +Defined in: [packages/query-core/src/types.ts:976](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L976) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:969](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L969) +Defined in: [packages/query-core/src/types.ts:979](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L979) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L970) +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) +Defined in: [packages/query-core/src/types.ts:978](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L978) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) +Defined in: [packages/query-core/src/types.ts:983](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L983) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) +Defined in: [packages/query-core/src/types.ts:981](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L981) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:972](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L972) +Defined in: [packages/query-core/src/types.ts:982](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L982) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/lit/reference/interfaces/QueryObserverRefetchErrorResult.md index 8486e8cf4cb..345ecab35e1 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) +Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/lit/reference/interfaces/QueryObserverSuccessResult.md index f126bea0f70..3942655c627 100644 --- a/docs/framework/lit/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/lit/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) +Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) +Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) +Defined in: [packages/query-core/src/types.ts:964](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L964) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) +Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) +Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) +Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) The status of the query. - Will be: diff --git a/docs/framework/lit/reference/interfaces/QueryOptions.md b/docs/framework/lit/reference/interfaces/QueryOptions.md index 93fe7ee24b9..8d6124d5688 100644 --- a/docs/framework/lit/reference/interfaces/QueryOptions.md +++ b/docs/framework/lit/reference/interfaces/QueryOptions.md @@ -35,12 +35,13 @@ Defined in: [packages/query-core/src/types.ts:231](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -56,7 +57,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -73,7 +74,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -85,7 +86,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -97,7 +98,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -110,7 +111,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -126,7 +129,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -141,7 +144,7 @@ optional queryFn: | typeof skipToken; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -157,7 +160,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -170,7 +173,7 @@ as the actual cache key internally. optional queryKey: TQueryKey; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -187,7 +190,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -216,7 +219,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -226,6 +229,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + *** ### structuralSharing? @@ -234,7 +239,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/lit/reference/interfaces/RefetchOptions.md b/docs/framework/lit/reference/interfaces/RefetchOptions.md index 104412c5bac..cfcc0498799 100644 --- a/docs/framework/lit/reference/interfaces/RefetchOptions.md +++ b/docs/framework/lit/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) +Defined in: [packages/query-core/src/types.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L704) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,9 +38,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/lit/reference/interfaces/RefetchQueryFilters.md b/docs/framework/lit/reference/interfaces/RefetchQueryFilters.md index bde28360fa1..c45dfa953f1 100644 --- a/docs/framework/lit/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/lit/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:720](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L720) +Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. diff --git a/docs/framework/lit/reference/interfaces/ResetOptions.md b/docs/framework/lit/reference/interfaces/ResetOptions.md index 6d3a8398fbb..9f12324ba27 100644 --- a/docs/framework/lit/reference/interfaces/ResetOptions.md +++ b/docs/framework/lit/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) +Defined in: [packages/query-core/src/types.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L735) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,9 +37,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/lit/reference/interfaces/ResultOptions.md b/docs/framework/lit/reference/interfaces/ResultOptions.md index f3da151a3ec..42917f20bf0 100644 --- a/docs/framework/lit/reference/interfaces/ResultOptions.md +++ b/docs/framework/lit/reference/interfaces/ResultOptions.md @@ -3,7 +3,7 @@ id: ResultOptions title: ResultOptions --- -Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L686) +Defined in: [packages/query-core/src/types.ts:694](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L694) ## Extended by @@ -19,8 +19,9 @@ Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/lit/reference/interfaces/SetDataOptions.md b/docs/framework/lit/reference/interfaces/SetDataOptions.md index cac83e9312a..bb668fbf162 100644 --- a/docs/framework/lit/reference/interfaces/SetDataOptions.md +++ b/docs/framework/lit/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1506) +Defined in: [packages/query-core/src/types.ts:1526](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1526) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) +Defined in: [packages/query-core/src/types.ts:1527](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1527) diff --git a/docs/framework/lit/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/lit/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md index 4412ad00c8e..82c7ddbb886 100644 --- a/docs/framework/lit/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md +++ b/docs/framework/lit/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedInfiniteQueryObserverOptions type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:549](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L549) +Defined in: [packages/query-core/src/types.ts:557](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L557) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/lit/reference/type-aliases/DefaultedQueryObserverOptions.md index 9ce8401b128..7687d8c24f6 100644 --- a/docs/framework/lit/reference/type-aliases/DefaultedQueryObserverOptions.md +++ b/docs/framework/lit/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedQueryObserverOptions type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) +Defined in: [packages/query-core/src/types.ts:528](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L528) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index b39c86d6d91..605bf55cec2 100644 --- a/docs/framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/lit/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) +Defined in: [packages/query-core/src/types.ts:1148](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1148) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/lit/reference/type-aliases/DefinedQueryObserverResult.md index 98eef146e62..f863eaa925e 100644 --- a/docs/framework/lit/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/lit/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/lit/reference/type-aliases/EnsureInfiniteQueryDataOptions.md index ff75b1c3449..7648331fca2 100644 --- a/docs/framework/lit/reference/type-aliases/EnsureInfiniteQueryDataOptions.md +++ b/docs/framework/lit/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -7,7 +7,7 @@ title: EnsureInfiniteQueryDataOptions type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; ``` -Defined in: [packages/query-core/src/types.ts:623](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L623) +Defined in: [packages/query-core/src/types.ts:631](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L631) ## Type Declaration diff --git a/docs/framework/lit/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/lit/reference/type-aliases/FetchInfiniteQueryOptions.md index c926bbd3ae5..d00a2455889 100644 --- a/docs/framework/lit/reference/type-aliases/FetchInfiniteQueryOptions.md +++ b/docs/framework/lit/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: FetchInfiniteQueryOptions type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:667](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L667) +Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/FetchStatus.md b/docs/framework/lit/reference/type-aliases/FetchStatus.md index b347069e97e..d50002355ca 100644 --- a/docs/framework/lit/reference/type-aliases/FetchStatus.md +++ b/docs/framework/lit/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:752](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L752) +Defined in: [packages/query-core/src/types.ts:762](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L762) diff --git a/docs/framework/lit/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/lit/reference/type-aliases/InfiniteQueryExecuteOptions.md index c198662a319..259c97c96bb 100644 --- a/docs/framework/lit/reference/type-aliases/InfiniteQueryExecuteOptions.md +++ b/docs/framework/lit/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -7,7 +7,7 @@ title: InfiniteQueryExecuteOptions type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:646](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L646) +Defined in: [packages/query-core/src/types.ts:654](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L654) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/lit/reference/type-aliases/InfiniteQueryObserverResult.md index 10b04a8ef45..bf5e086a190 100644 --- a/docs/framework/lit/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/lit/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/MutateFunction.md b/docs/framework/lit/reference/type-aliases/MutateFunction.md index 558040d3439..e12b7a80291 100644 --- a/docs/framework/lit/reference/type-aliases/MutateFunction.md +++ b/docs/framework/lit/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1306](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1306) +Defined in: [packages/query-core/src/types.ts:1326](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1326) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/MutateFunctionRest.md b/docs/framework/lit/reference/type-aliases/MutateFunctionRest.md index 3e7a5217482..3902f1082f9 100644 --- a/docs/framework/lit/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/lit/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1291](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1291) +Defined in: [packages/query-core/src/types.ts:1311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1311) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/MutationFunction.md b/docs/framework/lit/reference/type-aliases/MutationFunction.md index 330af1ef65a..9bafb3db56b 100644 --- a/docs/framework/lit/reference/type-aliases/MutationFunction.md +++ b/docs/framework/lit/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1195](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1195) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/MutationFunctionContext.md b/docs/framework/lit/reference/type-aliases/MutationFunctionContext.md index 97de2f1c220..0207256c702 100644 --- a/docs/framework/lit/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/lit/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) +Defined in: [packages/query-core/src/types.ts:1189](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1189) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1180) +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1182](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1182) +Defined in: [packages/query-core/src/types.ts:1192](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1192) diff --git a/docs/framework/lit/reference/type-aliases/MutationKey.md b/docs/framework/lit/reference/type-aliases/MutationKey.md index 8e9d3bc3b3a..9d1d7f0f77b 100644 --- a/docs/framework/lit/reference/type-aliases/MutationKey.md +++ b/docs/framework/lit/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) +Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) diff --git a/docs/framework/lit/reference/type-aliases/MutationMeta.md b/docs/framework/lit/reference/type-aliases/MutationMeta.md index 474c593e206..ff1f9b4bf94 100644 --- a/docs/framework/lit/reference/type-aliases/MutationMeta.md +++ b/docs/framework/lit/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) +Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) diff --git a/docs/framework/lit/reference/type-aliases/MutationObserverResult.md b/docs/framework/lit/reference/type-aliases/MutationObserverResult.md index 9e77b88ccb5..c865ae31c27 100644 --- a/docs/framework/lit/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/lit/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1464](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1464) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/MutationScope.md b/docs/framework/lit/reference/type-aliases/MutationScope.md index feac9d9d17a..1d6a91bd434 100644 --- a/docs/framework/lit/reference/type-aliases/MutationScope.md +++ b/docs/framework/lit/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1167) +Defined in: [packages/query-core/src/types.ts:1177](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1177) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) diff --git a/docs/framework/lit/reference/type-aliases/MutationStatus.md b/docs/framework/lit/reference/type-aliases/MutationStatus.md index 4cd2d3c9535..cf12d3d3ee3 100644 --- a/docs/framework/lit/reference/type-aliases/MutationStatus.md +++ b/docs/framework/lit/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) +Defined in: [packages/query-core/src/types.ts:1175](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1175) diff --git a/docs/framework/lit/reference/type-aliases/NotifyEventType.md b/docs/framework/lit/reference/type-aliases/NotifyEventType.md index 86fc4759cca..b87340530c4 100644 --- a/docs/framework/lit/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/lit/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1510](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1510) +Defined in: [packages/query-core/src/types.ts:1530](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1530) diff --git a/docs/framework/lit/reference/type-aliases/QueryObserverResult.md b/docs/framework/lit/reference/type-aliases/QueryObserverResult.md index fb68f3c291a..3891bca3da3 100644 --- a/docs/framework/lit/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/lit/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/QueryStatus.md b/docs/framework/lit/reference/type-aliases/QueryStatus.md index 6679b8b17c6..bab00f6f423 100644 --- a/docs/framework/lit/reference/type-aliases/QueryStatus.md +++ b/docs/framework/lit/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:751](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L751) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) diff --git a/docs/framework/lit/reference/type-aliases/ThrowOnError.md b/docs/framework/lit/reference/type-aliases/ThrowOnError.md index 613549e4d52..134683388ef 100644 --- a/docs/framework/lit/reference/type-aliases/ThrowOnError.md +++ b/docs/framework/lit/reference/type-aliases/ThrowOnError.md @@ -7,7 +7,7 @@ title: ThrowOnError type ThrowOnError = boolean | (error, query) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L363) +Defined in: [packages/query-core/src/types.ts:368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L368) ## Type Parameters diff --git a/docs/framework/lit/reference/type-aliases/WithRequired.md b/docs/framework/lit/reference/type-aliases/WithRequired.md index deb87dfe4a4..a40a48c865b 100644 --- a/docs/framework/lit/reference/type-aliases/WithRequired.md +++ b/docs/framework/lit/reference/type-aliases/WithRequired.md @@ -7,7 +7,7 @@ title: WithRequired type WithRequired = TTarget & { [_ in TKey]: {} }; ``` -Defined in: [packages/query-core/src/types.ts:516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L516) +Defined in: [packages/query-core/src/types.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L524) ## Type Parameters diff --git a/docs/framework/preact/reference/interfaces/CancelOptions.md b/docs/framework/preact/reference/interfaces/CancelOptions.md index f52c729f3b1..b7464c48e50 100644 --- a/docs/framework/preact/reference/interfaces/CancelOptions.md +++ b/docs/framework/preact/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1501) +Defined in: [packages/query-core/src/types.ts:1521](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1521) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) +Defined in: [packages/query-core/src/types.ts:1522](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1522) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1503) +Defined in: [packages/query-core/src/types.ts:1523](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1523) diff --git a/docs/framework/preact/reference/interfaces/DefaultOptions.md b/docs/framework/preact/reference/interfaces/DefaultOptions.md index 67ae012f9ee..e45a56f075f 100644 --- a/docs/framework/preact/reference/interfaces/DefaultOptions.md +++ b/docs/framework/preact/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1487) +Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) ## Type Parameters @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/ optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1498](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1498) +Defined in: [packages/query-core/src/types.ts:1518](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1518) Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). @@ -31,7 +31,7 @@ Default options used when dehydrating the client's caches; see [DehydrateOptions optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1496](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1496) +Defined in: [packages/query-core/src/types.ts:1516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1516) Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). @@ -67,7 +67,7 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1494](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1494) +Defined in: [packages/query-core/src/types.ts:1514](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1514) Default options applied to every mutation, unless overridden per-mutation. @@ -79,6 +79,6 @@ Default options applied to every mutation, unless overridden per-mutation. optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: [packages/query-core/src/types.ts:1489](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1489) +Defined in: [packages/query-core/src/types.ts:1509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1509) Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/preact/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/preact/reference/interfaces/EnsureQueryDataOptions.md index d71a60902e6..a67082af57e 100644 --- a/docs/framework/preact/reference/interfaces/EnsureQueryDataOptions.md +++ b/docs/framework/preact/reference/interfaces/EnsureQueryDataOptions.md @@ -3,7 +3,7 @@ id: EnsureQueryDataOptions title: EnsureQueryDataOptions --- -Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L606) +Defined in: [packages/query-core/src/types.ts:614](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L614) ## Deprecated @@ -41,12 +41,13 @@ Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -66,7 +67,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -87,7 +88,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -103,7 +104,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) +Defined in: [packages/query-core/src/types.ts:605](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L605) #### Inherited from @@ -117,7 +118,7 @@ Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -133,7 +134,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -150,7 +151,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -170,7 +173,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -189,7 +192,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -209,7 +212,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -226,7 +229,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -247,7 +250,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -284,7 +287,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -294,6 +297,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`FetchQueryOptions`](FetchQueryOptions.md).[`retryDelay`](FetchQueryOptions.md#retrydelay) @@ -306,7 +311,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional revalidateIfStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L619) +Defined in: [packages/query-core/src/types.ts:627](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L627) *** @@ -316,7 +321,7 @@ Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) +Defined in: [packages/query-core/src/types.ts:610](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L610) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -333,7 +338,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/preact/reference/interfaces/FetchNextPageOptions.md b/docs/framework/preact/reference/interfaces/FetchNextPageOptions.md index 2c0be977140..b79cdbe19b3 100644 --- a/docs/framework/preact/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/preact/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:736](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L736) +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,9 +34,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/preact/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/preact/reference/interfaces/FetchPreviousPageOptions.md index 683e789ee52..fd5a08767b6 100644 --- a/docs/framework/preact/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/preact/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L739) +Defined in: [packages/query-core/src/types.ts:749](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L749) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:748](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L748) +Defined in: [packages/query-core/src/types.ts:758](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L758) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,9 +34,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/preact/reference/interfaces/FetchQueryOptions.md b/docs/framework/preact/reference/interfaces/FetchQueryOptions.md index 634ae0e09f9..b00973badc0 100644 --- a/docs/framework/preact/reference/interfaces/FetchQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/FetchQueryOptions.md @@ -3,7 +3,7 @@ id: FetchQueryOptions title: FetchQueryOptions --- -Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L587) +Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) ## Deprecated @@ -45,12 +45,13 @@ Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -72,7 +73,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -95,7 +96,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -113,7 +114,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) +Defined in: [packages/query-core/src/types.ts:605](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L605) *** @@ -123,7 +124,7 @@ Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -141,7 +142,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -160,7 +161,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -182,7 +185,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -203,7 +206,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -225,7 +228,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -244,7 +247,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -267,7 +270,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -308,7 +311,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -318,6 +321,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -332,7 +337,7 @@ WithRequired.retryDelay optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) +Defined in: [packages/query-core/src/types.ts:610](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L610) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -345,7 +350,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult.md index 9195e0727f8..0aa01962aa5 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L991) +Defined in: [packages/query-core/src/types.ts:1001](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1001) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:771](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L771) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) +Defined in: [packages/query-core/src/types.ts:804](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L804) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) +Defined in: [packages/query-core/src/types.ts:827](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L827) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) +Defined in: [packages/query-core/src/types.ts:845](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L845) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) +Defined in: [packages/query-core/src/types.ts:849](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L849) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 2841b5ab116..f5e3352f27c 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) +Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1076](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1076) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1077](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1077) +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult.md index 95ff84b3ef3..b7aa67744c0 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverOptions.md index 7d5b0dd1a4d..7670bd8e24b 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverOptions.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverOptions title: InfiniteQueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L531) +Defined in: [packages/query-core/src/types.ts:539](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L539) ## Extends @@ -39,7 +39,7 @@ Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/q optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -59,12 +59,13 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -82,7 +83,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -99,7 +100,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -118,7 +119,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -139,7 +140,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -155,7 +156,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from @@ -169,7 +170,7 @@ Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -185,7 +186,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -202,7 +203,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -222,13 +225,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -242,7 +247,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -261,7 +266,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -279,7 +284,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -299,7 +304,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -316,7 +321,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -337,7 +342,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -353,7 +358,7 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -372,9 +377,10 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -389,7 +395,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -410,7 +416,7 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -431,7 +437,7 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -473,7 +479,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -483,6 +489,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) @@ -495,7 +503,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -514,7 +522,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -543,7 +551,7 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -564,7 +572,7 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -583,7 +591,7 @@ Defaults to `true`. optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -602,7 +610,7 @@ Defaults to `false`. optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult.md index c3e8b022cdb..a09301ab6c4 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1042](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1042) +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index e62579744ba..58193a987d1 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) +Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) +Defined in: [packages/query-core/src/types.ts:1136](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1136) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) +Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1133](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1133) +Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1128) +Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1129](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1129) +Defined in: [packages/query-core/src/types.ts:1139](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1139) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) +Defined in: [packages/query-core/src/types.ts:1137](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1137) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1132](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1132) +Defined in: [packages/query-core/src/types.ts:1142](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1142) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) +Defined in: [packages/query-core/src/types.ts:1140](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1140) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) +Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) +Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index a67e877f083..4ce469bceed 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1094](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1094) +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 0b875662cbc..131f6d01ae7 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) +Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) +Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) +Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) +Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) +Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/preact/reference/interfaces/InfiniteQueryPageParamsOptions.md index afe27785edc..c091cc15456 100644 --- a/docs/framework/preact/reference/interfaces/InfiniteQueryPageParamsOptions.md +++ b/docs/framework/preact/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryPageParamsOptions title: InfiniteQueryPageParamsOptions --- -Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L347) +Defined in: [packages/query-core/src/types.ts:352](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L352) ## Extends @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/q getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -44,7 +44,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -57,7 +57,7 @@ The result will also be used to determine the value of `hasPreviousPage`. initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/InitialPageParam.md b/docs/framework/preact/reference/interfaces/InitialPageParam.md index 2d42bf029a4..46d2b219ea4 100644 --- a/docs/framework/preact/reference/interfaces/InitialPageParam.md +++ b/docs/framework/preact/reference/interfaces/InitialPageParam.md @@ -3,7 +3,7 @@ id: InitialPageParam title: InitialPageParam --- -Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L343) +Defined in: [packages/query-core/src/types.ts:348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L348) ## Extended by @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/q initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) diff --git a/docs/framework/preact/reference/interfaces/InvalidateOptions.md b/docs/framework/preact/reference/interfaces/InvalidateOptions.md index d83ecd43ec0..8a81428b035 100644 --- a/docs/framework/preact/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/preact/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) +Defined in: [packages/query-core/src/types.ts:734](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L734) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,9 +37,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/preact/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/preact/reference/interfaces/InvalidateQueryFilters.md index 36eb3f27998..569e42a4e1b 100644 --- a/docs/framework/preact/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/preact/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) +Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -100,9 +100,10 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:717](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L717) +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) Controls which of the matched (now-invalidated) queries are refetched in the background. + Defaults to `'active'`. - `'active'`: only queries with at least one active observer are refetched. - `'inactive'`: only queries with no active observer are refetched. diff --git a/docs/framework/preact/reference/interfaces/MutateOptions.md b/docs/framework/preact/reference/interfaces/MutateOptions.md index b12b3b29ec2..34e2a4d4d7e 100644 --- a/docs/framework/preact/reference/interfaces/MutateOptions.md +++ b/docs/framework/preact/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) +Defined in: [packages/query-core/src/types.ts:1284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1284) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) +Defined in: [packages/query-core/src/types.ts:1296](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1296) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1282) +Defined in: [packages/query-core/src/types.ts:1302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1302) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1270](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1270) +Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) #### Parameters diff --git a/docs/framework/preact/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/preact/reference/interfaces/MutationObserverBaseResult.md index e1c09a56737..340a38cc9cc 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1315) +Defined in: [packages/query-core/src/types.ts:1335](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1335) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1324](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1324) +Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1333](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1333) +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) +Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) +Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) +Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1328](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1328) +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) The variables object passed to the `mutationFn`. diff --git a/docs/framework/preact/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/preact/reference/interfaces/MutationObserverErrorResult.md index cce591e3465..72e459a2e0b 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) +Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) +Defined in: [packages/query-core/src/types.ts:1453](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1453) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) +Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) +Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) +Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) +Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) The variables object passed to the `mutationFn`. diff --git a/docs/framework/preact/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/preact/reference/interfaces/MutationObserverIdleResult.md index b7892846a6c..cd8d6eb3130 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) +Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) +Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1394](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1394) +Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) +Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1396](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1396) +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) +Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) +Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) The variables object passed to the `mutationFn`. diff --git a/docs/framework/preact/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/preact/reference/interfaces/MutationObserverLoadingResult.md index d4368822213..9b70a8558e7 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) +Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) +Defined in: [packages/query-core/src/types.ts:1432](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1432) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) +Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) +Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) +Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) The variables object passed to the `mutationFn`. diff --git a/docs/framework/preact/reference/interfaces/MutationObserverOptions.md b/docs/framework/preact/reference/interfaces/MutationObserverOptions.md index 1e609be9bf1..5bab2840a6d 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1255) +Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) ## Extends @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) +Defined in: [packages/query-core/src/types.ts:1260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1260) The time in milliseconds that an unused/inactive mutation remains in memory before it is garbage collected. @@ -54,7 +54,7 @@ Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) +Defined in: [packages/query-core/src/types.ts:1263](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1263) #### Inherited from @@ -68,7 +68,7 @@ Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) +Defined in: [packages/query-core/src/types.ts:1206](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1206) #### Inherited from @@ -82,7 +82,7 @@ Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) #### Inherited from @@ -96,7 +96,9 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1253](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1253) + +Controls whether a mutation is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -116,7 +118,7 @@ Defaults to `'online'`. optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) +Defined in: [packages/query-core/src/types.ts:1218](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1218) #### Parameters @@ -152,7 +154,7 @@ Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -180,7 +182,7 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) +Defined in: [packages/query-core/src/types.ts:1224](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1224) #### Parameters @@ -220,7 +222,7 @@ Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Parameters @@ -256,7 +258,7 @@ Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1239](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1239) If `false`, failed mutations will not retry by default. If `true`, failed mutations will retry infinitely. @@ -277,7 +279,7 @@ Defaults to `0`. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) +Defined in: [packages/query-core/src/types.ts:1246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1246) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -296,7 +298,7 @@ Defaults to a function that applies exponential backoff, capped at 30 seconds. optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) #### Inherited from @@ -310,4 +312,11 @@ Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) +Defined in: [packages/query-core/src/types.ts:1281](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1281) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true`, all errors will be thrown to the nearest error boundary. +If set to a function, it will be passed the error and should return a boolean indicating whether to throw the +error (`true`) or return it as state (`false`). + +Defaults to `false`. diff --git a/docs/framework/preact/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/preact/reference/interfaces/MutationObserverSuccessResult.md index 52cdcc4883e..e2e03642f82 100644 --- a/docs/framework/preact/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/preact/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) +Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) +Defined in: [packages/query-core/src/types.ts:1474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1474) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) +Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) +Defined in: [packages/query-core/src/types.ts:1478](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1478) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) +Defined in: [packages/query-core/src/types.ts:1479](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1479) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) +Defined in: [packages/query-core/src/types.ts:1480](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1480) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1481](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1481) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) +Defined in: [packages/query-core/src/types.ts:1476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1476) The variables object passed to the `mutationFn`. diff --git a/docs/framework/preact/reference/interfaces/MutationOptions.md b/docs/framework/preact/reference/interfaces/MutationOptions.md index 49f2b8f4f19..5aabeeb0ca4 100644 --- a/docs/framework/preact/reference/interfaces/MutationOptions.md +++ b/docs/framework/preact/reference/interfaces/MutationOptions.md @@ -3,7 +3,7 @@ id: MutationOptions title: MutationOptions --- -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) ## Extended by @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) +Defined in: [packages/query-core/src/types.ts:1260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1260) The time in milliseconds that an unused/inactive mutation remains in memory before it is garbage collected. @@ -50,7 +50,7 @@ Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) +Defined in: [packages/query-core/src/types.ts:1263](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1263) *** @@ -60,7 +60,7 @@ Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) +Defined in: [packages/query-core/src/types.ts:1206](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1206) *** @@ -70,7 +70,7 @@ Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) *** @@ -80,7 +80,9 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1253](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1253) + +Controls whether a mutation is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -96,7 +98,7 @@ Defaults to `'online'`. optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) +Defined in: [packages/query-core/src/types.ts:1218](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1218) #### Parameters @@ -128,7 +130,7 @@ Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -152,7 +154,7 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) +Defined in: [packages/query-core/src/types.ts:1224](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1224) #### Parameters @@ -188,7 +190,7 @@ Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Parameters @@ -220,7 +222,7 @@ Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1239](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1239) If `false`, failed mutations will not retry by default. If `true`, failed mutations will retry infinitely. @@ -237,7 +239,7 @@ Defaults to `0`. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) +Defined in: [packages/query-core/src/types.ts:1246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1246) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -252,4 +254,4 @@ Defaults to a function that applies exponential backoff, capped at 30 seconds. optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) diff --git a/docs/framework/preact/reference/interfaces/NotifyEvent.md b/docs/framework/preact/reference/interfaces/NotifyEvent.md index 5e7875d41b8..4f5b023f49a 100644 --- a/docs/framework/preact/reference/interfaces/NotifyEvent.md +++ b/docs/framework/preact/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1519) +Defined in: [packages/query-core/src/types.ts:1539](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1539) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1520) +Defined in: [packages/query-core/src/types.ts:1540](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1540) diff --git a/docs/framework/preact/reference/interfaces/QueryClientConfig.md b/docs/framework/preact/reference/interfaces/QueryClientConfig.md index 411eb0b2fb2..070e249491f 100644 --- a/docs/framework/preact/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/preact/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) +Defined in: [packages/query-core/src/types.ts:1495](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1495) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/ optional defaultOptions: DefaultOptions; ``` -Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) +Defined in: [packages/query-core/src/types.ts:1504](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1504) Default options for all queries and mutations created through this client. @@ -25,7 +25,7 @@ Default options for all queries and mutations created through this client. optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1482) +Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) The mutation cache this client is connected to. A new `MutationCache` is created if not provided. @@ -38,6 +38,6 @@ provided. optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) +Defined in: [packages/query-core/src/types.ts:1497](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1497) The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/preact/reference/interfaces/QueryExecuteOptions.md b/docs/framework/preact/reference/interfaces/QueryExecuteOptions.md index 1e844c5ba10..23d272eb25f 100644 --- a/docs/framework/preact/reference/interfaces/QueryExecuteOptions.md +++ b/docs/framework/preact/reference/interfaces/QueryExecuteOptions.md @@ -3,7 +3,7 @@ id: QueryExecuteOptions title: QueryExecuteOptions --- -Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) +Defined in: [packages/query-core/src/types.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L574) ## Extends @@ -43,12 +43,13 @@ Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -70,7 +71,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -93,7 +94,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -111,7 +112,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L577) +Defined in: [packages/query-core/src/types.ts:585](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L585) *** @@ -121,7 +122,7 @@ Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -139,7 +140,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -158,7 +159,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -180,7 +183,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -201,7 +204,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -223,7 +226,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -242,7 +245,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -265,7 +268,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -306,7 +309,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -316,6 +319,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -330,7 +335,7 @@ WithRequired.retryDelay optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L578) +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) #### Parameters @@ -350,7 +355,7 @@ Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:583](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L583) +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -363,7 +368,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/preact/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/preact/reference/interfaces/QueryObserverBaseResult.md index 1b54d6f8041..ef5fe0ad757 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:764](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L764) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:771](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L771) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) +Defined in: [packages/query-core/src/types.ts:804](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L804) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) +Defined in: [packages/query-core/src/types.ts:827](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L827) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) +Defined in: [packages/query-core/src/types.ts:845](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L845) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) +Defined in: [packages/query-core/src/types.ts:849](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L849) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/preact/reference/interfaces/QueryObserverLoadingErrorResult.md index 7a4f855305f..21b39fbffe3 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) +Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/preact/reference/interfaces/QueryObserverLoadingResult.md index 8f94574bcca..4966390127f 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) +Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverOptions.md b/docs/framework/preact/reference/interfaces/QueryObserverOptions.md index 77849c1a546..c325b42f230 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverOptions.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverOptions.md @@ -3,7 +3,7 @@ id: QueryObserverOptions title: QueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L375) +Defined in: [packages/query-core/src/types.ts:380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L380) ## Extends @@ -48,7 +48,7 @@ Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/q optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -64,12 +64,13 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -91,7 +92,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -114,7 +115,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -132,7 +133,7 @@ WithRequired.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -150,7 +151,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -169,7 +170,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -191,13 +194,15 @@ WithRequired.networkMode optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. *** @@ -207,7 +212,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -228,7 +233,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -242,7 +247,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -264,7 +269,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -283,7 +288,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -306,7 +311,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -324,7 +329,7 @@ WithRequired.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -339,9 +344,10 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. *** @@ -352,7 +358,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -369,7 +375,7 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -386,7 +392,7 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -426,7 +432,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -436,6 +442,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -450,7 +458,7 @@ WithRequired.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -465,7 +473,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -490,7 +498,7 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -507,7 +515,7 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -528,7 +536,7 @@ WithRequired.structuralSharing optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -543,7 +551,7 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/preact/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/preact/reference/interfaces/QueryObserverPendingResult.md index 41a101c7c8c..8f00c426b64 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:887](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L887) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L888) +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) +Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/preact/reference/interfaces/QueryObserverPlaceholderResult.md index cce7cffcc9b..bbf3da387f9 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) +Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) +Defined in: [packages/query-core/src/types.ts:975](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L975) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) +Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) +Defined in: [packages/query-core/src/types.ts:976](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L976) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:969](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L969) +Defined in: [packages/query-core/src/types.ts:979](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L979) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L970) +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) +Defined in: [packages/query-core/src/types.ts:978](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L978) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) +Defined in: [packages/query-core/src/types.ts:983](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L983) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) +Defined in: [packages/query-core/src/types.ts:981](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L981) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:972](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L972) +Defined in: [packages/query-core/src/types.ts:982](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L982) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/preact/reference/interfaces/QueryObserverRefetchErrorResult.md index 8486e8cf4cb..345ecab35e1 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) +Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/preact/reference/interfaces/QueryObserverSuccessResult.md index f126bea0f70..3942655c627 100644 --- a/docs/framework/preact/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/preact/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) +Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) +Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) +Defined in: [packages/query-core/src/types.ts:964](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L964) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) +Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) +Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) +Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) The status of the query. - Will be: diff --git a/docs/framework/preact/reference/interfaces/QueryOptions.md b/docs/framework/preact/reference/interfaces/QueryOptions.md index bb82dd0f56a..7e059d3a1d6 100644 --- a/docs/framework/preact/reference/interfaces/QueryOptions.md +++ b/docs/framework/preact/reference/interfaces/QueryOptions.md @@ -35,12 +35,13 @@ Defined in: [packages/query-core/src/types.ts:231](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -56,7 +57,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -73,7 +74,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -85,7 +86,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -97,7 +98,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -110,7 +111,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -126,7 +129,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -141,7 +144,7 @@ optional queryFn: | typeof skipToken; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -157,7 +160,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -170,7 +173,7 @@ as the actual cache key internally. optional queryKey: TQueryKey; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -187,7 +190,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -216,7 +219,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -226,6 +229,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + *** ### structuralSharing? @@ -234,7 +239,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/preact/reference/interfaces/RefetchOptions.md b/docs/framework/preact/reference/interfaces/RefetchOptions.md index 104412c5bac..cfcc0498799 100644 --- a/docs/framework/preact/reference/interfaces/RefetchOptions.md +++ b/docs/framework/preact/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) +Defined in: [packages/query-core/src/types.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L704) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,9 +38,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/preact/reference/interfaces/RefetchQueryFilters.md b/docs/framework/preact/reference/interfaces/RefetchQueryFilters.md index bde28360fa1..c45dfa953f1 100644 --- a/docs/framework/preact/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/preact/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:720](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L720) +Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. diff --git a/docs/framework/preact/reference/interfaces/ResetOptions.md b/docs/framework/preact/reference/interfaces/ResetOptions.md index 6d3a8398fbb..9f12324ba27 100644 --- a/docs/framework/preact/reference/interfaces/ResetOptions.md +++ b/docs/framework/preact/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) +Defined in: [packages/query-core/src/types.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L735) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,9 +37,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/preact/reference/interfaces/ResultOptions.md b/docs/framework/preact/reference/interfaces/ResultOptions.md index f3da151a3ec..42917f20bf0 100644 --- a/docs/framework/preact/reference/interfaces/ResultOptions.md +++ b/docs/framework/preact/reference/interfaces/ResultOptions.md @@ -3,7 +3,7 @@ id: ResultOptions title: ResultOptions --- -Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L686) +Defined in: [packages/query-core/src/types.ts:694](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L694) ## Extended by @@ -19,8 +19,9 @@ Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/preact/reference/interfaces/SetDataOptions.md b/docs/framework/preact/reference/interfaces/SetDataOptions.md index cac83e9312a..bb668fbf162 100644 --- a/docs/framework/preact/reference/interfaces/SetDataOptions.md +++ b/docs/framework/preact/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1506) +Defined in: [packages/query-core/src/types.ts:1526](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1526) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) +Defined in: [packages/query-core/src/types.ts:1527](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1527) diff --git a/docs/framework/preact/reference/interfaces/UseBaseQueryOptions.md b/docs/framework/preact/reference/interfaces/UseBaseQueryOptions.md index c459d58b581..693641d559f 100644 --- a/docs/framework/preact/reference/interfaces/UseBaseQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/UseBaseQueryOptions.md @@ -54,7 +54,7 @@ The type of your `queryKey`. optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -74,12 +74,13 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -99,7 +100,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -120,7 +121,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -136,7 +137,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -152,7 +153,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -169,7 +170,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -189,13 +192,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -209,7 +214,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -272,7 +277,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -290,7 +295,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -310,7 +315,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -327,7 +332,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -348,7 +353,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -364,7 +369,7 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -383,9 +388,10 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -400,7 +406,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -421,7 +427,7 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -442,7 +448,7 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -484,7 +490,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -494,6 +500,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) @@ -506,7 +514,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -525,7 +533,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -554,7 +562,7 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -575,7 +583,7 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -612,7 +620,7 @@ true optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -631,7 +639,7 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/preact/reference/interfaces/UseInfiniteQueryOptions.md b/docs/framework/preact/reference/interfaces/UseInfiniteQueryOptions.md index be3fe9609bf..5befdc4e324 100644 --- a/docs/framework/preact/reference/interfaces/UseInfiniteQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/UseInfiniteQueryOptions.md @@ -54,7 +54,7 @@ The type of the parameter passed to `queryFn` to fetch a given page. optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -76,12 +76,13 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -99,7 +100,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -118,7 +119,7 @@ OmitKeyof.getNextPageParam optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -139,7 +140,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -162,7 +163,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -180,7 +181,7 @@ OmitKeyof.initialDataUpdatedAt initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from @@ -196,7 +197,7 @@ OmitKeyof.initialPageParam optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -212,7 +213,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -229,7 +230,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -249,13 +252,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -269,7 +274,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -290,7 +295,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -310,7 +315,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -332,7 +337,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -349,7 +354,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -372,7 +377,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -390,7 +395,7 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -411,9 +416,10 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -428,7 +434,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -451,7 +457,7 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -474,7 +480,7 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -520,7 +526,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -530,6 +536,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -544,7 +552,7 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -565,7 +573,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -596,7 +604,7 @@ OmitKeyof.select optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -619,7 +627,7 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -658,7 +666,7 @@ true optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/preact/reference/interfaces/UseMutationOptions.md b/docs/framework/preact/reference/interfaces/UseMutationOptions.md index fce42d39801..65b0aafe345 100644 --- a/docs/framework/preact/reference/interfaces/UseMutationOptions.md +++ b/docs/framework/preact/reference/interfaces/UseMutationOptions.md @@ -47,7 +47,7 @@ their `onMutateResult` parameter — useful for optimistic-update rollback data. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) +Defined in: [packages/query-core/src/types.ts:1260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1260) The time in milliseconds that an unused/inactive mutation remains in memory before it is garbage collected. @@ -66,7 +66,7 @@ Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) +Defined in: [packages/query-core/src/types.ts:1263](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1263) #### Inherited from @@ -80,7 +80,7 @@ Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) +Defined in: [packages/query-core/src/types.ts:1206](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1206) #### Inherited from @@ -96,7 +96,7 @@ OmitKeyof.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) #### Inherited from @@ -110,7 +110,9 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1253](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1253) + +Controls whether a mutation is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -130,7 +132,7 @@ Defaults to `'online'`. optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) +Defined in: [packages/query-core/src/types.ts:1218](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1218) #### Parameters @@ -168,7 +170,7 @@ OmitKeyof.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -198,7 +200,7 @@ OmitKeyof.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) +Defined in: [packages/query-core/src/types.ts:1224](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1224) #### Parameters @@ -240,7 +242,7 @@ OmitKeyof.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Parameters @@ -278,7 +280,7 @@ OmitKeyof.onSuccess optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1239](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1239) If `false`, failed mutations will not retry by default. If `true`, failed mutations will retry infinitely. @@ -301,7 +303,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) +Defined in: [packages/query-core/src/types.ts:1246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1246) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -322,7 +324,7 @@ OmitKeyof.retryDelay optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) #### Inherited from @@ -336,7 +338,14 @@ Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) +Defined in: [packages/query-core/src/types.ts:1281](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1281) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true`, all errors will be thrown to the nearest error boundary. +If set to a function, it will be passed the error and should return a boolean indicating whether to throw the +error (`true`) or return it as state (`false`). + +Defaults to `false`. #### Inherited from diff --git a/docs/framework/preact/reference/interfaces/UseQueryOptions.md b/docs/framework/preact/reference/interfaces/UseQueryOptions.md index dc451fd6dae..7001c0cb37f 100644 --- a/docs/framework/preact/reference/interfaces/UseQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/UseQueryOptions.md @@ -47,7 +47,7 @@ The type of your `queryKey`. optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -69,12 +69,13 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -94,7 +95,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -117,7 +118,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -135,7 +136,7 @@ OmitKeyof.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -151,7 +152,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -168,7 +169,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -188,13 +191,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -208,7 +213,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -273,7 +278,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -293,7 +298,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -315,7 +320,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -332,7 +337,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -355,7 +360,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -373,7 +378,7 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -394,9 +399,10 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -411,7 +417,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -434,7 +440,7 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -457,7 +463,7 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -503,7 +509,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -513,6 +519,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -527,7 +535,7 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -548,7 +556,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -579,7 +587,7 @@ OmitKeyof.select optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -602,7 +610,7 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -647,7 +655,7 @@ OmitKeyof.subscribed optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/preact/reference/interfaces/UseSuspenseInfiniteQueryOptions.md b/docs/framework/preact/reference/interfaces/UseSuspenseInfiniteQueryOptions.md index aec0a45c130..a7f55cb0d5b 100644 --- a/docs/framework/preact/reference/interfaces/UseSuspenseInfiniteQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/UseSuspenseInfiniteQueryOptions.md @@ -54,12 +54,13 @@ The type of the parameter passed to `queryFn` to fetch a given page. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -77,7 +78,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -96,7 +97,7 @@ OmitKeyof.getNextPageParam optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -117,7 +118,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -140,7 +141,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -158,7 +159,7 @@ OmitKeyof.initialDataUpdatedAt initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from @@ -174,7 +175,7 @@ OmitKeyof.initialPageParam optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -190,7 +191,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -207,7 +208,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -227,13 +230,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -247,7 +252,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -279,7 +284,7 @@ must always be provided, unless a default query function has been defined. optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -296,7 +301,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -319,7 +324,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -337,7 +342,7 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -358,9 +363,10 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -375,7 +381,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -398,7 +404,7 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -421,7 +427,7 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -467,7 +473,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -477,6 +483,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -491,7 +499,7 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -512,7 +520,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -543,7 +551,7 @@ OmitKeyof.select optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -566,7 +574,7 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/preact/reference/interfaces/UseSuspenseQueryOptions.md b/docs/framework/preact/reference/interfaces/UseSuspenseQueryOptions.md index 06f31822e13..8cfbafbb5c6 100644 --- a/docs/framework/preact/reference/interfaces/UseSuspenseQueryOptions.md +++ b/docs/framework/preact/reference/interfaces/UseSuspenseQueryOptions.md @@ -48,12 +48,13 @@ The type of your `queryKey`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -73,7 +74,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -96,7 +97,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -114,7 +115,7 @@ OmitKeyof.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -130,7 +131,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -147,7 +148,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -167,13 +170,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -187,7 +192,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -263,7 +268,7 @@ must always be provided, unless a default query function has been defined. optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -280,7 +285,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -303,7 +308,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -321,7 +326,7 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -342,9 +347,10 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -359,7 +365,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -382,7 +388,7 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -405,7 +411,7 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -451,7 +457,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -461,6 +467,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -475,7 +483,7 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -496,7 +504,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -527,7 +535,7 @@ OmitKeyof.select optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -550,7 +558,7 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/preact/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/preact/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md index 4412ad00c8e..82c7ddbb886 100644 --- a/docs/framework/preact/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md +++ b/docs/framework/preact/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedInfiniteQueryObserverOptions type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:549](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L549) +Defined in: [packages/query-core/src/types.ts:557](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L557) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/preact/reference/type-aliases/DefaultedQueryObserverOptions.md index 9ce8401b128..7687d8c24f6 100644 --- a/docs/framework/preact/reference/type-aliases/DefaultedQueryObserverOptions.md +++ b/docs/framework/preact/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedQueryObserverOptions type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) +Defined in: [packages/query-core/src/types.ts:528](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L528) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index cec33b142b7..38dac7cfe2b 100644 --- a/docs/framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/preact/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) +Defined in: [packages/query-core/src/types.ts:1148](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1148) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/preact/reference/type-aliases/DefinedQueryObserverResult.md index b4480af3810..ae77ddcc22d 100644 --- a/docs/framework/preact/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/preact/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/preact/reference/type-aliases/EnsureInfiniteQueryDataOptions.md index ff75b1c3449..7648331fca2 100644 --- a/docs/framework/preact/reference/type-aliases/EnsureInfiniteQueryDataOptions.md +++ b/docs/framework/preact/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -7,7 +7,7 @@ title: EnsureInfiniteQueryDataOptions type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; ``` -Defined in: [packages/query-core/src/types.ts:623](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L623) +Defined in: [packages/query-core/src/types.ts:631](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L631) ## Type Declaration diff --git a/docs/framework/preact/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/preact/reference/type-aliases/FetchInfiniteQueryOptions.md index c926bbd3ae5..d00a2455889 100644 --- a/docs/framework/preact/reference/type-aliases/FetchInfiniteQueryOptions.md +++ b/docs/framework/preact/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: FetchInfiniteQueryOptions type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:667](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L667) +Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/FetchStatus.md b/docs/framework/preact/reference/type-aliases/FetchStatus.md index b347069e97e..d50002355ca 100644 --- a/docs/framework/preact/reference/type-aliases/FetchStatus.md +++ b/docs/framework/preact/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:752](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L752) +Defined in: [packages/query-core/src/types.ts:762](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L762) diff --git a/docs/framework/preact/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/preact/reference/type-aliases/InfiniteQueryExecuteOptions.md index c198662a319..259c97c96bb 100644 --- a/docs/framework/preact/reference/type-aliases/InfiniteQueryExecuteOptions.md +++ b/docs/framework/preact/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -7,7 +7,7 @@ title: InfiniteQueryExecuteOptions type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:646](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L646) +Defined in: [packages/query-core/src/types.ts:654](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L654) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/preact/reference/type-aliases/InfiniteQueryObserverResult.md index 42279b19c00..aa27563b9cd 100644 --- a/docs/framework/preact/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/preact/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/MutateFunction.md b/docs/framework/preact/reference/type-aliases/MutateFunction.md index 558040d3439..e12b7a80291 100644 --- a/docs/framework/preact/reference/type-aliases/MutateFunction.md +++ b/docs/framework/preact/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1306](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1306) +Defined in: [packages/query-core/src/types.ts:1326](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1326) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/MutateFunctionRest.md b/docs/framework/preact/reference/type-aliases/MutateFunctionRest.md index 3e7a5217482..3902f1082f9 100644 --- a/docs/framework/preact/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/preact/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1291](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1291) +Defined in: [packages/query-core/src/types.ts:1311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1311) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/MutationFunction.md b/docs/framework/preact/reference/type-aliases/MutationFunction.md index 330af1ef65a..9bafb3db56b 100644 --- a/docs/framework/preact/reference/type-aliases/MutationFunction.md +++ b/docs/framework/preact/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1195](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1195) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/MutationFunctionContext.md b/docs/framework/preact/reference/type-aliases/MutationFunctionContext.md index 97de2f1c220..0207256c702 100644 --- a/docs/framework/preact/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/preact/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) +Defined in: [packages/query-core/src/types.ts:1189](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1189) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1180) +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1182](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1182) +Defined in: [packages/query-core/src/types.ts:1192](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1192) diff --git a/docs/framework/preact/reference/type-aliases/MutationKey.md b/docs/framework/preact/reference/type-aliases/MutationKey.md index 8e9d3bc3b3a..9d1d7f0f77b 100644 --- a/docs/framework/preact/reference/type-aliases/MutationKey.md +++ b/docs/framework/preact/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) +Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) diff --git a/docs/framework/preact/reference/type-aliases/MutationMeta.md b/docs/framework/preact/reference/type-aliases/MutationMeta.md index 474c593e206..ff1f9b4bf94 100644 --- a/docs/framework/preact/reference/type-aliases/MutationMeta.md +++ b/docs/framework/preact/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) +Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) diff --git a/docs/framework/preact/reference/type-aliases/MutationObserverResult.md b/docs/framework/preact/reference/type-aliases/MutationObserverResult.md index 21e43836bf6..c21fc3ac591 100644 --- a/docs/framework/preact/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/preact/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1464](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1464) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/MutationScope.md b/docs/framework/preact/reference/type-aliases/MutationScope.md index feac9d9d17a..1d6a91bd434 100644 --- a/docs/framework/preact/reference/type-aliases/MutationScope.md +++ b/docs/framework/preact/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1167) +Defined in: [packages/query-core/src/types.ts:1177](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1177) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) diff --git a/docs/framework/preact/reference/type-aliases/MutationStatus.md b/docs/framework/preact/reference/type-aliases/MutationStatus.md index 4cd2d3c9535..cf12d3d3ee3 100644 --- a/docs/framework/preact/reference/type-aliases/MutationStatus.md +++ b/docs/framework/preact/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) +Defined in: [packages/query-core/src/types.ts:1175](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1175) diff --git a/docs/framework/preact/reference/type-aliases/NotifyEventType.md b/docs/framework/preact/reference/type-aliases/NotifyEventType.md index 9bbc85e4ce8..ffa60b016e3 100644 --- a/docs/framework/preact/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/preact/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1510](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1510) +Defined in: [packages/query-core/src/types.ts:1530](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1530) diff --git a/docs/framework/preact/reference/type-aliases/QueryObserverResult.md b/docs/framework/preact/reference/type-aliases/QueryObserverResult.md index 4fc661a6c9d..5138b635f2c 100644 --- a/docs/framework/preact/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/preact/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/QueryStatus.md b/docs/framework/preact/reference/type-aliases/QueryStatus.md index 6679b8b17c6..bab00f6f423 100644 --- a/docs/framework/preact/reference/type-aliases/QueryStatus.md +++ b/docs/framework/preact/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:751](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L751) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) diff --git a/docs/framework/preact/reference/type-aliases/ThrowOnError.md b/docs/framework/preact/reference/type-aliases/ThrowOnError.md index 613549e4d52..134683388ef 100644 --- a/docs/framework/preact/reference/type-aliases/ThrowOnError.md +++ b/docs/framework/preact/reference/type-aliases/ThrowOnError.md @@ -7,7 +7,7 @@ title: ThrowOnError type ThrowOnError = boolean | (error, query) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L363) +Defined in: [packages/query-core/src/types.ts:368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L368) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/WithRequired.md b/docs/framework/preact/reference/type-aliases/WithRequired.md index deb87dfe4a4..a40a48c865b 100644 --- a/docs/framework/preact/reference/type-aliases/WithRequired.md +++ b/docs/framework/preact/reference/type-aliases/WithRequired.md @@ -7,7 +7,7 @@ title: WithRequired type WithRequired = TTarget & { [_ in TKey]: {} }; ``` -Defined in: [packages/query-core/src/types.ts:516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L516) +Defined in: [packages/query-core/src/types.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L524) ## Type Parameters diff --git a/docs/framework/react/reference/interfaces/CancelOptions.md b/docs/framework/react/reference/interfaces/CancelOptions.md index f52c729f3b1..b7464c48e50 100644 --- a/docs/framework/react/reference/interfaces/CancelOptions.md +++ b/docs/framework/react/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1501) +Defined in: [packages/query-core/src/types.ts:1521](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1521) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) +Defined in: [packages/query-core/src/types.ts:1522](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1522) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1503) +Defined in: [packages/query-core/src/types.ts:1523](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1523) diff --git a/docs/framework/react/reference/interfaces/DefaultOptions.md b/docs/framework/react/reference/interfaces/DefaultOptions.md index 67ae012f9ee..e45a56f075f 100644 --- a/docs/framework/react/reference/interfaces/DefaultOptions.md +++ b/docs/framework/react/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1487) +Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) ## Type Parameters @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/ optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1498](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1498) +Defined in: [packages/query-core/src/types.ts:1518](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1518) Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). @@ -31,7 +31,7 @@ Default options used when dehydrating the client's caches; see [DehydrateOptions optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1496](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1496) +Defined in: [packages/query-core/src/types.ts:1516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1516) Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). @@ -67,7 +67,7 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1494](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1494) +Defined in: [packages/query-core/src/types.ts:1514](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1514) Default options applied to every mutation, unless overridden per-mutation. @@ -79,6 +79,6 @@ Default options applied to every mutation, unless overridden per-mutation. optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: [packages/query-core/src/types.ts:1489](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1489) +Defined in: [packages/query-core/src/types.ts:1509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1509) Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/react/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/react/reference/interfaces/EnsureQueryDataOptions.md index d71a60902e6..a67082af57e 100644 --- a/docs/framework/react/reference/interfaces/EnsureQueryDataOptions.md +++ b/docs/framework/react/reference/interfaces/EnsureQueryDataOptions.md @@ -3,7 +3,7 @@ id: EnsureQueryDataOptions title: EnsureQueryDataOptions --- -Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L606) +Defined in: [packages/query-core/src/types.ts:614](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L614) ## Deprecated @@ -41,12 +41,13 @@ Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -66,7 +67,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -87,7 +88,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -103,7 +104,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) +Defined in: [packages/query-core/src/types.ts:605](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L605) #### Inherited from @@ -117,7 +118,7 @@ Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -133,7 +134,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -150,7 +151,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -170,7 +173,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -189,7 +192,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -209,7 +212,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -226,7 +229,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -247,7 +250,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -284,7 +287,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -294,6 +297,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`FetchQueryOptions`](FetchQueryOptions.md).[`retryDelay`](FetchQueryOptions.md#retrydelay) @@ -306,7 +311,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional revalidateIfStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L619) +Defined in: [packages/query-core/src/types.ts:627](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L627) *** @@ -316,7 +321,7 @@ Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) +Defined in: [packages/query-core/src/types.ts:610](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L610) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -333,7 +338,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/react/reference/interfaces/FetchNextPageOptions.md b/docs/framework/react/reference/interfaces/FetchNextPageOptions.md index 2c0be977140..b79cdbe19b3 100644 --- a/docs/framework/react/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/react/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:736](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L736) +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,9 +34,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/react/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/react/reference/interfaces/FetchPreviousPageOptions.md index 683e789ee52..fd5a08767b6 100644 --- a/docs/framework/react/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/react/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L739) +Defined in: [packages/query-core/src/types.ts:749](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L749) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:748](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L748) +Defined in: [packages/query-core/src/types.ts:758](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L758) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,9 +34,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/react/reference/interfaces/FetchQueryOptions.md b/docs/framework/react/reference/interfaces/FetchQueryOptions.md index 634ae0e09f9..b00973badc0 100644 --- a/docs/framework/react/reference/interfaces/FetchQueryOptions.md +++ b/docs/framework/react/reference/interfaces/FetchQueryOptions.md @@ -3,7 +3,7 @@ id: FetchQueryOptions title: FetchQueryOptions --- -Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L587) +Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) ## Deprecated @@ -45,12 +45,13 @@ Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -72,7 +73,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -95,7 +96,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -113,7 +114,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) +Defined in: [packages/query-core/src/types.ts:605](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L605) *** @@ -123,7 +124,7 @@ Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -141,7 +142,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -160,7 +161,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -182,7 +185,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -203,7 +206,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -225,7 +228,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -244,7 +247,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -267,7 +270,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -308,7 +311,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -318,6 +321,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -332,7 +337,7 @@ WithRequired.retryDelay optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) +Defined in: [packages/query-core/src/types.ts:610](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L610) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -345,7 +350,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverBaseResult.md index 9195e0727f8..0aa01962aa5 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L991) +Defined in: [packages/query-core/src/types.ts:1001](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1001) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:771](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L771) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) +Defined in: [packages/query-core/src/types.ts:804](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L804) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) +Defined in: [packages/query-core/src/types.ts:827](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L827) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) +Defined in: [packages/query-core/src/types.ts:845](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L845) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) +Defined in: [packages/query-core/src/types.ts:849](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L849) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 2841b5ab116..f5e3352f27c 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) +Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1076](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1076) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1077](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1077) +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult.md index 95ff84b3ef3..b7aa67744c0 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverOptions.md index 7d5b0dd1a4d..7670bd8e24b 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverOptions.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverOptions title: InfiniteQueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L531) +Defined in: [packages/query-core/src/types.ts:539](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L539) ## Extends @@ -39,7 +39,7 @@ Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/q optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -59,12 +59,13 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -82,7 +83,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -99,7 +100,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -118,7 +119,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -139,7 +140,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -155,7 +156,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from @@ -169,7 +170,7 @@ Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -185,7 +186,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -202,7 +203,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -222,13 +225,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -242,7 +247,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -261,7 +266,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -279,7 +284,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -299,7 +304,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -316,7 +321,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -337,7 +342,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -353,7 +358,7 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -372,9 +377,10 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -389,7 +395,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -410,7 +416,7 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -431,7 +437,7 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -473,7 +479,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -483,6 +489,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) @@ -495,7 +503,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -514,7 +522,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -543,7 +551,7 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -564,7 +572,7 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -583,7 +591,7 @@ Defaults to `true`. optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -602,7 +610,7 @@ Defaults to `false`. optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverPendingResult.md index c3e8b022cdb..a09301ab6c4 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1042](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1042) +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index e62579744ba..58193a987d1 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) +Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) +Defined in: [packages/query-core/src/types.ts:1136](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1136) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) +Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1133](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1133) +Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1128) +Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1129](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1129) +Defined in: [packages/query-core/src/types.ts:1139](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1139) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) +Defined in: [packages/query-core/src/types.ts:1137](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1137) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1132](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1132) +Defined in: [packages/query-core/src/types.ts:1142](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1142) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) +Defined in: [packages/query-core/src/types.ts:1140](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1140) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) +Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) +Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index a67e877f083..4ce469bceed 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1094](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1094) +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 0b875662cbc..131f6d01ae7 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) +Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) +Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) +Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) +Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) +Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/react/reference/interfaces/InfiniteQueryPageParamsOptions.md index afe27785edc..c091cc15456 100644 --- a/docs/framework/react/reference/interfaces/InfiniteQueryPageParamsOptions.md +++ b/docs/framework/react/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryPageParamsOptions title: InfiniteQueryPageParamsOptions --- -Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L347) +Defined in: [packages/query-core/src/types.ts:352](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L352) ## Extends @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/q getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -44,7 +44,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -57,7 +57,7 @@ The result will also be used to determine the value of `hasPreviousPage`. initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from diff --git a/docs/framework/react/reference/interfaces/InitialPageParam.md b/docs/framework/react/reference/interfaces/InitialPageParam.md index 2d42bf029a4..46d2b219ea4 100644 --- a/docs/framework/react/reference/interfaces/InitialPageParam.md +++ b/docs/framework/react/reference/interfaces/InitialPageParam.md @@ -3,7 +3,7 @@ id: InitialPageParam title: InitialPageParam --- -Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L343) +Defined in: [packages/query-core/src/types.ts:348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L348) ## Extended by @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/q initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) diff --git a/docs/framework/react/reference/interfaces/InvalidateOptions.md b/docs/framework/react/reference/interfaces/InvalidateOptions.md index d83ecd43ec0..8a81428b035 100644 --- a/docs/framework/react/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/react/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) +Defined in: [packages/query-core/src/types.ts:734](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L734) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,9 +37,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/react/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/react/reference/interfaces/InvalidateQueryFilters.md index 36eb3f27998..569e42a4e1b 100644 --- a/docs/framework/react/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/react/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) +Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -100,9 +100,10 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:717](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L717) +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) Controls which of the matched (now-invalidated) queries are refetched in the background. + Defaults to `'active'`. - `'active'`: only queries with at least one active observer are refetched. - `'inactive'`: only queries with no active observer are refetched. diff --git a/docs/framework/react/reference/interfaces/MutateOptions.md b/docs/framework/react/reference/interfaces/MutateOptions.md index b12b3b29ec2..34e2a4d4d7e 100644 --- a/docs/framework/react/reference/interfaces/MutateOptions.md +++ b/docs/framework/react/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) +Defined in: [packages/query-core/src/types.ts:1284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1284) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) +Defined in: [packages/query-core/src/types.ts:1296](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1296) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1282) +Defined in: [packages/query-core/src/types.ts:1302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1302) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1270](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1270) +Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) #### Parameters diff --git a/docs/framework/react/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/react/reference/interfaces/MutationObserverBaseResult.md index e1c09a56737..340a38cc9cc 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/react/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1315) +Defined in: [packages/query-core/src/types.ts:1335](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1335) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1324](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1324) +Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1333](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1333) +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) +Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) +Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) +Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1328](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1328) +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) The variables object passed to the `mutationFn`. diff --git a/docs/framework/react/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/react/reference/interfaces/MutationObserverErrorResult.md index cce591e3465..72e459a2e0b 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/react/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) +Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) +Defined in: [packages/query-core/src/types.ts:1453](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1453) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) +Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) +Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) +Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) +Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) The variables object passed to the `mutationFn`. diff --git a/docs/framework/react/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/react/reference/interfaces/MutationObserverIdleResult.md index b7892846a6c..cd8d6eb3130 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/react/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) +Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) +Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1394](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1394) +Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) +Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1396](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1396) +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) +Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) +Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) The variables object passed to the `mutationFn`. diff --git a/docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md index d4368822213..9b70a8558e7 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) +Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) +Defined in: [packages/query-core/src/types.ts:1432](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1432) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) +Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) +Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) +Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) The variables object passed to the `mutationFn`. diff --git a/docs/framework/react/reference/interfaces/MutationObserverOptions.md b/docs/framework/react/reference/interfaces/MutationObserverOptions.md index 1e609be9bf1..5bab2840a6d 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/react/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1255) +Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) ## Extends @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) +Defined in: [packages/query-core/src/types.ts:1260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1260) The time in milliseconds that an unused/inactive mutation remains in memory before it is garbage collected. @@ -54,7 +54,7 @@ Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) +Defined in: [packages/query-core/src/types.ts:1263](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1263) #### Inherited from @@ -68,7 +68,7 @@ Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) +Defined in: [packages/query-core/src/types.ts:1206](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1206) #### Inherited from @@ -82,7 +82,7 @@ Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) #### Inherited from @@ -96,7 +96,9 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1253](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1253) + +Controls whether a mutation is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -116,7 +118,7 @@ Defaults to `'online'`. optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) +Defined in: [packages/query-core/src/types.ts:1218](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1218) #### Parameters @@ -152,7 +154,7 @@ Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -180,7 +182,7 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) +Defined in: [packages/query-core/src/types.ts:1224](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1224) #### Parameters @@ -220,7 +222,7 @@ Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Parameters @@ -256,7 +258,7 @@ Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1239](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1239) If `false`, failed mutations will not retry by default. If `true`, failed mutations will retry infinitely. @@ -277,7 +279,7 @@ Defaults to `0`. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) +Defined in: [packages/query-core/src/types.ts:1246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1246) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -296,7 +298,7 @@ Defaults to a function that applies exponential backoff, capped at 30 seconds. optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) #### Inherited from @@ -310,4 +312,11 @@ Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) +Defined in: [packages/query-core/src/types.ts:1281](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1281) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true`, all errors will be thrown to the nearest error boundary. +If set to a function, it will be passed the error and should return a boolean indicating whether to throw the +error (`true`) or return it as state (`false`). + +Defaults to `false`. diff --git a/docs/framework/react/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/react/reference/interfaces/MutationObserverSuccessResult.md index 52cdcc4883e..e2e03642f82 100644 --- a/docs/framework/react/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/react/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) +Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) +Defined in: [packages/query-core/src/types.ts:1474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1474) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) +Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) +Defined in: [packages/query-core/src/types.ts:1478](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1478) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) +Defined in: [packages/query-core/src/types.ts:1479](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1479) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) +Defined in: [packages/query-core/src/types.ts:1480](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1480) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1481](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1481) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) +Defined in: [packages/query-core/src/types.ts:1476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1476) The variables object passed to the `mutationFn`. diff --git a/docs/framework/react/reference/interfaces/MutationOptions.md b/docs/framework/react/reference/interfaces/MutationOptions.md index 49f2b8f4f19..5aabeeb0ca4 100644 --- a/docs/framework/react/reference/interfaces/MutationOptions.md +++ b/docs/framework/react/reference/interfaces/MutationOptions.md @@ -3,7 +3,7 @@ id: MutationOptions title: MutationOptions --- -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) ## Extended by @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) +Defined in: [packages/query-core/src/types.ts:1260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1260) The time in milliseconds that an unused/inactive mutation remains in memory before it is garbage collected. @@ -50,7 +50,7 @@ Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) +Defined in: [packages/query-core/src/types.ts:1263](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1263) *** @@ -60,7 +60,7 @@ Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) +Defined in: [packages/query-core/src/types.ts:1206](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1206) *** @@ -70,7 +70,7 @@ Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) *** @@ -80,7 +80,9 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1253](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1253) + +Controls whether a mutation is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -96,7 +98,7 @@ Defaults to `'online'`. optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) +Defined in: [packages/query-core/src/types.ts:1218](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1218) #### Parameters @@ -128,7 +130,7 @@ Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -152,7 +154,7 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) +Defined in: [packages/query-core/src/types.ts:1224](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1224) #### Parameters @@ -188,7 +190,7 @@ Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Parameters @@ -220,7 +222,7 @@ Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1239](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1239) If `false`, failed mutations will not retry by default. If `true`, failed mutations will retry infinitely. @@ -237,7 +239,7 @@ Defaults to `0`. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) +Defined in: [packages/query-core/src/types.ts:1246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1246) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -252,4 +254,4 @@ Defaults to a function that applies exponential backoff, capped at 30 seconds. optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) diff --git a/docs/framework/react/reference/interfaces/NotifyEvent.md b/docs/framework/react/reference/interfaces/NotifyEvent.md index 5e7875d41b8..4f5b023f49a 100644 --- a/docs/framework/react/reference/interfaces/NotifyEvent.md +++ b/docs/framework/react/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1519) +Defined in: [packages/query-core/src/types.ts:1539](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1539) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1520) +Defined in: [packages/query-core/src/types.ts:1540](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1540) diff --git a/docs/framework/react/reference/interfaces/QueryClientConfig.md b/docs/framework/react/reference/interfaces/QueryClientConfig.md index 411eb0b2fb2..070e249491f 100644 --- a/docs/framework/react/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/react/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) +Defined in: [packages/query-core/src/types.ts:1495](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1495) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/ optional defaultOptions: DefaultOptions; ``` -Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) +Defined in: [packages/query-core/src/types.ts:1504](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1504) Default options for all queries and mutations created through this client. @@ -25,7 +25,7 @@ Default options for all queries and mutations created through this client. optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1482) +Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) The mutation cache this client is connected to. A new `MutationCache` is created if not provided. @@ -38,6 +38,6 @@ provided. optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) +Defined in: [packages/query-core/src/types.ts:1497](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1497) The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/react/reference/interfaces/QueryExecuteOptions.md b/docs/framework/react/reference/interfaces/QueryExecuteOptions.md index 1e844c5ba10..23d272eb25f 100644 --- a/docs/framework/react/reference/interfaces/QueryExecuteOptions.md +++ b/docs/framework/react/reference/interfaces/QueryExecuteOptions.md @@ -3,7 +3,7 @@ id: QueryExecuteOptions title: QueryExecuteOptions --- -Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) +Defined in: [packages/query-core/src/types.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L574) ## Extends @@ -43,12 +43,13 @@ Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -70,7 +71,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -93,7 +94,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -111,7 +112,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L577) +Defined in: [packages/query-core/src/types.ts:585](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L585) *** @@ -121,7 +122,7 @@ Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -139,7 +140,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -158,7 +159,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -180,7 +183,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -201,7 +204,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -223,7 +226,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -242,7 +245,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -265,7 +268,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -306,7 +309,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -316,6 +319,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -330,7 +335,7 @@ WithRequired.retryDelay optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L578) +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) #### Parameters @@ -350,7 +355,7 @@ Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:583](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L583) +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -363,7 +368,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/react/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/react/reference/interfaces/QueryObserverBaseResult.md index 1b54d6f8041..ef5fe0ad757 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:764](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L764) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:771](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L771) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) +Defined in: [packages/query-core/src/types.ts:804](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L804) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) +Defined in: [packages/query-core/src/types.ts:827](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L827) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) +Defined in: [packages/query-core/src/types.ts:845](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L845) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) +Defined in: [packages/query-core/src/types.ts:849](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L849) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/react/reference/interfaces/QueryObserverLoadingErrorResult.md index 7a4f855305f..21b39fbffe3 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) +Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/react/reference/interfaces/QueryObserverLoadingResult.md index 8f94574bcca..4966390127f 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) +Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverOptions.md b/docs/framework/react/reference/interfaces/QueryObserverOptions.md index 77849c1a546..c325b42f230 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverOptions.md +++ b/docs/framework/react/reference/interfaces/QueryObserverOptions.md @@ -3,7 +3,7 @@ id: QueryObserverOptions title: QueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L375) +Defined in: [packages/query-core/src/types.ts:380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L380) ## Extends @@ -48,7 +48,7 @@ Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/q optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -64,12 +64,13 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -91,7 +92,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -114,7 +115,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -132,7 +133,7 @@ WithRequired.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -150,7 +151,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -169,7 +170,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -191,13 +194,15 @@ WithRequired.networkMode optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. *** @@ -207,7 +212,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -228,7 +233,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -242,7 +247,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -264,7 +269,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -283,7 +288,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -306,7 +311,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -324,7 +329,7 @@ WithRequired.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -339,9 +344,10 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. *** @@ -352,7 +358,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -369,7 +375,7 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -386,7 +392,7 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -426,7 +432,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -436,6 +442,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -450,7 +458,7 @@ WithRequired.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -465,7 +473,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -490,7 +498,7 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -507,7 +515,7 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -528,7 +536,7 @@ WithRequired.structuralSharing optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -543,7 +551,7 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/react/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/react/reference/interfaces/QueryObserverPendingResult.md index 41a101c7c8c..8f00c426b64 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:887](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L887) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L888) +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) +Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/react/reference/interfaces/QueryObserverPlaceholderResult.md index cce7cffcc9b..bbf3da387f9 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) +Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) +Defined in: [packages/query-core/src/types.ts:975](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L975) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) +Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) +Defined in: [packages/query-core/src/types.ts:976](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L976) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:969](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L969) +Defined in: [packages/query-core/src/types.ts:979](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L979) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L970) +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) +Defined in: [packages/query-core/src/types.ts:978](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L978) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) +Defined in: [packages/query-core/src/types.ts:983](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L983) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) +Defined in: [packages/query-core/src/types.ts:981](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L981) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:972](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L972) +Defined in: [packages/query-core/src/types.ts:982](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L982) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/react/reference/interfaces/QueryObserverRefetchErrorResult.md index 8486e8cf4cb..345ecab35e1 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) +Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/react/reference/interfaces/QueryObserverSuccessResult.md index f126bea0f70..3942655c627 100644 --- a/docs/framework/react/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/react/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) +Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) +Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) +Defined in: [packages/query-core/src/types.ts:964](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L964) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) +Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) +Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) +Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) The status of the query. - Will be: diff --git a/docs/framework/react/reference/interfaces/QueryOptions.md b/docs/framework/react/reference/interfaces/QueryOptions.md index bb82dd0f56a..7e059d3a1d6 100644 --- a/docs/framework/react/reference/interfaces/QueryOptions.md +++ b/docs/framework/react/reference/interfaces/QueryOptions.md @@ -35,12 +35,13 @@ Defined in: [packages/query-core/src/types.ts:231](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -56,7 +57,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -73,7 +74,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -85,7 +86,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -97,7 +98,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -110,7 +111,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -126,7 +129,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -141,7 +144,7 @@ optional queryFn: | typeof skipToken; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -157,7 +160,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -170,7 +173,7 @@ as the actual cache key internally. optional queryKey: TQueryKey; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -187,7 +190,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -216,7 +219,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -226,6 +229,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + *** ### structuralSharing? @@ -234,7 +239,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/react/reference/interfaces/RefetchOptions.md b/docs/framework/react/reference/interfaces/RefetchOptions.md index 104412c5bac..cfcc0498799 100644 --- a/docs/framework/react/reference/interfaces/RefetchOptions.md +++ b/docs/framework/react/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) +Defined in: [packages/query-core/src/types.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L704) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,9 +38,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/react/reference/interfaces/RefetchQueryFilters.md b/docs/framework/react/reference/interfaces/RefetchQueryFilters.md index bde28360fa1..c45dfa953f1 100644 --- a/docs/framework/react/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/react/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:720](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L720) +Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. diff --git a/docs/framework/react/reference/interfaces/ResetOptions.md b/docs/framework/react/reference/interfaces/ResetOptions.md index 6d3a8398fbb..9f12324ba27 100644 --- a/docs/framework/react/reference/interfaces/ResetOptions.md +++ b/docs/framework/react/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) +Defined in: [packages/query-core/src/types.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L735) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,9 +37,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/react/reference/interfaces/ResultOptions.md b/docs/framework/react/reference/interfaces/ResultOptions.md index f3da151a3ec..42917f20bf0 100644 --- a/docs/framework/react/reference/interfaces/ResultOptions.md +++ b/docs/framework/react/reference/interfaces/ResultOptions.md @@ -3,7 +3,7 @@ id: ResultOptions title: ResultOptions --- -Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L686) +Defined in: [packages/query-core/src/types.ts:694](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L694) ## Extended by @@ -19,8 +19,9 @@ Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/react/reference/interfaces/SetDataOptions.md b/docs/framework/react/reference/interfaces/SetDataOptions.md index cac83e9312a..bb668fbf162 100644 --- a/docs/framework/react/reference/interfaces/SetDataOptions.md +++ b/docs/framework/react/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1506) +Defined in: [packages/query-core/src/types.ts:1526](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1526) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) +Defined in: [packages/query-core/src/types.ts:1527](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1527) diff --git a/docs/framework/react/reference/interfaces/UseBaseQueryOptions.md b/docs/framework/react/reference/interfaces/UseBaseQueryOptions.md index 2b0c81d672c..5e58f763132 100644 --- a/docs/framework/react/reference/interfaces/UseBaseQueryOptions.md +++ b/docs/framework/react/reference/interfaces/UseBaseQueryOptions.md @@ -54,7 +54,7 @@ The type of your `queryKey`. optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -74,12 +74,13 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -99,7 +100,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -120,7 +121,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -136,7 +137,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -152,7 +153,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -169,7 +170,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -189,13 +192,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -209,7 +214,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -272,7 +277,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -290,7 +295,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -310,7 +315,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -327,7 +332,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -348,7 +353,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -364,7 +369,7 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -383,9 +388,10 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -400,7 +406,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -421,7 +427,7 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -442,7 +448,7 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -484,7 +490,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -494,6 +500,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) @@ -506,7 +514,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -525,7 +533,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -554,7 +562,7 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -575,7 +583,7 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -612,7 +620,7 @@ true optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -631,7 +639,7 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/react/reference/interfaces/UseInfiniteQueryOptions.md b/docs/framework/react/reference/interfaces/UseInfiniteQueryOptions.md index 193d05117d3..ad9c3a72e3c 100644 --- a/docs/framework/react/reference/interfaces/UseInfiniteQueryOptions.md +++ b/docs/framework/react/reference/interfaces/UseInfiniteQueryOptions.md @@ -54,7 +54,7 @@ The type of the parameter passed to `queryFn` to fetch a given page. optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -76,12 +76,13 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -99,7 +100,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -118,7 +119,7 @@ OmitKeyof.getNextPageParam optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -139,7 +140,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -162,7 +163,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -180,7 +181,7 @@ OmitKeyof.initialDataUpdatedAt initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from @@ -196,7 +197,7 @@ OmitKeyof.initialPageParam optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -212,7 +213,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -229,7 +230,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -249,13 +252,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -269,7 +274,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -290,7 +295,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -310,7 +315,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -332,7 +337,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -349,7 +354,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -372,7 +377,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -390,7 +395,7 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -411,9 +416,10 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -428,7 +434,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -451,7 +457,7 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -474,7 +480,7 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -520,7 +526,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -530,6 +536,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -544,7 +552,7 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -565,7 +573,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -596,7 +604,7 @@ OmitKeyof.select optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -619,7 +627,7 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -658,7 +666,7 @@ true optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/react/reference/interfaces/UseMutationOptions.md b/docs/framework/react/reference/interfaces/UseMutationOptions.md index 50b64e42f25..767ba80378f 100644 --- a/docs/framework/react/reference/interfaces/UseMutationOptions.md +++ b/docs/framework/react/reference/interfaces/UseMutationOptions.md @@ -47,7 +47,7 @@ their `onMutateResult` parameter — useful for optimistic-update rollback data. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) +Defined in: [packages/query-core/src/types.ts:1260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1260) The time in milliseconds that an unused/inactive mutation remains in memory before it is garbage collected. @@ -66,7 +66,7 @@ Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) +Defined in: [packages/query-core/src/types.ts:1263](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1263) #### Inherited from @@ -80,7 +80,7 @@ Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) +Defined in: [packages/query-core/src/types.ts:1206](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1206) #### Inherited from @@ -96,7 +96,7 @@ OmitKeyof.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) #### Inherited from @@ -110,7 +110,9 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1253](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1253) + +Controls whether a mutation is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -130,7 +132,7 @@ Defaults to `'online'`. optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) +Defined in: [packages/query-core/src/types.ts:1218](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1218) #### Parameters @@ -168,7 +170,7 @@ OmitKeyof.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -198,7 +200,7 @@ OmitKeyof.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) +Defined in: [packages/query-core/src/types.ts:1224](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1224) #### Parameters @@ -240,7 +242,7 @@ OmitKeyof.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Parameters @@ -278,7 +280,7 @@ OmitKeyof.onSuccess optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1239](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1239) If `false`, failed mutations will not retry by default. If `true`, failed mutations will retry infinitely. @@ -301,7 +303,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) +Defined in: [packages/query-core/src/types.ts:1246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1246) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -322,7 +324,7 @@ OmitKeyof.retryDelay optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) #### Inherited from @@ -336,7 +338,14 @@ Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) +Defined in: [packages/query-core/src/types.ts:1281](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1281) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true`, all errors will be thrown to the nearest error boundary. +If set to a function, it will be passed the error and should return a boolean indicating whether to throw the +error (`true`) or return it as state (`false`). + +Defaults to `false`. #### Inherited from diff --git a/docs/framework/react/reference/interfaces/UseQueryOptions.md b/docs/framework/react/reference/interfaces/UseQueryOptions.md index e37277d8715..a5836050308 100644 --- a/docs/framework/react/reference/interfaces/UseQueryOptions.md +++ b/docs/framework/react/reference/interfaces/UseQueryOptions.md @@ -47,7 +47,7 @@ The type of your `queryKey`. optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -69,12 +69,13 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -94,7 +95,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -117,7 +118,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -135,7 +136,7 @@ OmitKeyof.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -151,7 +152,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -168,7 +169,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -188,13 +191,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -208,7 +213,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -273,7 +278,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -293,7 +298,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -315,7 +320,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -332,7 +337,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -355,7 +360,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -373,7 +378,7 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -394,9 +399,10 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -411,7 +417,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -434,7 +440,7 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -457,7 +463,7 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -503,7 +509,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -513,6 +519,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -527,7 +535,7 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -548,7 +556,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -579,7 +587,7 @@ OmitKeyof.select optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -602,7 +610,7 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -647,7 +655,7 @@ OmitKeyof.subscribed optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/react/reference/interfaces/UseSuspenseInfiniteQueryOptions.md b/docs/framework/react/reference/interfaces/UseSuspenseInfiniteQueryOptions.md index 0a53f387d46..7d62e4dc3ba 100644 --- a/docs/framework/react/reference/interfaces/UseSuspenseInfiniteQueryOptions.md +++ b/docs/framework/react/reference/interfaces/UseSuspenseInfiniteQueryOptions.md @@ -54,12 +54,13 @@ The type of the parameter passed to `queryFn` to fetch a given page. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -77,7 +78,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -96,7 +97,7 @@ OmitKeyof.getNextPageParam optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -117,7 +118,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -140,7 +141,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -158,7 +159,7 @@ OmitKeyof.initialDataUpdatedAt initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from @@ -174,7 +175,7 @@ OmitKeyof.initialPageParam optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -190,7 +191,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -207,7 +208,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -227,13 +230,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -247,7 +252,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -279,7 +284,7 @@ must always be provided, unless a default query function has been defined. optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -296,7 +301,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -319,7 +324,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -337,7 +342,7 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -358,9 +363,10 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -375,7 +381,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -398,7 +404,7 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -421,7 +427,7 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -467,7 +473,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -477,6 +483,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -491,7 +499,7 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -512,7 +520,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -543,7 +551,7 @@ OmitKeyof.select optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -566,7 +574,7 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/react/reference/interfaces/UseSuspenseQueryOptions.md b/docs/framework/react/reference/interfaces/UseSuspenseQueryOptions.md index a114596fd93..4cd6b24905b 100644 --- a/docs/framework/react/reference/interfaces/UseSuspenseQueryOptions.md +++ b/docs/framework/react/reference/interfaces/UseSuspenseQueryOptions.md @@ -48,12 +48,13 @@ The type of your `queryKey`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -73,7 +74,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -96,7 +97,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -114,7 +115,7 @@ OmitKeyof.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -130,7 +131,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -147,7 +148,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -167,13 +170,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -187,7 +192,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -263,7 +268,7 @@ must always be provided, unless a default query function has been defined. optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -280,7 +285,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -303,7 +308,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -321,7 +326,7 @@ OmitKeyof.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -342,9 +347,10 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -359,7 +365,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -382,7 +388,7 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -405,7 +411,7 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -451,7 +457,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -461,6 +467,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -475,7 +483,7 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -496,7 +504,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -527,7 +535,7 @@ OmitKeyof.select optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -550,7 +558,7 @@ OmitKeyof.staleTime optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/react/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/react/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md index 4412ad00c8e..82c7ddbb886 100644 --- a/docs/framework/react/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md +++ b/docs/framework/react/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedInfiniteQueryObserverOptions type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:549](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L549) +Defined in: [packages/query-core/src/types.ts:557](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L557) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/react/reference/type-aliases/DefaultedQueryObserverOptions.md index 9ce8401b128..7687d8c24f6 100644 --- a/docs/framework/react/reference/type-aliases/DefaultedQueryObserverOptions.md +++ b/docs/framework/react/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedQueryObserverOptions type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) +Defined in: [packages/query-core/src/types.ts:528](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L528) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index cec33b142b7..38dac7cfe2b 100644 --- a/docs/framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/react/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) +Defined in: [packages/query-core/src/types.ts:1148](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1148) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/react/reference/type-aliases/DefinedQueryObserverResult.md index b4480af3810..ae77ddcc22d 100644 --- a/docs/framework/react/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/react/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/react/reference/type-aliases/EnsureInfiniteQueryDataOptions.md index ff75b1c3449..7648331fca2 100644 --- a/docs/framework/react/reference/type-aliases/EnsureInfiniteQueryDataOptions.md +++ b/docs/framework/react/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -7,7 +7,7 @@ title: EnsureInfiniteQueryDataOptions type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; ``` -Defined in: [packages/query-core/src/types.ts:623](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L623) +Defined in: [packages/query-core/src/types.ts:631](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L631) ## Type Declaration diff --git a/docs/framework/react/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/react/reference/type-aliases/FetchInfiniteQueryOptions.md index c926bbd3ae5..d00a2455889 100644 --- a/docs/framework/react/reference/type-aliases/FetchInfiniteQueryOptions.md +++ b/docs/framework/react/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: FetchInfiniteQueryOptions type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:667](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L667) +Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/FetchStatus.md b/docs/framework/react/reference/type-aliases/FetchStatus.md index b347069e97e..d50002355ca 100644 --- a/docs/framework/react/reference/type-aliases/FetchStatus.md +++ b/docs/framework/react/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:752](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L752) +Defined in: [packages/query-core/src/types.ts:762](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L762) diff --git a/docs/framework/react/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/react/reference/type-aliases/InfiniteQueryExecuteOptions.md index c198662a319..259c97c96bb 100644 --- a/docs/framework/react/reference/type-aliases/InfiniteQueryExecuteOptions.md +++ b/docs/framework/react/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -7,7 +7,7 @@ title: InfiniteQueryExecuteOptions type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:646](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L646) +Defined in: [packages/query-core/src/types.ts:654](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L654) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/react/reference/type-aliases/InfiniteQueryObserverResult.md index 42279b19c00..aa27563b9cd 100644 --- a/docs/framework/react/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/react/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/MutateFunction.md b/docs/framework/react/reference/type-aliases/MutateFunction.md index 558040d3439..e12b7a80291 100644 --- a/docs/framework/react/reference/type-aliases/MutateFunction.md +++ b/docs/framework/react/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1306](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1306) +Defined in: [packages/query-core/src/types.ts:1326](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1326) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/MutateFunctionRest.md b/docs/framework/react/reference/type-aliases/MutateFunctionRest.md index 3e7a5217482..3902f1082f9 100644 --- a/docs/framework/react/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/react/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1291](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1291) +Defined in: [packages/query-core/src/types.ts:1311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1311) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/MutationFunction.md b/docs/framework/react/reference/type-aliases/MutationFunction.md index 330af1ef65a..9bafb3db56b 100644 --- a/docs/framework/react/reference/type-aliases/MutationFunction.md +++ b/docs/framework/react/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1195](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1195) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/MutationFunctionContext.md b/docs/framework/react/reference/type-aliases/MutationFunctionContext.md index 97de2f1c220..0207256c702 100644 --- a/docs/framework/react/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/react/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) +Defined in: [packages/query-core/src/types.ts:1189](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1189) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1180) +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1182](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1182) +Defined in: [packages/query-core/src/types.ts:1192](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1192) diff --git a/docs/framework/react/reference/type-aliases/MutationKey.md b/docs/framework/react/reference/type-aliases/MutationKey.md index 8e9d3bc3b3a..9d1d7f0f77b 100644 --- a/docs/framework/react/reference/type-aliases/MutationKey.md +++ b/docs/framework/react/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) +Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) diff --git a/docs/framework/react/reference/type-aliases/MutationMeta.md b/docs/framework/react/reference/type-aliases/MutationMeta.md index 474c593e206..ff1f9b4bf94 100644 --- a/docs/framework/react/reference/type-aliases/MutationMeta.md +++ b/docs/framework/react/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) +Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) diff --git a/docs/framework/react/reference/type-aliases/MutationObserverResult.md b/docs/framework/react/reference/type-aliases/MutationObserverResult.md index 21e43836bf6..c21fc3ac591 100644 --- a/docs/framework/react/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/react/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1464](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1464) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/MutationScope.md b/docs/framework/react/reference/type-aliases/MutationScope.md index feac9d9d17a..1d6a91bd434 100644 --- a/docs/framework/react/reference/type-aliases/MutationScope.md +++ b/docs/framework/react/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1167) +Defined in: [packages/query-core/src/types.ts:1177](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1177) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) diff --git a/docs/framework/react/reference/type-aliases/MutationStatus.md b/docs/framework/react/reference/type-aliases/MutationStatus.md index 4cd2d3c9535..cf12d3d3ee3 100644 --- a/docs/framework/react/reference/type-aliases/MutationStatus.md +++ b/docs/framework/react/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) +Defined in: [packages/query-core/src/types.ts:1175](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1175) diff --git a/docs/framework/react/reference/type-aliases/NotifyEventType.md b/docs/framework/react/reference/type-aliases/NotifyEventType.md index 9bbc85e4ce8..ffa60b016e3 100644 --- a/docs/framework/react/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/react/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1510](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1510) +Defined in: [packages/query-core/src/types.ts:1530](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1530) diff --git a/docs/framework/react/reference/type-aliases/QueryObserverResult.md b/docs/framework/react/reference/type-aliases/QueryObserverResult.md index 4fc661a6c9d..5138b635f2c 100644 --- a/docs/framework/react/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/react/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/QueryStatus.md b/docs/framework/react/reference/type-aliases/QueryStatus.md index 6679b8b17c6..bab00f6f423 100644 --- a/docs/framework/react/reference/type-aliases/QueryStatus.md +++ b/docs/framework/react/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:751](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L751) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) diff --git a/docs/framework/react/reference/type-aliases/ThrowOnError.md b/docs/framework/react/reference/type-aliases/ThrowOnError.md index 613549e4d52..134683388ef 100644 --- a/docs/framework/react/reference/type-aliases/ThrowOnError.md +++ b/docs/framework/react/reference/type-aliases/ThrowOnError.md @@ -7,7 +7,7 @@ title: ThrowOnError type ThrowOnError = boolean | (error, query) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L363) +Defined in: [packages/query-core/src/types.ts:368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L368) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/WithRequired.md b/docs/framework/react/reference/type-aliases/WithRequired.md index deb87dfe4a4..a40a48c865b 100644 --- a/docs/framework/react/reference/type-aliases/WithRequired.md +++ b/docs/framework/react/reference/type-aliases/WithRequired.md @@ -7,7 +7,7 @@ title: WithRequired type WithRequired = TTarget & { [_ in TKey]: {} }; ``` -Defined in: [packages/query-core/src/types.ts:516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L516) +Defined in: [packages/query-core/src/types.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L524) ## Type Parameters diff --git a/docs/framework/solid/reference/interfaces/CancelOptions.md b/docs/framework/solid/reference/interfaces/CancelOptions.md index f52c729f3b1..b7464c48e50 100644 --- a/docs/framework/solid/reference/interfaces/CancelOptions.md +++ b/docs/framework/solid/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1501) +Defined in: [packages/query-core/src/types.ts:1521](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1521) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) +Defined in: [packages/query-core/src/types.ts:1522](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1522) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1503) +Defined in: [packages/query-core/src/types.ts:1523](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1523) diff --git a/docs/framework/solid/reference/interfaces/DefaultOptions.md b/docs/framework/solid/reference/interfaces/DefaultOptions.md index 5ebc9ffe6fc..8f49e18d70a 100644 --- a/docs/framework/solid/reference/interfaces/DefaultOptions.md +++ b/docs/framework/solid/reference/interfaces/DefaultOptions.md @@ -28,7 +28,7 @@ The default type of errors thrown by queries and mutations using this `QueryClie optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1498](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1498) +Defined in: [packages/query-core/src/types.ts:1518](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1518) Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). @@ -46,7 +46,7 @@ CoreDefaultOptions.dehydrate optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1496](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1496) +Defined in: [packages/query-core/src/types.ts:1516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1516) Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). @@ -88,7 +88,7 @@ CoreDefaultOptions.hydrate optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1494](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1494) +Defined in: [packages/query-core/src/types.ts:1514](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1514) Default options applied to every mutation, unless overridden per-mutation. diff --git a/docs/framework/solid/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/solid/reference/interfaces/EnsureQueryDataOptions.md index d71a60902e6..a67082af57e 100644 --- a/docs/framework/solid/reference/interfaces/EnsureQueryDataOptions.md +++ b/docs/framework/solid/reference/interfaces/EnsureQueryDataOptions.md @@ -3,7 +3,7 @@ id: EnsureQueryDataOptions title: EnsureQueryDataOptions --- -Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L606) +Defined in: [packages/query-core/src/types.ts:614](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L614) ## Deprecated @@ -41,12 +41,13 @@ Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -66,7 +67,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -87,7 +88,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -103,7 +104,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) +Defined in: [packages/query-core/src/types.ts:605](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L605) #### Inherited from @@ -117,7 +118,7 @@ Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -133,7 +134,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -150,7 +151,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -170,7 +173,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -189,7 +192,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -209,7 +212,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -226,7 +229,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -247,7 +250,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -284,7 +287,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -294,6 +297,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`FetchQueryOptions`](FetchQueryOptions.md).[`retryDelay`](FetchQueryOptions.md#retrydelay) @@ -306,7 +311,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional revalidateIfStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L619) +Defined in: [packages/query-core/src/types.ts:627](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L627) *** @@ -316,7 +321,7 @@ Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) +Defined in: [packages/query-core/src/types.ts:610](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L610) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -333,7 +338,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/solid/reference/interfaces/FetchNextPageOptions.md b/docs/framework/solid/reference/interfaces/FetchNextPageOptions.md index 2c0be977140..b79cdbe19b3 100644 --- a/docs/framework/solid/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/solid/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:736](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L736) +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,9 +34,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/solid/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/solid/reference/interfaces/FetchPreviousPageOptions.md index 683e789ee52..fd5a08767b6 100644 --- a/docs/framework/solid/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/solid/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L739) +Defined in: [packages/query-core/src/types.ts:749](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L749) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:748](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L748) +Defined in: [packages/query-core/src/types.ts:758](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L758) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,9 +34,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/solid/reference/interfaces/FetchQueryOptions.md b/docs/framework/solid/reference/interfaces/FetchQueryOptions.md index 0820a2a87b7..1b8582adba7 100644 --- a/docs/framework/solid/reference/interfaces/FetchQueryOptions.md +++ b/docs/framework/solid/reference/interfaces/FetchQueryOptions.md @@ -3,7 +3,7 @@ id: FetchQueryOptions title: FetchQueryOptions --- -Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L587) +Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) ## Deprecated @@ -45,12 +45,13 @@ Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -72,7 +73,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -95,7 +96,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -113,7 +114,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) +Defined in: [packages/query-core/src/types.ts:605](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L605) *** @@ -123,7 +124,7 @@ Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -141,7 +142,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -160,7 +161,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -182,7 +185,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -203,7 +206,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -225,7 +228,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -244,7 +247,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -267,7 +270,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -308,7 +311,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -318,6 +321,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -332,7 +337,7 @@ WithRequired.retryDelay optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) +Defined in: [packages/query-core/src/types.ts:610](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L610) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -345,7 +350,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverBaseResult.md index 9195e0727f8..0aa01962aa5 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L991) +Defined in: [packages/query-core/src/types.ts:1001](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1001) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:771](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L771) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) +Defined in: [packages/query-core/src/types.ts:804](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L804) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) +Defined in: [packages/query-core/src/types.ts:827](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L827) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) +Defined in: [packages/query-core/src/types.ts:845](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L845) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) +Defined in: [packages/query-core/src/types.ts:849](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L849) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 2841b5ab116..f5e3352f27c 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) +Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1076](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1076) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1077](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1077) +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult.md index 95ff84b3ef3..b7aa67744c0 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverOptions.md index 2cee726829b..5fe9870e1dd 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverOptions.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverOptions.md @@ -51,7 +51,7 @@ The type of the parameter passed to `queryFn` to fetch a given page. optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -73,12 +73,13 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -96,7 +97,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -115,7 +116,7 @@ OmitKeyof.getNextPageParam optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -136,7 +137,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -159,7 +160,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -177,7 +178,7 @@ OmitKeyof.initialDataUpdatedAt initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from @@ -193,7 +194,7 @@ OmitKeyof.initialPageParam optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -209,7 +210,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -226,7 +227,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -246,13 +249,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -268,7 +273,7 @@ OmitKeyof.notifyOnChangeProps optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -289,7 +294,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -309,7 +314,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -331,7 +336,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -348,7 +353,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -371,7 +376,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -404,7 +409,7 @@ Defaults reconciliation to false. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -425,9 +430,10 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -444,7 +450,7 @@ OmitKeyof.refetchIntervalInBackground optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -467,7 +473,7 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -490,7 +496,7 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -536,7 +542,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -546,6 +552,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -560,7 +568,7 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -581,7 +589,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -612,7 +620,7 @@ OmitKeyof.select optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -635,7 +643,7 @@ OmitKeyof.staleTime optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -656,7 +664,7 @@ OmitKeyof.suspense optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult.md index c3e8b022cdb..a09301ab6c4 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1042](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1042) +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index e62579744ba..58193a987d1 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) +Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) +Defined in: [packages/query-core/src/types.ts:1136](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1136) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) +Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1133](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1133) +Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1128) +Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1129](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1129) +Defined in: [packages/query-core/src/types.ts:1139](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1139) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) +Defined in: [packages/query-core/src/types.ts:1137](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1137) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1132](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1132) +Defined in: [packages/query-core/src/types.ts:1142](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1142) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) +Defined in: [packages/query-core/src/types.ts:1140](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1140) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) +Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) +Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index a67e877f083..4ce469bceed 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1094](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1094) +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 0b875662cbc..131f6d01ae7 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) +Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) +Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) +Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) +Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) +Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryOptions.md b/docs/framework/solid/reference/interfaces/InfiniteQueryOptions.md index a262c993309..90b3cddf167 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryOptions.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryOptions.md @@ -66,7 +66,7 @@ Defaults to `false`. optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -88,12 +88,13 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -111,7 +112,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -130,7 +131,7 @@ OmitKeyof.getNextPageParam optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -151,7 +152,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -174,7 +175,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -192,7 +193,7 @@ OmitKeyof.initialDataUpdatedAt initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from @@ -208,7 +209,7 @@ OmitKeyof.initialPageParam optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -224,7 +225,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -241,7 +242,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -261,13 +264,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -283,7 +288,7 @@ OmitKeyof.notifyOnChangeProps optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -304,7 +309,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -324,7 +329,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -346,7 +351,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -373,7 +378,7 @@ Defined in: [packages/solid-query/src/types.ts:173](https://github.com/TanStack/ optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -412,7 +417,7 @@ OmitKeyof.reconcile optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -433,9 +438,10 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -452,7 +458,7 @@ OmitKeyof.refetchIntervalInBackground optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -475,7 +481,7 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -498,7 +504,7 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -544,7 +550,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -554,6 +560,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -568,7 +576,7 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -589,7 +597,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -620,7 +628,7 @@ OmitKeyof.select optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -659,7 +667,7 @@ Setting `suspense` to `false` will be a no-op. optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/solid/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/solid/reference/interfaces/InfiniteQueryPageParamsOptions.md index b22eacacbd4..2d98fbfaff4 100644 --- a/docs/framework/solid/reference/interfaces/InfiniteQueryPageParamsOptions.md +++ b/docs/framework/solid/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryPageParamsOptions title: InfiniteQueryPageParamsOptions --- -Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L347) +Defined in: [packages/query-core/src/types.ts:352](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L352) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/q getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -40,7 +40,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -53,7 +53,7 @@ The result will also be used to determine the value of `hasPreviousPage`. initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from diff --git a/docs/framework/solid/reference/interfaces/InitialPageParam.md b/docs/framework/solid/reference/interfaces/InitialPageParam.md index 2d42bf029a4..46d2b219ea4 100644 --- a/docs/framework/solid/reference/interfaces/InitialPageParam.md +++ b/docs/framework/solid/reference/interfaces/InitialPageParam.md @@ -3,7 +3,7 @@ id: InitialPageParam title: InitialPageParam --- -Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L343) +Defined in: [packages/query-core/src/types.ts:348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L348) ## Extended by @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/q initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) diff --git a/docs/framework/solid/reference/interfaces/InvalidateOptions.md b/docs/framework/solid/reference/interfaces/InvalidateOptions.md index d83ecd43ec0..8a81428b035 100644 --- a/docs/framework/solid/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/solid/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) +Defined in: [packages/query-core/src/types.ts:734](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L734) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,9 +37,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/solid/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/solid/reference/interfaces/InvalidateQueryFilters.md index 36eb3f27998..569e42a4e1b 100644 --- a/docs/framework/solid/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/solid/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) +Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -100,9 +100,10 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:717](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L717) +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) Controls which of the matched (now-invalidated) queries are refetched in the background. + Defaults to `'active'`. - `'active'`: only queries with at least one active observer are refetched. - `'inactive'`: only queries with no active observer are refetched. diff --git a/docs/framework/solid/reference/interfaces/MutateOptions.md b/docs/framework/solid/reference/interfaces/MutateOptions.md index b12b3b29ec2..34e2a4d4d7e 100644 --- a/docs/framework/solid/reference/interfaces/MutateOptions.md +++ b/docs/framework/solid/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) +Defined in: [packages/query-core/src/types.ts:1284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1284) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) +Defined in: [packages/query-core/src/types.ts:1296](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1296) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1282) +Defined in: [packages/query-core/src/types.ts:1302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1302) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1270](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1270) +Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) #### Parameters diff --git a/docs/framework/solid/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/solid/reference/interfaces/MutationObserverBaseResult.md index e1c09a56737..340a38cc9cc 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1315) +Defined in: [packages/query-core/src/types.ts:1335](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1335) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1324](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1324) +Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1333](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1333) +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) +Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) +Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) +Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1328](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1328) +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) The variables object passed to the `mutationFn`. diff --git a/docs/framework/solid/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/solid/reference/interfaces/MutationObserverErrorResult.md index cce591e3465..72e459a2e0b 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) +Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) +Defined in: [packages/query-core/src/types.ts:1453](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1453) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) +Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) +Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) +Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) +Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) The variables object passed to the `mutationFn`. diff --git a/docs/framework/solid/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/solid/reference/interfaces/MutationObserverIdleResult.md index b7892846a6c..cd8d6eb3130 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) +Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) +Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1394](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1394) +Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) +Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1396](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1396) +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) +Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) +Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) The variables object passed to the `mutationFn`. diff --git a/docs/framework/solid/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/solid/reference/interfaces/MutationObserverLoadingResult.md index d4368822213..9b70a8558e7 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) +Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) +Defined in: [packages/query-core/src/types.ts:1432](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1432) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) +Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) +Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) +Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) The variables object passed to the `mutationFn`. diff --git a/docs/framework/solid/reference/interfaces/MutationObserverOptions.md b/docs/framework/solid/reference/interfaces/MutationObserverOptions.md index d21a77b5505..b3835184b96 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1255) +Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) ## Extends @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) +Defined in: [packages/query-core/src/types.ts:1260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1260) The time in milliseconds that an unused/inactive mutation remains in memory before it is garbage collected. @@ -56,7 +56,7 @@ MutationOptions.gcTime optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) +Defined in: [packages/query-core/src/types.ts:1263](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1263) #### Inherited from @@ -72,7 +72,7 @@ MutationOptions.meta optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) +Defined in: [packages/query-core/src/types.ts:1206](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1206) #### Inherited from @@ -88,7 +88,7 @@ MutationOptions.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) #### Inherited from @@ -104,7 +104,9 @@ MutationOptions.mutationKey optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1253](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1253) + +Controls whether a mutation is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -126,7 +128,7 @@ MutationOptions.networkMode optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) +Defined in: [packages/query-core/src/types.ts:1218](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1218) #### Parameters @@ -164,7 +166,7 @@ MutationOptions.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -194,7 +196,7 @@ MutationOptions.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) +Defined in: [packages/query-core/src/types.ts:1224](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1224) #### Parameters @@ -236,7 +238,7 @@ MutationOptions.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Parameters @@ -274,7 +276,7 @@ MutationOptions.onSuccess optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1239](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1239) If `false`, failed mutations will not retry by default. If `true`, failed mutations will retry infinitely. @@ -297,7 +299,7 @@ MutationOptions.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) +Defined in: [packages/query-core/src/types.ts:1246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1246) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -318,7 +320,7 @@ MutationOptions.retryDelay optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) #### Inherited from @@ -334,4 +336,11 @@ MutationOptions.scope optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) +Defined in: [packages/query-core/src/types.ts:1281](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1281) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true`, all errors will be thrown to the nearest error boundary. +If set to a function, it will be passed the error and should return a boolean indicating whether to throw the +error (`true`) or return it as state (`false`). + +Defaults to `false`. diff --git a/docs/framework/solid/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/solid/reference/interfaces/MutationObserverSuccessResult.md index 52cdcc4883e..e2e03642f82 100644 --- a/docs/framework/solid/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/solid/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) +Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) +Defined in: [packages/query-core/src/types.ts:1474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1474) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) +Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) +Defined in: [packages/query-core/src/types.ts:1478](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1478) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) +Defined in: [packages/query-core/src/types.ts:1479](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1479) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) +Defined in: [packages/query-core/src/types.ts:1480](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1480) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1481](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1481) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) +Defined in: [packages/query-core/src/types.ts:1476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1476) The variables object passed to the `mutationFn`. diff --git a/docs/framework/solid/reference/interfaces/MutationOptions.md b/docs/framework/solid/reference/interfaces/MutationOptions.md index 65bdaee667b..cd5469e3df8 100644 --- a/docs/framework/solid/reference/interfaces/MutationOptions.md +++ b/docs/framework/solid/reference/interfaces/MutationOptions.md @@ -45,7 +45,7 @@ The type returned by `onMutate`, passed on to `onSuccess`/`onError`/`onSettled`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) +Defined in: [packages/query-core/src/types.ts:1260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1260) The time in milliseconds that an unused/inactive mutation remains in memory before it is garbage collected. @@ -64,7 +64,7 @@ Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) +Defined in: [packages/query-core/src/types.ts:1263](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1263) #### Inherited from @@ -78,7 +78,7 @@ Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) +Defined in: [packages/query-core/src/types.ts:1206](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1206) #### Inherited from @@ -94,7 +94,7 @@ OmitKeyof.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) #### Inherited from @@ -108,7 +108,9 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1253](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1253) + +Controls whether a mutation is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -128,7 +130,7 @@ Defaults to `'online'`. optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) +Defined in: [packages/query-core/src/types.ts:1218](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1218) #### Parameters @@ -166,7 +168,7 @@ OmitKeyof.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -196,7 +198,7 @@ OmitKeyof.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) +Defined in: [packages/query-core/src/types.ts:1224](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1224) #### Parameters @@ -238,7 +240,7 @@ OmitKeyof.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Parameters @@ -276,7 +278,7 @@ OmitKeyof.onSuccess optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1239](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1239) If `false`, failed mutations will not retry by default. If `true`, failed mutations will retry infinitely. @@ -299,7 +301,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) +Defined in: [packages/query-core/src/types.ts:1246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1246) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -320,7 +322,7 @@ OmitKeyof.retryDelay optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) #### Inherited from @@ -334,7 +336,14 @@ Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) +Defined in: [packages/query-core/src/types.ts:1281](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1281) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true`, all errors will be thrown to the nearest error boundary. +If set to a function, it will be passed the error and should return a boolean indicating whether to throw the +error (`true`) or return it as state (`false`). + +Defaults to `false`. #### Inherited from diff --git a/docs/framework/solid/reference/interfaces/NotifyEvent.md b/docs/framework/solid/reference/interfaces/NotifyEvent.md index 5e7875d41b8..4f5b023f49a 100644 --- a/docs/framework/solid/reference/interfaces/NotifyEvent.md +++ b/docs/framework/solid/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1519) +Defined in: [packages/query-core/src/types.ts:1539](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1539) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1520) +Defined in: [packages/query-core/src/types.ts:1540](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1540) diff --git a/docs/framework/solid/reference/interfaces/QueryClientConfig.md b/docs/framework/solid/reference/interfaces/QueryClientConfig.md index c1d293540dc..909b68c943c 100644 --- a/docs/framework/solid/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/solid/reference/interfaces/QueryClientConfig.md @@ -37,7 +37,7 @@ QueryCoreClientConfig.defaultOptions optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1482) +Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) The mutation cache this client is connected to. A new `MutationCache` is created if not provided. @@ -56,7 +56,7 @@ QueryCoreClientConfig.mutationCache optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) +Defined in: [packages/query-core/src/types.ts:1497](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1497) The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/solid/reference/interfaces/QueryExecuteOptions.md b/docs/framework/solid/reference/interfaces/QueryExecuteOptions.md index d2ebd296f94..b16474c4999 100644 --- a/docs/framework/solid/reference/interfaces/QueryExecuteOptions.md +++ b/docs/framework/solid/reference/interfaces/QueryExecuteOptions.md @@ -3,7 +3,7 @@ id: QueryExecuteOptions title: QueryExecuteOptions --- -Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) +Defined in: [packages/query-core/src/types.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L574) ## Extends @@ -43,12 +43,13 @@ Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -70,7 +71,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -93,7 +94,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -111,7 +112,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L577) +Defined in: [packages/query-core/src/types.ts:585](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L585) *** @@ -121,7 +122,7 @@ Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -139,7 +140,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -158,7 +159,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -180,7 +183,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -201,7 +204,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -223,7 +226,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -242,7 +245,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -265,7 +268,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -306,7 +309,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -316,6 +319,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -330,7 +335,7 @@ WithRequired.retryDelay optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L578) +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) #### Parameters @@ -350,7 +355,7 @@ Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:583](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L583) +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -363,7 +368,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/solid/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/solid/reference/interfaces/QueryObserverBaseResult.md index 1b54d6f8041..ef5fe0ad757 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:764](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L764) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:771](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L771) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) +Defined in: [packages/query-core/src/types.ts:804](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L804) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) +Defined in: [packages/query-core/src/types.ts:827](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L827) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) +Defined in: [packages/query-core/src/types.ts:845](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L845) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) +Defined in: [packages/query-core/src/types.ts:849](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L849) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/solid/reference/interfaces/QueryObserverLoadingErrorResult.md index 7a4f855305f..21b39fbffe3 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) +Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/solid/reference/interfaces/QueryObserverLoadingResult.md index 8f94574bcca..4966390127f 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) +Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverOptions.md b/docs/framework/solid/reference/interfaces/QueryObserverOptions.md index 0b082b386e5..29586e133b1 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverOptions.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverOptions.md @@ -58,7 +58,7 @@ is shared with an infinite query's observer options. Defaults to `never` for reg optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -80,12 +80,13 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -105,7 +106,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -128,7 +129,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -146,7 +147,7 @@ OmitKeyof.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -162,7 +163,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -179,7 +180,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -199,13 +202,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -221,7 +226,7 @@ OmitKeyof.notifyOnChangeProps optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -242,7 +247,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -262,7 +267,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -284,7 +289,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -301,7 +306,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -324,7 +329,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -357,7 +362,7 @@ Defaults reconciliation to false. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -378,9 +383,10 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -397,7 +403,7 @@ OmitKeyof.refetchIntervalInBackground optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -420,7 +426,7 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -443,7 +449,7 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -489,7 +495,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -499,6 +505,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -513,7 +521,7 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -534,7 +542,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -565,7 +573,7 @@ OmitKeyof.select optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -588,7 +596,7 @@ OmitKeyof.staleTime optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -609,7 +617,7 @@ OmitKeyof.suspense optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/solid/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/solid/reference/interfaces/QueryObserverPendingResult.md index 41a101c7c8c..8f00c426b64 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:887](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L887) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L888) +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) +Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/solid/reference/interfaces/QueryObserverPlaceholderResult.md index cce7cffcc9b..bbf3da387f9 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) +Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) +Defined in: [packages/query-core/src/types.ts:975](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L975) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) +Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) +Defined in: [packages/query-core/src/types.ts:976](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L976) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:969](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L969) +Defined in: [packages/query-core/src/types.ts:979](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L979) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L970) +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) +Defined in: [packages/query-core/src/types.ts:978](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L978) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) +Defined in: [packages/query-core/src/types.ts:983](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L983) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) +Defined in: [packages/query-core/src/types.ts:981](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L981) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:972](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L972) +Defined in: [packages/query-core/src/types.ts:982](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L982) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/solid/reference/interfaces/QueryObserverRefetchErrorResult.md index 8486e8cf4cb..345ecab35e1 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) +Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/solid/reference/interfaces/QueryObserverSuccessResult.md index f126bea0f70..3942655c627 100644 --- a/docs/framework/solid/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/solid/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) +Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) +Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) +Defined in: [packages/query-core/src/types.ts:964](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L964) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) +Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) +Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) +Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) The status of the query. - Will be: diff --git a/docs/framework/solid/reference/interfaces/QueryOptions.md b/docs/framework/solid/reference/interfaces/QueryOptions.md index ce20ed0bbd1..b7e06727190 100644 --- a/docs/framework/solid/reference/interfaces/QueryOptions.md +++ b/docs/framework/solid/reference/interfaces/QueryOptions.md @@ -65,7 +65,7 @@ Defaults to `false`. optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -85,12 +85,13 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -110,7 +111,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -131,7 +132,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -147,7 +148,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -163,7 +164,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -180,7 +181,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -200,13 +203,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -220,7 +225,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -283,7 +288,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -301,7 +306,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -321,7 +326,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -338,7 +343,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -359,7 +364,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -394,7 +399,7 @@ Defaults reconciliation to false. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -413,9 +418,10 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -430,7 +436,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -451,7 +457,7 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -472,7 +478,7 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -514,7 +520,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -524,6 +530,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`UseBaseQueryOptions`](UseBaseQueryOptions.md).[`retryDelay`](UseBaseQueryOptions.md#retrydelay) @@ -536,7 +544,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -555,7 +563,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -584,7 +592,7 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -625,7 +633,7 @@ Setting `suspense` to `false` will be a no-op. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/solid/reference/interfaces/RefetchOptions.md b/docs/framework/solid/reference/interfaces/RefetchOptions.md index 104412c5bac..cfcc0498799 100644 --- a/docs/framework/solid/reference/interfaces/RefetchOptions.md +++ b/docs/framework/solid/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) +Defined in: [packages/query-core/src/types.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L704) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,9 +38,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/solid/reference/interfaces/RefetchQueryFilters.md b/docs/framework/solid/reference/interfaces/RefetchQueryFilters.md index bde28360fa1..c45dfa953f1 100644 --- a/docs/framework/solid/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/solid/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:720](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L720) +Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. diff --git a/docs/framework/solid/reference/interfaces/ResetOptions.md b/docs/framework/solid/reference/interfaces/ResetOptions.md index 6d3a8398fbb..9f12324ba27 100644 --- a/docs/framework/solid/reference/interfaces/ResetOptions.md +++ b/docs/framework/solid/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) +Defined in: [packages/query-core/src/types.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L735) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,9 +37,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/solid/reference/interfaces/ResultOptions.md b/docs/framework/solid/reference/interfaces/ResultOptions.md index f3da151a3ec..42917f20bf0 100644 --- a/docs/framework/solid/reference/interfaces/ResultOptions.md +++ b/docs/framework/solid/reference/interfaces/ResultOptions.md @@ -3,7 +3,7 @@ id: ResultOptions title: ResultOptions --- -Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L686) +Defined in: [packages/query-core/src/types.ts:694](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L694) ## Extended by @@ -19,8 +19,9 @@ Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/solid/reference/interfaces/SetDataOptions.md b/docs/framework/solid/reference/interfaces/SetDataOptions.md index cac83e9312a..bb668fbf162 100644 --- a/docs/framework/solid/reference/interfaces/SetDataOptions.md +++ b/docs/framework/solid/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1506) +Defined in: [packages/query-core/src/types.ts:1526](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1526) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) +Defined in: [packages/query-core/src/types.ts:1527](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1527) diff --git a/docs/framework/solid/reference/interfaces/UseBaseQueryOptions.md b/docs/framework/solid/reference/interfaces/UseBaseQueryOptions.md index 299c55e9f67..4cab9707943 100644 --- a/docs/framework/solid/reference/interfaces/UseBaseQueryOptions.md +++ b/docs/framework/solid/reference/interfaces/UseBaseQueryOptions.md @@ -73,7 +73,7 @@ Defaults to `false`. optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -95,12 +95,13 @@ OmitKeyof.enabled optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -120,7 +121,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -143,7 +144,7 @@ OmitKeyof.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -161,7 +162,7 @@ OmitKeyof.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -177,7 +178,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -194,7 +195,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -214,13 +217,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -236,7 +241,7 @@ OmitKeyof.notifyOnChangeProps optional persister: (queryFn, context, query) => TQueryFnData | Promise; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -301,7 +306,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -321,7 +326,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -343,7 +348,7 @@ OmitKeyof.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -360,7 +365,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -383,7 +388,7 @@ OmitKeyof.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -422,7 +427,7 @@ OmitKeyof.reconcile optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -443,9 +448,10 @@ OmitKeyof.refetchInterval optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -462,7 +468,7 @@ OmitKeyof.refetchIntervalInBackground optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -485,7 +491,7 @@ OmitKeyof.refetchOnMount optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -508,7 +514,7 @@ OmitKeyof.refetchOnReconnect optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -554,7 +560,7 @@ OmitKeyof.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -564,6 +570,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -578,7 +586,7 @@ OmitKeyof.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -599,7 +607,7 @@ OmitKeyof.retryOnMount optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -630,7 +638,7 @@ OmitKeyof.select optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -669,7 +677,7 @@ Setting `suspense` to `false` will be a no-op. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/solid/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/solid/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md index 4412ad00c8e..82c7ddbb886 100644 --- a/docs/framework/solid/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md +++ b/docs/framework/solid/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedInfiniteQueryObserverOptions type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:549](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L549) +Defined in: [packages/query-core/src/types.ts:557](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L557) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/solid/reference/type-aliases/DefaultedQueryObserverOptions.md index 9ce8401b128..7687d8c24f6 100644 --- a/docs/framework/solid/reference/type-aliases/DefaultedQueryObserverOptions.md +++ b/docs/framework/solid/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedQueryObserverOptions type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) +Defined in: [packages/query-core/src/types.ts:528](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L528) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index cec33b142b7..38dac7cfe2b 100644 --- a/docs/framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/solid/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) +Defined in: [packages/query-core/src/types.ts:1148](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1148) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/solid/reference/type-aliases/DefinedQueryObserverResult.md index b4480af3810..ae77ddcc22d 100644 --- a/docs/framework/solid/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/solid/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/solid/reference/type-aliases/EnsureInfiniteQueryDataOptions.md index ff75b1c3449..7648331fca2 100644 --- a/docs/framework/solid/reference/type-aliases/EnsureInfiniteQueryDataOptions.md +++ b/docs/framework/solid/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -7,7 +7,7 @@ title: EnsureInfiniteQueryDataOptions type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; ``` -Defined in: [packages/query-core/src/types.ts:623](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L623) +Defined in: [packages/query-core/src/types.ts:631](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L631) ## Type Declaration diff --git a/docs/framework/solid/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/solid/reference/type-aliases/FetchInfiniteQueryOptions.md index c926bbd3ae5..d00a2455889 100644 --- a/docs/framework/solid/reference/type-aliases/FetchInfiniteQueryOptions.md +++ b/docs/framework/solid/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: FetchInfiniteQueryOptions type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:667](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L667) +Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/FetchStatus.md b/docs/framework/solid/reference/type-aliases/FetchStatus.md index b347069e97e..d50002355ca 100644 --- a/docs/framework/solid/reference/type-aliases/FetchStatus.md +++ b/docs/framework/solid/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:752](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L752) +Defined in: [packages/query-core/src/types.ts:762](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L762) diff --git a/docs/framework/solid/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/solid/reference/type-aliases/InfiniteQueryExecuteOptions.md index c198662a319..259c97c96bb 100644 --- a/docs/framework/solid/reference/type-aliases/InfiniteQueryExecuteOptions.md +++ b/docs/framework/solid/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -7,7 +7,7 @@ title: InfiniteQueryExecuteOptions type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:646](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L646) +Defined in: [packages/query-core/src/types.ts:654](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L654) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/solid/reference/type-aliases/InfiniteQueryObserverResult.md index 42279b19c00..aa27563b9cd 100644 --- a/docs/framework/solid/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/solid/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/MutateFunction.md b/docs/framework/solid/reference/type-aliases/MutateFunction.md index 558040d3439..e12b7a80291 100644 --- a/docs/framework/solid/reference/type-aliases/MutateFunction.md +++ b/docs/framework/solid/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1306](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1306) +Defined in: [packages/query-core/src/types.ts:1326](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1326) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/MutateFunctionRest.md b/docs/framework/solid/reference/type-aliases/MutateFunctionRest.md index 3e7a5217482..3902f1082f9 100644 --- a/docs/framework/solid/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/solid/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1291](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1291) +Defined in: [packages/query-core/src/types.ts:1311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1311) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/MutationFunction.md b/docs/framework/solid/reference/type-aliases/MutationFunction.md index 330af1ef65a..9bafb3db56b 100644 --- a/docs/framework/solid/reference/type-aliases/MutationFunction.md +++ b/docs/framework/solid/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1195](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1195) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/MutationFunctionContext.md b/docs/framework/solid/reference/type-aliases/MutationFunctionContext.md index 97de2f1c220..0207256c702 100644 --- a/docs/framework/solid/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/solid/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) +Defined in: [packages/query-core/src/types.ts:1189](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1189) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1180) +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1182](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1182) +Defined in: [packages/query-core/src/types.ts:1192](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1192) diff --git a/docs/framework/solid/reference/type-aliases/MutationKey.md b/docs/framework/solid/reference/type-aliases/MutationKey.md index 8e9d3bc3b3a..9d1d7f0f77b 100644 --- a/docs/framework/solid/reference/type-aliases/MutationKey.md +++ b/docs/framework/solid/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) +Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) diff --git a/docs/framework/solid/reference/type-aliases/MutationMeta.md b/docs/framework/solid/reference/type-aliases/MutationMeta.md index 474c593e206..ff1f9b4bf94 100644 --- a/docs/framework/solid/reference/type-aliases/MutationMeta.md +++ b/docs/framework/solid/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) +Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) diff --git a/docs/framework/solid/reference/type-aliases/MutationObserverResult.md b/docs/framework/solid/reference/type-aliases/MutationObserverResult.md index 21e43836bf6..c21fc3ac591 100644 --- a/docs/framework/solid/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/solid/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1464](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1464) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/MutationScope.md b/docs/framework/solid/reference/type-aliases/MutationScope.md index feac9d9d17a..1d6a91bd434 100644 --- a/docs/framework/solid/reference/type-aliases/MutationScope.md +++ b/docs/framework/solid/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1167) +Defined in: [packages/query-core/src/types.ts:1177](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1177) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) diff --git a/docs/framework/solid/reference/type-aliases/MutationStatus.md b/docs/framework/solid/reference/type-aliases/MutationStatus.md index 4cd2d3c9535..cf12d3d3ee3 100644 --- a/docs/framework/solid/reference/type-aliases/MutationStatus.md +++ b/docs/framework/solid/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) +Defined in: [packages/query-core/src/types.ts:1175](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1175) diff --git a/docs/framework/solid/reference/type-aliases/NotifyEventType.md b/docs/framework/solid/reference/type-aliases/NotifyEventType.md index 9bbc85e4ce8..ffa60b016e3 100644 --- a/docs/framework/solid/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/solid/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1510](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1510) +Defined in: [packages/query-core/src/types.ts:1530](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1530) diff --git a/docs/framework/solid/reference/type-aliases/QueryObserverResult.md b/docs/framework/solid/reference/type-aliases/QueryObserverResult.md index 4fc661a6c9d..5138b635f2c 100644 --- a/docs/framework/solid/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/solid/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/QueryStatus.md b/docs/framework/solid/reference/type-aliases/QueryStatus.md index 6679b8b17c6..bab00f6f423 100644 --- a/docs/framework/solid/reference/type-aliases/QueryStatus.md +++ b/docs/framework/solid/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:751](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L751) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) diff --git a/docs/framework/solid/reference/type-aliases/ThrowOnError.md b/docs/framework/solid/reference/type-aliases/ThrowOnError.md index 613549e4d52..134683388ef 100644 --- a/docs/framework/solid/reference/type-aliases/ThrowOnError.md +++ b/docs/framework/solid/reference/type-aliases/ThrowOnError.md @@ -7,7 +7,7 @@ title: ThrowOnError type ThrowOnError = boolean | (error, query) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L363) +Defined in: [packages/query-core/src/types.ts:368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L368) ## Type Parameters diff --git a/docs/framework/solid/reference/type-aliases/WithRequired.md b/docs/framework/solid/reference/type-aliases/WithRequired.md index deb87dfe4a4..a40a48c865b 100644 --- a/docs/framework/solid/reference/type-aliases/WithRequired.md +++ b/docs/framework/solid/reference/type-aliases/WithRequired.md @@ -7,7 +7,7 @@ title: WithRequired type WithRequired = TTarget & { [_ in TKey]: {} }; ``` -Defined in: [packages/query-core/src/types.ts:516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L516) +Defined in: [packages/query-core/src/types.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L524) ## Type Parameters diff --git a/docs/framework/svelte/reference/interfaces/CancelOptions.md b/docs/framework/svelte/reference/interfaces/CancelOptions.md index f52c729f3b1..b7464c48e50 100644 --- a/docs/framework/svelte/reference/interfaces/CancelOptions.md +++ b/docs/framework/svelte/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1501) +Defined in: [packages/query-core/src/types.ts:1521](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1521) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) +Defined in: [packages/query-core/src/types.ts:1522](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1522) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1503) +Defined in: [packages/query-core/src/types.ts:1523](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1523) diff --git a/docs/framework/svelte/reference/interfaces/DefaultOptions.md b/docs/framework/svelte/reference/interfaces/DefaultOptions.md index 67ae012f9ee..e45a56f075f 100644 --- a/docs/framework/svelte/reference/interfaces/DefaultOptions.md +++ b/docs/framework/svelte/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1487) +Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) ## Type Parameters @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/ optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1498](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1498) +Defined in: [packages/query-core/src/types.ts:1518](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1518) Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). @@ -31,7 +31,7 @@ Default options used when dehydrating the client's caches; see [DehydrateOptions optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1496](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1496) +Defined in: [packages/query-core/src/types.ts:1516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1516) Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). @@ -67,7 +67,7 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1494](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1494) +Defined in: [packages/query-core/src/types.ts:1514](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1514) Default options applied to every mutation, unless overridden per-mutation. @@ -79,6 +79,6 @@ Default options applied to every mutation, unless overridden per-mutation. optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: [packages/query-core/src/types.ts:1489](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1489) +Defined in: [packages/query-core/src/types.ts:1509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1509) Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/svelte/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/svelte/reference/interfaces/EnsureQueryDataOptions.md index d71a60902e6..a67082af57e 100644 --- a/docs/framework/svelte/reference/interfaces/EnsureQueryDataOptions.md +++ b/docs/framework/svelte/reference/interfaces/EnsureQueryDataOptions.md @@ -3,7 +3,7 @@ id: EnsureQueryDataOptions title: EnsureQueryDataOptions --- -Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L606) +Defined in: [packages/query-core/src/types.ts:614](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L614) ## Deprecated @@ -41,12 +41,13 @@ Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -66,7 +67,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -87,7 +88,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -103,7 +104,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) +Defined in: [packages/query-core/src/types.ts:605](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L605) #### Inherited from @@ -117,7 +118,7 @@ Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -133,7 +134,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -150,7 +151,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -170,7 +173,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -189,7 +192,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -209,7 +212,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -226,7 +229,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -247,7 +250,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -284,7 +287,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -294,6 +297,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`FetchQueryOptions`](FetchQueryOptions.md).[`retryDelay`](FetchQueryOptions.md#retrydelay) @@ -306,7 +311,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional revalidateIfStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L619) +Defined in: [packages/query-core/src/types.ts:627](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L627) *** @@ -316,7 +321,7 @@ Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) +Defined in: [packages/query-core/src/types.ts:610](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L610) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -333,7 +338,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/svelte/reference/interfaces/FetchNextPageOptions.md b/docs/framework/svelte/reference/interfaces/FetchNextPageOptions.md index 2c0be977140..b79cdbe19b3 100644 --- a/docs/framework/svelte/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/svelte/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:736](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L736) +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,9 +34,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/svelte/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/svelte/reference/interfaces/FetchPreviousPageOptions.md index 683e789ee52..fd5a08767b6 100644 --- a/docs/framework/svelte/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/svelte/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L739) +Defined in: [packages/query-core/src/types.ts:749](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L749) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:748](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L748) +Defined in: [packages/query-core/src/types.ts:758](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L758) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,9 +34,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/svelte/reference/interfaces/FetchQueryOptions.md b/docs/framework/svelte/reference/interfaces/FetchQueryOptions.md index 634ae0e09f9..b00973badc0 100644 --- a/docs/framework/svelte/reference/interfaces/FetchQueryOptions.md +++ b/docs/framework/svelte/reference/interfaces/FetchQueryOptions.md @@ -3,7 +3,7 @@ id: FetchQueryOptions title: FetchQueryOptions --- -Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L587) +Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) ## Deprecated @@ -45,12 +45,13 @@ Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -72,7 +73,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -95,7 +96,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -113,7 +114,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) +Defined in: [packages/query-core/src/types.ts:605](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L605) *** @@ -123,7 +124,7 @@ Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -141,7 +142,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -160,7 +161,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -182,7 +185,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -203,7 +206,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -225,7 +228,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -244,7 +247,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -267,7 +270,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -308,7 +311,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -318,6 +321,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -332,7 +337,7 @@ WithRequired.retryDelay optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) +Defined in: [packages/query-core/src/types.ts:610](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L610) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -345,7 +350,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult.md index 9195e0727f8..0aa01962aa5 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L991) +Defined in: [packages/query-core/src/types.ts:1001](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1001) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:771](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L771) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) +Defined in: [packages/query-core/src/types.ts:804](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L804) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) +Defined in: [packages/query-core/src/types.ts:827](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L827) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) +Defined in: [packages/query-core/src/types.ts:845](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L845) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) +Defined in: [packages/query-core/src/types.ts:849](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L849) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 2841b5ab116..f5e3352f27c 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) +Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1076](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1076) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1077](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1077) +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult.md index 95ff84b3ef3..b7aa67744c0 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverOptions.md index 7d5b0dd1a4d..7670bd8e24b 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverOptions.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverOptions title: InfiniteQueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L531) +Defined in: [packages/query-core/src/types.ts:539](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L539) ## Extends @@ -39,7 +39,7 @@ Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/q optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -59,12 +59,13 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -82,7 +83,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -99,7 +100,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -118,7 +119,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -139,7 +140,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -155,7 +156,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from @@ -169,7 +170,7 @@ Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -185,7 +186,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -202,7 +203,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -222,13 +225,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -242,7 +247,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -261,7 +266,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -279,7 +284,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -299,7 +304,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -316,7 +321,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -337,7 +342,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -353,7 +358,7 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -372,9 +377,10 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -389,7 +395,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -410,7 +416,7 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -431,7 +437,7 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -473,7 +479,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -483,6 +489,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) @@ -495,7 +503,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -514,7 +522,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -543,7 +551,7 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -564,7 +572,7 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -583,7 +591,7 @@ Defaults to `true`. optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -602,7 +610,7 @@ Defaults to `false`. optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult.md index c3e8b022cdb..a09301ab6c4 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1042](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1042) +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index e62579744ba..58193a987d1 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) +Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) +Defined in: [packages/query-core/src/types.ts:1136](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1136) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) +Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1133](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1133) +Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1128) +Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1129](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1129) +Defined in: [packages/query-core/src/types.ts:1139](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1139) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) +Defined in: [packages/query-core/src/types.ts:1137](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1137) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1132](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1132) +Defined in: [packages/query-core/src/types.ts:1142](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1142) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) +Defined in: [packages/query-core/src/types.ts:1140](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1140) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) +Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) +Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index a67e877f083..4ce469bceed 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1094](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1094) +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 0b875662cbc..131f6d01ae7 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) +Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) +Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) +Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) +Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) +Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/svelte/reference/interfaces/InfiniteQueryPageParamsOptions.md index afe27785edc..c091cc15456 100644 --- a/docs/framework/svelte/reference/interfaces/InfiniteQueryPageParamsOptions.md +++ b/docs/framework/svelte/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryPageParamsOptions title: InfiniteQueryPageParamsOptions --- -Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L347) +Defined in: [packages/query-core/src/types.ts:352](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L352) ## Extends @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/q getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -44,7 +44,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -57,7 +57,7 @@ The result will also be used to determine the value of `hasPreviousPage`. initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from diff --git a/docs/framework/svelte/reference/interfaces/InitialPageParam.md b/docs/framework/svelte/reference/interfaces/InitialPageParam.md index 2d42bf029a4..46d2b219ea4 100644 --- a/docs/framework/svelte/reference/interfaces/InitialPageParam.md +++ b/docs/framework/svelte/reference/interfaces/InitialPageParam.md @@ -3,7 +3,7 @@ id: InitialPageParam title: InitialPageParam --- -Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L343) +Defined in: [packages/query-core/src/types.ts:348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L348) ## Extended by @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/q initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) diff --git a/docs/framework/svelte/reference/interfaces/InvalidateOptions.md b/docs/framework/svelte/reference/interfaces/InvalidateOptions.md index d83ecd43ec0..8a81428b035 100644 --- a/docs/framework/svelte/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/svelte/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) +Defined in: [packages/query-core/src/types.ts:734](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L734) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,9 +37,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/svelte/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/svelte/reference/interfaces/InvalidateQueryFilters.md index 36eb3f27998..569e42a4e1b 100644 --- a/docs/framework/svelte/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/svelte/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) +Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. @@ -100,9 +100,10 @@ Include queries matching this query key optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:717](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L717) +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) Controls which of the matched (now-invalidated) queries are refetched in the background. + Defaults to `'active'`. - `'active'`: only queries with at least one active observer are refetched. - `'inactive'`: only queries with no active observer are refetched. diff --git a/docs/framework/svelte/reference/interfaces/MutateOptions.md b/docs/framework/svelte/reference/interfaces/MutateOptions.md index b12b3b29ec2..34e2a4d4d7e 100644 --- a/docs/framework/svelte/reference/interfaces/MutateOptions.md +++ b/docs/framework/svelte/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) +Defined in: [packages/query-core/src/types.ts:1284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1284) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) +Defined in: [packages/query-core/src/types.ts:1296](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1296) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1282) +Defined in: [packages/query-core/src/types.ts:1302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1302) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1270](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1270) +Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) #### Parameters diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverBaseResult.md index e1c09a56737..340a38cc9cc 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1315) +Defined in: [packages/query-core/src/types.ts:1335](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1335) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1324](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1324) +Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1333](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1333) +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) +Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) +Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) +Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1328](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1328) +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) The variables object passed to the `mutationFn`. diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverErrorResult.md index cce591e3465..72e459a2e0b 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) +Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) +Defined in: [packages/query-core/src/types.ts:1453](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1453) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) +Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) +Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) +Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) +Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) The variables object passed to the `mutationFn`. diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverIdleResult.md index b7892846a6c..cd8d6eb3130 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) +Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) +Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1394](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1394) +Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) +Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1396](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1396) +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) +Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) +Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) The variables object passed to the `mutationFn`. diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverLoadingResult.md index d4368822213..9b70a8558e7 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) +Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) +Defined in: [packages/query-core/src/types.ts:1432](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1432) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) +Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) +Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) +Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) The variables object passed to the `mutationFn`. diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverOptions.md b/docs/framework/svelte/reference/interfaces/MutationObserverOptions.md index 1e609be9bf1..5bab2840a6d 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1255) +Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) ## Extends @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) +Defined in: [packages/query-core/src/types.ts:1260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1260) The time in milliseconds that an unused/inactive mutation remains in memory before it is garbage collected. @@ -54,7 +54,7 @@ Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) +Defined in: [packages/query-core/src/types.ts:1263](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1263) #### Inherited from @@ -68,7 +68,7 @@ Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) +Defined in: [packages/query-core/src/types.ts:1206](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1206) #### Inherited from @@ -82,7 +82,7 @@ Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) #### Inherited from @@ -96,7 +96,9 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1253](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1253) + +Controls whether a mutation is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -116,7 +118,7 @@ Defaults to `'online'`. optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) +Defined in: [packages/query-core/src/types.ts:1218](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1218) #### Parameters @@ -152,7 +154,7 @@ Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -180,7 +182,7 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) +Defined in: [packages/query-core/src/types.ts:1224](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1224) #### Parameters @@ -220,7 +222,7 @@ Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Parameters @@ -256,7 +258,7 @@ Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1239](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1239) If `false`, failed mutations will not retry by default. If `true`, failed mutations will retry infinitely. @@ -277,7 +279,7 @@ Defaults to `0`. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) +Defined in: [packages/query-core/src/types.ts:1246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1246) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -296,7 +298,7 @@ Defaults to a function that applies exponential backoff, capped at 30 seconds. optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) #### Inherited from @@ -310,4 +312,11 @@ Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/ optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) +Defined in: [packages/query-core/src/types.ts:1281](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1281) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true`, all errors will be thrown to the nearest error boundary. +If set to a function, it will be passed the error and should return a boolean indicating whether to throw the +error (`true`) or return it as state (`false`). + +Defaults to `false`. diff --git a/docs/framework/svelte/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/svelte/reference/interfaces/MutationObserverSuccessResult.md index 52cdcc4883e..e2e03642f82 100644 --- a/docs/framework/svelte/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/svelte/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) +Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) +Defined in: [packages/query-core/src/types.ts:1474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1474) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) +Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) +Defined in: [packages/query-core/src/types.ts:1478](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1478) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) +Defined in: [packages/query-core/src/types.ts:1479](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1479) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) +Defined in: [packages/query-core/src/types.ts:1480](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1480) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1481](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1481) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) +Defined in: [packages/query-core/src/types.ts:1476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1476) The variables object passed to the `mutationFn`. diff --git a/docs/framework/svelte/reference/interfaces/MutationOptions.md b/docs/framework/svelte/reference/interfaces/MutationOptions.md index 49f2b8f4f19..5aabeeb0ca4 100644 --- a/docs/framework/svelte/reference/interfaces/MutationOptions.md +++ b/docs/framework/svelte/reference/interfaces/MutationOptions.md @@ -3,7 +3,7 @@ id: MutationOptions title: MutationOptions --- -Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) +Defined in: [packages/query-core/src/types.ts:1200](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1200) ## Extended by @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) +Defined in: [packages/query-core/src/types.ts:1260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1260) The time in milliseconds that an unused/inactive mutation remains in memory before it is garbage collected. @@ -50,7 +50,7 @@ Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) +Defined in: [packages/query-core/src/types.ts:1263](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1263) *** @@ -60,7 +60,7 @@ Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/ optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) +Defined in: [packages/query-core/src/types.ts:1206](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1206) *** @@ -70,7 +70,7 @@ Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/ optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) *** @@ -80,7 +80,9 @@ Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/ optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1253](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1253) + +Controls whether a mutation is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -96,7 +98,7 @@ Defaults to `'online'`. optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) +Defined in: [packages/query-core/src/types.ts:1218](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1218) #### Parameters @@ -128,7 +130,7 @@ Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/ optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -152,7 +154,7 @@ Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) +Defined in: [packages/query-core/src/types.ts:1224](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1224) #### Parameters @@ -188,7 +190,7 @@ Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Parameters @@ -220,7 +222,7 @@ Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/ optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1239](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1239) If `false`, failed mutations will not retry by default. If `true`, failed mutations will retry infinitely. @@ -237,7 +239,7 @@ Defaults to `0`. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) +Defined in: [packages/query-core/src/types.ts:1246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1246) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -252,4 +254,4 @@ Defaults to a function that applies exponential backoff, capped at 30 seconds. optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) diff --git a/docs/framework/svelte/reference/interfaces/NotifyEvent.md b/docs/framework/svelte/reference/interfaces/NotifyEvent.md index 5e7875d41b8..4f5b023f49a 100644 --- a/docs/framework/svelte/reference/interfaces/NotifyEvent.md +++ b/docs/framework/svelte/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1519) +Defined in: [packages/query-core/src/types.ts:1539](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1539) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1520) +Defined in: [packages/query-core/src/types.ts:1540](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1540) diff --git a/docs/framework/svelte/reference/interfaces/QueryClientConfig.md b/docs/framework/svelte/reference/interfaces/QueryClientConfig.md index 411eb0b2fb2..070e249491f 100644 --- a/docs/framework/svelte/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/svelte/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) +Defined in: [packages/query-core/src/types.ts:1495](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1495) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/ optional defaultOptions: DefaultOptions; ``` -Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) +Defined in: [packages/query-core/src/types.ts:1504](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1504) Default options for all queries and mutations created through this client. @@ -25,7 +25,7 @@ Default options for all queries and mutations created through this client. optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1482) +Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) The mutation cache this client is connected to. A new `MutationCache` is created if not provided. @@ -38,6 +38,6 @@ provided. optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) +Defined in: [packages/query-core/src/types.ts:1497](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1497) The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/svelte/reference/interfaces/QueryExecuteOptions.md b/docs/framework/svelte/reference/interfaces/QueryExecuteOptions.md index 1e844c5ba10..23d272eb25f 100644 --- a/docs/framework/svelte/reference/interfaces/QueryExecuteOptions.md +++ b/docs/framework/svelte/reference/interfaces/QueryExecuteOptions.md @@ -3,7 +3,7 @@ id: QueryExecuteOptions title: QueryExecuteOptions --- -Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) +Defined in: [packages/query-core/src/types.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L574) ## Extends @@ -43,12 +43,13 @@ Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -70,7 +71,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -93,7 +94,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -111,7 +112,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L577) +Defined in: [packages/query-core/src/types.ts:585](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L585) *** @@ -121,7 +122,7 @@ Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -139,7 +140,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -158,7 +159,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -180,7 +183,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -201,7 +204,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -223,7 +226,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -242,7 +245,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -265,7 +268,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -306,7 +309,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -316,6 +319,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -330,7 +335,7 @@ WithRequired.retryDelay optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L578) +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) #### Parameters @@ -350,7 +355,7 @@ Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:583](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L583) +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -363,7 +368,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverBaseResult.md index 1b54d6f8041..ef5fe0ad757 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:764](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L764) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:771](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L771) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) +Defined in: [packages/query-core/src/types.ts:804](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L804) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) +Defined in: [packages/query-core/src/types.ts:827](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L827) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) +Defined in: [packages/query-core/src/types.ts:845](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L845) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) +Defined in: [packages/query-core/src/types.ts:849](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L849) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult.md index 7a4f855305f..21b39fbffe3 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) +Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverLoadingResult.md index 8f94574bcca..4966390127f 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) +Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverOptions.md b/docs/framework/svelte/reference/interfaces/QueryObserverOptions.md index 7c4c5f495bb..02c4f7e05f8 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverOptions.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverOptions.md @@ -3,7 +3,7 @@ id: QueryObserverOptions title: QueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L375) +Defined in: [packages/query-core/src/types.ts:380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L380) ## Extends @@ -47,7 +47,7 @@ Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/q optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -63,12 +63,13 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -90,7 +91,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -113,7 +114,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -131,7 +132,7 @@ WithRequired.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -149,7 +150,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -168,7 +169,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -190,13 +193,15 @@ WithRequired.networkMode optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. *** @@ -206,7 +211,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -227,7 +232,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -241,7 +246,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -263,7 +268,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -282,7 +287,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -305,7 +310,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -323,7 +328,7 @@ WithRequired.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -338,9 +343,10 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. *** @@ -351,7 +357,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -368,7 +374,7 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -385,7 +391,7 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -425,7 +431,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -435,6 +441,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -449,7 +457,7 @@ WithRequired.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -464,7 +472,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -489,7 +497,7 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -506,7 +514,7 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -527,7 +535,7 @@ WithRequired.structuralSharing optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -542,7 +550,7 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverPendingResult.md index 41a101c7c8c..8f00c426b64 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:887](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L887) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L888) +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) +Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverPlaceholderResult.md index cce7cffcc9b..bbf3da387f9 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) +Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) +Defined in: [packages/query-core/src/types.ts:975](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L975) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) +Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) +Defined in: [packages/query-core/src/types.ts:976](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L976) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:969](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L969) +Defined in: [packages/query-core/src/types.ts:979](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L979) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L970) +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) +Defined in: [packages/query-core/src/types.ts:978](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L978) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) +Defined in: [packages/query-core/src/types.ts:983](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L983) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) +Defined in: [packages/query-core/src/types.ts:981](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L981) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:972](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L972) +Defined in: [packages/query-core/src/types.ts:982](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L982) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult.md index 8486e8cf4cb..345ecab35e1 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) +Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/svelte/reference/interfaces/QueryObserverSuccessResult.md index f126bea0f70..3942655c627 100644 --- a/docs/framework/svelte/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/svelte/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) +Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) +Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) +Defined in: [packages/query-core/src/types.ts:964](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L964) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) +Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) +Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) +Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) The status of the query. - Will be: diff --git a/docs/framework/svelte/reference/interfaces/QueryOptions.md b/docs/framework/svelte/reference/interfaces/QueryOptions.md index bb82dd0f56a..7e059d3a1d6 100644 --- a/docs/framework/svelte/reference/interfaces/QueryOptions.md +++ b/docs/framework/svelte/reference/interfaces/QueryOptions.md @@ -35,12 +35,13 @@ Defined in: [packages/query-core/src/types.ts:231](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -56,7 +57,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -73,7 +74,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -85,7 +86,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -97,7 +98,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -110,7 +111,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -126,7 +129,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -141,7 +144,7 @@ optional queryFn: | typeof skipToken; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -157,7 +160,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -170,7 +173,7 @@ as the actual cache key internally. optional queryKey: TQueryKey; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -187,7 +190,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -216,7 +219,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -226,6 +229,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + *** ### structuralSharing? @@ -234,7 +239,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/svelte/reference/interfaces/RefetchOptions.md b/docs/framework/svelte/reference/interfaces/RefetchOptions.md index 104412c5bac..cfcc0498799 100644 --- a/docs/framework/svelte/reference/interfaces/RefetchOptions.md +++ b/docs/framework/svelte/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) +Defined in: [packages/query-core/src/types.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L704) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,9 +38,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/svelte/reference/interfaces/RefetchQueryFilters.md b/docs/framework/svelte/reference/interfaces/RefetchQueryFilters.md index bde28360fa1..c45dfa953f1 100644 --- a/docs/framework/svelte/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/svelte/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:720](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L720) +Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) Filters used to select queries, for example in `queryClient.getQueriesData` or `queryClient.invalidateQueries`. All provided filters must match; filters that are left unspecified are ignored. diff --git a/docs/framework/svelte/reference/interfaces/ResetOptions.md b/docs/framework/svelte/reference/interfaces/ResetOptions.md index 6d3a8398fbb..9f12324ba27 100644 --- a/docs/framework/svelte/reference/interfaces/ResetOptions.md +++ b/docs/framework/svelte/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) +Defined in: [packages/query-core/src/types.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L735) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,9 +37,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/svelte/reference/interfaces/ResultOptions.md b/docs/framework/svelte/reference/interfaces/ResultOptions.md index f3da151a3ec..42917f20bf0 100644 --- a/docs/framework/svelte/reference/interfaces/ResultOptions.md +++ b/docs/framework/svelte/reference/interfaces/ResultOptions.md @@ -3,7 +3,7 @@ id: ResultOptions title: ResultOptions --- -Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L686) +Defined in: [packages/query-core/src/types.ts:694](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L694) ## Extended by @@ -19,8 +19,9 @@ Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/svelte/reference/interfaces/SetDataOptions.md b/docs/framework/svelte/reference/interfaces/SetDataOptions.md index cac83e9312a..bb668fbf162 100644 --- a/docs/framework/svelte/reference/interfaces/SetDataOptions.md +++ b/docs/framework/svelte/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1506) +Defined in: [packages/query-core/src/types.ts:1526](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1526) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) +Defined in: [packages/query-core/src/types.ts:1527](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1527) diff --git a/docs/framework/svelte/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/svelte/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md index 4412ad00c8e..82c7ddbb886 100644 --- a/docs/framework/svelte/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md +++ b/docs/framework/svelte/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedInfiniteQueryObserverOptions type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:549](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L549) +Defined in: [packages/query-core/src/types.ts:557](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L557) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/svelte/reference/type-aliases/DefaultedQueryObserverOptions.md index 9ce8401b128..7687d8c24f6 100644 --- a/docs/framework/svelte/reference/type-aliases/DefaultedQueryObserverOptions.md +++ b/docs/framework/svelte/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedQueryObserverOptions type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) +Defined in: [packages/query-core/src/types.ts:528](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L528) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index cec33b142b7..38dac7cfe2b 100644 --- a/docs/framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/svelte/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) +Defined in: [packages/query-core/src/types.ts:1148](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1148) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/svelte/reference/type-aliases/DefinedQueryObserverResult.md index b4480af3810..ae77ddcc22d 100644 --- a/docs/framework/svelte/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/svelte/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/svelte/reference/type-aliases/EnsureInfiniteQueryDataOptions.md index ff75b1c3449..7648331fca2 100644 --- a/docs/framework/svelte/reference/type-aliases/EnsureInfiniteQueryDataOptions.md +++ b/docs/framework/svelte/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -7,7 +7,7 @@ title: EnsureInfiniteQueryDataOptions type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; ``` -Defined in: [packages/query-core/src/types.ts:623](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L623) +Defined in: [packages/query-core/src/types.ts:631](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L631) ## Type Declaration diff --git a/docs/framework/svelte/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/svelte/reference/type-aliases/FetchInfiniteQueryOptions.md index c926bbd3ae5..d00a2455889 100644 --- a/docs/framework/svelte/reference/type-aliases/FetchInfiniteQueryOptions.md +++ b/docs/framework/svelte/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: FetchInfiniteQueryOptions type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:667](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L667) +Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/FetchStatus.md b/docs/framework/svelte/reference/type-aliases/FetchStatus.md index b347069e97e..d50002355ca 100644 --- a/docs/framework/svelte/reference/type-aliases/FetchStatus.md +++ b/docs/framework/svelte/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:752](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L752) +Defined in: [packages/query-core/src/types.ts:762](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L762) diff --git a/docs/framework/svelte/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/svelte/reference/type-aliases/InfiniteQueryExecuteOptions.md index c198662a319..259c97c96bb 100644 --- a/docs/framework/svelte/reference/type-aliases/InfiniteQueryExecuteOptions.md +++ b/docs/framework/svelte/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -7,7 +7,7 @@ title: InfiniteQueryExecuteOptions type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:646](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L646) +Defined in: [packages/query-core/src/types.ts:654](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L654) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/svelte/reference/type-aliases/InfiniteQueryObserverResult.md index 42279b19c00..aa27563b9cd 100644 --- a/docs/framework/svelte/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/svelte/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/MutateFunction.md b/docs/framework/svelte/reference/type-aliases/MutateFunction.md index 558040d3439..e12b7a80291 100644 --- a/docs/framework/svelte/reference/type-aliases/MutateFunction.md +++ b/docs/framework/svelte/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1306](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1306) +Defined in: [packages/query-core/src/types.ts:1326](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1326) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/MutateFunctionRest.md b/docs/framework/svelte/reference/type-aliases/MutateFunctionRest.md index 3e7a5217482..3902f1082f9 100644 --- a/docs/framework/svelte/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/svelte/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1291](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1291) +Defined in: [packages/query-core/src/types.ts:1311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1311) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/MutationFunction.md b/docs/framework/svelte/reference/type-aliases/MutationFunction.md index 330af1ef65a..9bafb3db56b 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationFunction.md +++ b/docs/framework/svelte/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1195](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1195) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/MutationFunctionContext.md b/docs/framework/svelte/reference/type-aliases/MutationFunctionContext.md index 97de2f1c220..0207256c702 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/svelte/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) +Defined in: [packages/query-core/src/types.ts:1189](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1189) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1180) +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1182](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1182) +Defined in: [packages/query-core/src/types.ts:1192](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1192) diff --git a/docs/framework/svelte/reference/type-aliases/MutationKey.md b/docs/framework/svelte/reference/type-aliases/MutationKey.md index 8e9d3bc3b3a..9d1d7f0f77b 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationKey.md +++ b/docs/framework/svelte/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) +Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) diff --git a/docs/framework/svelte/reference/type-aliases/MutationMeta.md b/docs/framework/svelte/reference/type-aliases/MutationMeta.md index 474c593e206..ff1f9b4bf94 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationMeta.md +++ b/docs/framework/svelte/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) +Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) diff --git a/docs/framework/svelte/reference/type-aliases/MutationObserverResult.md b/docs/framework/svelte/reference/type-aliases/MutationObserverResult.md index 21e43836bf6..c21fc3ac591 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/svelte/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1464](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1464) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/MutationScope.md b/docs/framework/svelte/reference/type-aliases/MutationScope.md index feac9d9d17a..1d6a91bd434 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationScope.md +++ b/docs/framework/svelte/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1167) +Defined in: [packages/query-core/src/types.ts:1177](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1177) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) diff --git a/docs/framework/svelte/reference/type-aliases/MutationStatus.md b/docs/framework/svelte/reference/type-aliases/MutationStatus.md index 4cd2d3c9535..cf12d3d3ee3 100644 --- a/docs/framework/svelte/reference/type-aliases/MutationStatus.md +++ b/docs/framework/svelte/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) +Defined in: [packages/query-core/src/types.ts:1175](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1175) diff --git a/docs/framework/svelte/reference/type-aliases/NotifyEventType.md b/docs/framework/svelte/reference/type-aliases/NotifyEventType.md index 9bbc85e4ce8..ffa60b016e3 100644 --- a/docs/framework/svelte/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/svelte/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1510](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1510) +Defined in: [packages/query-core/src/types.ts:1530](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1530) diff --git a/docs/framework/svelte/reference/type-aliases/QueryObserverResult.md b/docs/framework/svelte/reference/type-aliases/QueryObserverResult.md index 4fc661a6c9d..5138b635f2c 100644 --- a/docs/framework/svelte/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/svelte/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/QueryStatus.md b/docs/framework/svelte/reference/type-aliases/QueryStatus.md index 6679b8b17c6..bab00f6f423 100644 --- a/docs/framework/svelte/reference/type-aliases/QueryStatus.md +++ b/docs/framework/svelte/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:751](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L751) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) diff --git a/docs/framework/svelte/reference/type-aliases/ThrowOnError.md b/docs/framework/svelte/reference/type-aliases/ThrowOnError.md index 613549e4d52..134683388ef 100644 --- a/docs/framework/svelte/reference/type-aliases/ThrowOnError.md +++ b/docs/framework/svelte/reference/type-aliases/ThrowOnError.md @@ -7,7 +7,7 @@ title: ThrowOnError type ThrowOnError = boolean | (error, query) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L363) +Defined in: [packages/query-core/src/types.ts:368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L368) ## Type Parameters diff --git a/docs/framework/svelte/reference/type-aliases/WithRequired.md b/docs/framework/svelte/reference/type-aliases/WithRequired.md index deb87dfe4a4..a40a48c865b 100644 --- a/docs/framework/svelte/reference/type-aliases/WithRequired.md +++ b/docs/framework/svelte/reference/type-aliases/WithRequired.md @@ -7,7 +7,7 @@ title: WithRequired type WithRequired = TTarget & { [_ in TKey]: {} }; ``` -Defined in: [packages/query-core/src/types.ts:516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L516) +Defined in: [packages/query-core/src/types.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L524) ## Type Parameters diff --git a/docs/framework/vue/reference/interfaces/CancelOptions.md b/docs/framework/vue/reference/interfaces/CancelOptions.md index f52c729f3b1..b7464c48e50 100644 --- a/docs/framework/vue/reference/interfaces/CancelOptions.md +++ b/docs/framework/vue/reference/interfaces/CancelOptions.md @@ -3,7 +3,7 @@ id: CancelOptions title: CancelOptions --- -Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1501) +Defined in: [packages/query-core/src/types.ts:1521](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1521) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1501](https://github.com/TanStack/ optional revert: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) +Defined in: [packages/query-core/src/types.ts:1522](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1522) *** @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/ optional silent: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1503) +Defined in: [packages/query-core/src/types.ts:1523](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1523) diff --git a/docs/framework/vue/reference/interfaces/DefaultOptions.md b/docs/framework/vue/reference/interfaces/DefaultOptions.md index 67ae012f9ee..e45a56f075f 100644 --- a/docs/framework/vue/reference/interfaces/DefaultOptions.md +++ b/docs/framework/vue/reference/interfaces/DefaultOptions.md @@ -3,7 +3,7 @@ id: DefaultOptions title: DefaultOptions --- -Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1487) +Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) ## Type Parameters @@ -19,7 +19,7 @@ Defined in: [packages/query-core/src/types.ts:1487](https://github.com/TanStack/ optional dehydrate: DehydrateOptions; ``` -Defined in: [packages/query-core/src/types.ts:1498](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1498) +Defined in: [packages/query-core/src/types.ts:1518](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1518) Default options used when dehydrating the client's caches; see [DehydrateOptions](DehydrateOptions.md). @@ -31,7 +31,7 @@ Default options used when dehydrating the client's caches; see [DehydrateOptions optional hydrate: object; ``` -Defined in: [packages/query-core/src/types.ts:1496](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1496) +Defined in: [packages/query-core/src/types.ts:1516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1516) Default options used when hydrating queries; see [HydrateOptions](HydrateOptions.md). @@ -67,7 +67,7 @@ Default options merged into every query restored from the dehydrated state. optional mutations: MutationObserverOptions; ``` -Defined in: [packages/query-core/src/types.ts:1494](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1494) +Defined in: [packages/query-core/src/types.ts:1514](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1514) Default options applied to every mutation, unless overridden per-mutation. @@ -79,6 +79,6 @@ Default options applied to every mutation, unless overridden per-mutation. optional queries: OmitKeyof, "queryKey" | "suspense", "strictly">; ``` -Defined in: [packages/query-core/src/types.ts:1489](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1489) +Defined in: [packages/query-core/src/types.ts:1509](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1509) Default options applied to every query, unless overridden per-query. diff --git a/docs/framework/vue/reference/interfaces/EnsureQueryDataOptions.md b/docs/framework/vue/reference/interfaces/EnsureQueryDataOptions.md index d71a60902e6..a67082af57e 100644 --- a/docs/framework/vue/reference/interfaces/EnsureQueryDataOptions.md +++ b/docs/framework/vue/reference/interfaces/EnsureQueryDataOptions.md @@ -3,7 +3,7 @@ id: EnsureQueryDataOptions title: EnsureQueryDataOptions --- -Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L606) +Defined in: [packages/query-core/src/types.ts:614](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L614) ## Deprecated @@ -41,12 +41,13 @@ Defined in: [packages/query-core/src/types.ts:606](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -66,7 +67,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -87,7 +88,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -103,7 +104,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) +Defined in: [packages/query-core/src/types.ts:605](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L605) #### Inherited from @@ -117,7 +118,7 @@ Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -133,7 +134,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -150,7 +151,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -170,7 +173,7 @@ Defaults to `'online'`. optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -189,7 +192,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -209,7 +212,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -226,7 +229,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -247,7 +250,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -284,7 +287,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -294,6 +297,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`FetchQueryOptions`](FetchQueryOptions.md).[`retryDelay`](FetchQueryOptions.md#retrydelay) @@ -306,7 +311,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional revalidateIfStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L619) +Defined in: [packages/query-core/src/types.ts:627](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L627) *** @@ -316,7 +321,7 @@ Defined in: [packages/query-core/src/types.ts:619](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) +Defined in: [packages/query-core/src/types.ts:610](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L610) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -333,7 +338,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/vue/reference/interfaces/FetchNextPageOptions.md b/docs/framework/vue/reference/interfaces/FetchNextPageOptions.md index 2c0be977140..b79cdbe19b3 100644 --- a/docs/framework/vue/reference/interfaces/FetchNextPageOptions.md +++ b/docs/framework/vue/reference/interfaces/FetchNextPageOptions.md @@ -3,7 +3,7 @@ id: FetchNextPageOptions title: FetchNextPageOptions --- -Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) +Defined in: [packages/query-core/src/types.ts:737](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L737) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:736](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L736) +Defined in: [packages/query-core/src/types.ts:746](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L746) If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,9 +34,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/vue/reference/interfaces/FetchPreviousPageOptions.md b/docs/framework/vue/reference/interfaces/FetchPreviousPageOptions.md index 683e789ee52..fd5a08767b6 100644 --- a/docs/framework/vue/reference/interfaces/FetchPreviousPageOptions.md +++ b/docs/framework/vue/reference/interfaces/FetchPreviousPageOptions.md @@ -3,7 +3,7 @@ id: FetchPreviousPageOptions title: FetchPreviousPageOptions --- -Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L739) +Defined in: [packages/query-core/src/types.ts:749](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L749) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:739](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:748](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L748) +Defined in: [packages/query-core/src/types.ts:758](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L758) If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. @@ -34,9 +34,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/vue/reference/interfaces/FetchQueryOptions.md b/docs/framework/vue/reference/interfaces/FetchQueryOptions.md index 0820a2a87b7..1b8582adba7 100644 --- a/docs/framework/vue/reference/interfaces/FetchQueryOptions.md +++ b/docs/framework/vue/reference/interfaces/FetchQueryOptions.md @@ -3,7 +3,7 @@ id: FetchQueryOptions title: FetchQueryOptions --- -Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L587) +Defined in: [packages/query-core/src/types.ts:595](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L595) ## Deprecated @@ -45,12 +45,13 @@ Defined in: [packages/query-core/src/types.ts:587](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -72,7 +73,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -95,7 +96,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -113,7 +114,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L597) +Defined in: [packages/query-core/src/types.ts:605](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L605) *** @@ -123,7 +124,7 @@ Defined in: [packages/query-core/src/types.ts:597](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -141,7 +142,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -160,7 +161,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -182,7 +185,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -203,7 +206,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -225,7 +228,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -244,7 +247,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -267,7 +270,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -308,7 +311,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -318,6 +321,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -332,7 +337,7 @@ WithRequired.retryDelay optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:602](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L602) +Defined in: [packages/query-core/src/types.ts:610](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L610) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -345,7 +350,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult.md index 9195e0727f8..0aa01962aa5 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverBaseResult title: InfiniteQueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L991) +Defined in: [packages/query-core/src/types.ts:1001](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1001) ## Extends @@ -36,7 +36,7 @@ Defined in: [packages/query-core/src/types.ts:991](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:771](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L771) The last successfully resolved data for the query. @@ -52,7 +52,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -68,7 +68,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -85,7 +85,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -101,7 +101,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -117,7 +117,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -135,7 +135,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -152,7 +152,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -174,7 +174,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -196,7 +196,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -216,7 +216,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -228,7 +228,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -240,7 +240,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -256,7 +256,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) +Defined in: [packages/query-core/src/types.ts:804](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L804) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -273,7 +273,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -289,7 +289,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -306,7 +306,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -323,7 +323,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -335,7 +335,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -347,7 +347,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) Will be `true` if the query failed while fetching the next page. @@ -359,7 +359,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) Will be `true` if the query failed while fetching the previous page. @@ -371,7 +371,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -390,7 +390,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -407,7 +407,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) Will be `true` if the query failed while fetching for the first time. @@ -423,7 +423,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -440,7 +440,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) +Defined in: [packages/query-core/src/types.ts:827](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L827) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -456,7 +456,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) +Defined in: [packages/query-core/src/types.ts:845](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L845) Will be `true` if the data shown is the placeholder data. @@ -472,7 +472,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) +Defined in: [packages/query-core/src/types.ts:849](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L849) Will be `true` if the query failed while refetching. @@ -488,7 +488,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -505,7 +505,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -521,7 +521,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -538,7 +538,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -564,7 +564,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md index 2841b5ab116..f5e3352f27c 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingErrorResult title: InfiniteQueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) +Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) +Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) +Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) +Defined in: [packages/query-core/src/types.ts:1084](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1084) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1079](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1079) +Defined in: [packages/query-core/src/types.ts:1089](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1089) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1080](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1080) +Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1076](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1076) +Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:1077](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1077) +Defined in: [packages/query-core/src/types.ts:1087](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1087) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) +Defined in: [packages/query-core/src/types.ts:1085](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1085) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1082](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1082) +Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1078](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1078) +Defined in: [packages/query-core/src/types.ts:1088](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1088) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1081](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1081) +Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1083](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1083) +Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult.md index 95ff84b3ef3..b7aa67744c0 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverLoadingResult title: InfiniteQueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) +Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) +Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) +Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) +Defined in: [packages/query-core/src/types.ts:1066](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1066) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1061](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1061) +Defined in: [packages/query-core/src/types.ts:1071](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1071) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1062](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1062) +Defined in: [packages/query-core/src/types.ts:1072](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1072) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1058) +Defined in: [packages/query-core/src/types.ts:1068](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1068) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1059](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1059) +Defined in: [packages/query-core/src/types.ts:1069](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1069) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) +Defined in: [packages/query-core/src/types.ts:1067](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1067) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1064](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1064) +Defined in: [packages/query-core/src/types.ts:1074](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1074) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1060](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1060) +Defined in: [packages/query-core/src/types.ts:1070](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1070) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1063](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1063) +Defined in: [packages/query-core/src/types.ts:1073](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1073) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1065](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1065) +Defined in: [packages/query-core/src/types.ts:1075](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1075) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverOptions.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverOptions.md index 7d5b0dd1a4d..7670bd8e24b 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverOptions.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverOptions title: InfiniteQueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L531) +Defined in: [packages/query-core/src/types.ts:539](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L539) ## Extends @@ -39,7 +39,7 @@ Defined in: [packages/query-core/src/types.ts:531](https://github.com/TanStack/q optional enabled: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -59,12 +59,13 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -82,7 +83,7 @@ Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bi getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -99,7 +100,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -118,7 +119,7 @@ optional initialData: | InitialDataFunction>; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -139,7 +140,7 @@ Initial data is considered stale by default unless a `staleTime` has been set. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -155,7 +156,7 @@ If set, this value will be used as the time (in milliseconds) of when the `initi initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from @@ -169,7 +170,7 @@ Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -185,7 +186,7 @@ Maximum number of pages to store in the data of an infinite query. optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -202,7 +203,9 @@ Use this property to pass information that can be used in other places. optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -222,13 +225,15 @@ Defaults to `'online'`. optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. #### Inherited from @@ -242,7 +247,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -261,7 +266,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, InfiniteData, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -279,7 +284,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -299,7 +304,7 @@ Must return a promise that will either resolve data or throw an error. The data optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -316,7 +321,7 @@ as the actual cache key internally. queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -337,7 +342,7 @@ The query will automatically update when this key changes (as long as `enabled` optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -353,7 +358,7 @@ If specified, this function is used to hash the `queryKey` to a string. optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -372,9 +377,10 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. #### Inherited from @@ -389,7 +395,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -410,7 +416,7 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -431,7 +437,7 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -473,7 +479,7 @@ Defaults to `3` on the client and `0` on the server. optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -483,6 +489,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from [`QueryObserverOptions`](QueryObserverOptions.md).[`retryDelay`](QueryObserverOptions.md#retrydelay) @@ -495,7 +503,7 @@ A function like `attempt => attempt * 1000` applies linear backoff. optional retryOnMount: QueryBooleanOption, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -514,7 +522,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -543,7 +551,7 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -564,7 +572,7 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -583,7 +591,7 @@ Defaults to `true`. optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -602,7 +610,7 @@ Defaults to `false`. optional throwOnError: ThrowOnError, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult.md index c3e8b022cdb..a09301ab6c4 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPendingResult title: InfiniteQueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1033) +Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1033](https://github.com/TanStack/ data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1037](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1037) +Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1038](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1038) +Defined in: [packages/query-core/src/types.ts:1048](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1048) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1039](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1039) +Defined in: [packages/query-core/src/types.ts:1049](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1049) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1043](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1043) +Defined in: [packages/query-core/src/types.ts:1053](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1053) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1044](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1044) +Defined in: [packages/query-core/src/types.ts:1054](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1054) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1041](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1041) +Defined in: [packages/query-core/src/types.ts:1051](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1051) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) +Defined in: [packages/query-core/src/types.ts:1050](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1050) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1046](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1046) +Defined in: [packages/query-core/src/types.ts:1056](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1056) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1042](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1042) +Defined in: [packages/query-core/src/types.ts:1052](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1052) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1045](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1045) +Defined in: [packages/query-core/src/types.ts:1055](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1055) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1047](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1047) +Defined in: [packages/query-core/src/types.ts:1057](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1057) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md index e62579744ba..58193a987d1 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverPlaceholderResult title: InfiniteQueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) +Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) +Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) +Defined in: [packages/query-core/src/types.ts:1136](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1136) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) +Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1133](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1133) +Defined in: [packages/query-core/src/types.ts:1143](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1143) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1134](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1134) +Defined in: [packages/query-core/src/types.ts:1144](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1144) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1128](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1128) +Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1129](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1129) +Defined in: [packages/query-core/src/types.ts:1139](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1139) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) +Defined in: [packages/query-core/src/types.ts:1137](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1137) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:1132](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1132) +Defined in: [packages/query-core/src/types.ts:1142](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1142) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1130](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1130) +Defined in: [packages/query-core/src/types.ts:1140](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1140) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1131](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1131) +Defined in: [packages/query-core/src/types.ts:1141](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1141) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1135](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1135) +Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md index a67e877f083..4ce469bceed 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverRefetchErrorResult title: InfiniteQueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1086) +Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1086](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1090](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1090) +Defined in: [packages/query-core/src/types.ts:1100](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1100) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1091](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1091) +Defined in: [packages/query-core/src/types.ts:1101](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1101) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1092](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1092) +Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1018](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1018) +Defined in: [packages/query-core/src/types.ts:1028](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1028) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1026](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1026) +Defined in: [packages/query-core/src/types.ts:1036](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1036) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1094](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1094) +Defined in: [packages/query-core/src/types.ts:1104](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1104) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1095](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1095) +Defined in: [packages/query-core/src/types.ts:1105](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1105) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1093](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1093) +Defined in: [packages/query-core/src/types.ts:1103](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1103) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1098](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1098) +Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:1096](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1096) +Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1097](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1097) +Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1099](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1099) +Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult.md b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult.md index 0b875662cbc..131f6d01ae7 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: InfiniteQueryObserverSuccessResult title: InfiniteQueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1102) +Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1102](https://github.com/TanStack/ data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1106](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1106) +Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:1107](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1107) +Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchNextPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:998](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L998) +Defined in: [packages/query-core/src/types.ts:1008](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1008) This function allows you to fetch the next "page" of results. @@ -169,7 +169,7 @@ This function allows you to fetch the next "page" of results. fetchPreviousPage: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:1004](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1004) +Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) This function allows you to fetch the previous "page" of results. @@ -195,7 +195,7 @@ This function allows you to fetch the previous "page" of results. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -215,7 +215,7 @@ The fetch status of the query. hasNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1010](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1010) +Defined in: [packages/query-core/src/types.ts:1020](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1020) Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). @@ -231,7 +231,7 @@ Will be `true` if there is a next page to be fetched (known via the `getNextPage hasPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1014](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1014) +Defined in: [packages/query-core/src/types.ts:1024](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1024) Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). @@ -247,7 +247,7 @@ Will be `true` if there is a previous page to be fetched (known via the `getPrev isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -263,7 +263,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1108](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1108) +Defined in: [packages/query-core/src/types.ts:1118](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1118) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -280,7 +280,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -296,7 +296,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -313,7 +313,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -330,7 +330,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isFetchingNextPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1022](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1022) +Defined in: [packages/query-core/src/types.ts:1032](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1032) Will be `true` while fetching the next page with `fetchNextPage`. @@ -346,7 +346,7 @@ Will be `true` while fetching the next page with `fetchNextPage`. isFetchingPreviousPage: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1030) +Defined in: [packages/query-core/src/types.ts:1040](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1040) Will be `true` while fetching the previous page with `fetchPreviousPage`. @@ -362,7 +362,7 @@ Will be `true` while fetching the previous page with `fetchPreviousPage`. isFetchNextPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1113](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1113) +Defined in: [packages/query-core/src/types.ts:1123](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1123) Will be `true` if the query failed while fetching the next page. @@ -378,7 +378,7 @@ Will be `true` if the query failed while fetching the next page. isFetchPreviousPageError: false; ``` -Defined in: [packages/query-core/src/types.ts:1114](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1114) +Defined in: [packages/query-core/src/types.ts:1124](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1124) Will be `true` if the query failed while fetching the previous page. @@ -394,7 +394,7 @@ Will be `true` if the query failed while fetching the previous page. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -413,7 +413,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:1110](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1110) +Defined in: [packages/query-core/src/types.ts:1120](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1120) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -430,7 +430,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:1111](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1111) +Defined in: [packages/query-core/src/types.ts:1121](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1121) Will be `true` if the query failed while fetching for the first time. @@ -446,7 +446,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -463,7 +463,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1109](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1109) +Defined in: [packages/query-core/src/types.ts:1119](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1119) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -479,7 +479,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:1116](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1116) +Defined in: [packages/query-core/src/types.ts:1126](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1126) Will be `true` if the data shown is the placeholder data. @@ -495,7 +495,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:1112](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1112) +Defined in: [packages/query-core/src/types.ts:1122](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1122) Will be `true` if the query failed while refetching. @@ -511,7 +511,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -528,7 +528,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -544,7 +544,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1115](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1115) +Defined in: [packages/query-core/src/types.ts:1125](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1125) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -561,7 +561,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -587,7 +587,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1117](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1117) +Defined in: [packages/query-core/src/types.ts:1127](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1127) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/InfiniteQueryPageParamsOptions.md b/docs/framework/vue/reference/interfaces/InfiniteQueryPageParamsOptions.md index afe27785edc..c091cc15456 100644 --- a/docs/framework/vue/reference/interfaces/InfiniteQueryPageParamsOptions.md +++ b/docs/framework/vue/reference/interfaces/InfiniteQueryPageParamsOptions.md @@ -3,7 +3,7 @@ id: InfiniteQueryPageParamsOptions title: InfiniteQueryPageParamsOptions --- -Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L347) +Defined in: [packages/query-core/src/types.ts:352](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L352) ## Extends @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:347](https://github.com/TanStack/q getNextPageParam: GetNextPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) +Defined in: [packages/query-core/src/types.ts:365](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L365) This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. @@ -44,7 +44,7 @@ The result will also be used to determine the value of `hasNextPage`. optional getPreviousPageParam: GetPreviousPageParamFunction; ``` -Defined in: [packages/query-core/src/types.ts:355](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L355) +Defined in: [packages/query-core/src/types.ts:360](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L360) This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. @@ -57,7 +57,7 @@ The result will also be used to determine the value of `hasPreviousPage`. initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) #### Inherited from diff --git a/docs/framework/vue/reference/interfaces/InitialPageParam.md b/docs/framework/vue/reference/interfaces/InitialPageParam.md index 2d42bf029a4..46d2b219ea4 100644 --- a/docs/framework/vue/reference/interfaces/InitialPageParam.md +++ b/docs/framework/vue/reference/interfaces/InitialPageParam.md @@ -3,7 +3,7 @@ id: InitialPageParam title: InitialPageParam --- -Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L343) +Defined in: [packages/query-core/src/types.ts:348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L348) ## Extended by @@ -23,4 +23,4 @@ Defined in: [packages/query-core/src/types.ts:343](https://github.com/TanStack/q initialPageParam: TPageParam; ``` -Defined in: [packages/query-core/src/types.ts:344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L344) +Defined in: [packages/query-core/src/types.ts:349](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L349) diff --git a/docs/framework/vue/reference/interfaces/InvalidateOptions.md b/docs/framework/vue/reference/interfaces/InvalidateOptions.md index d83ecd43ec0..8a81428b035 100644 --- a/docs/framework/vue/reference/interfaces/InvalidateOptions.md +++ b/docs/framework/vue/reference/interfaces/InvalidateOptions.md @@ -3,7 +3,7 @@ id: InvalidateOptions title: InvalidateOptions --- -Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L724) +Defined in: [packages/query-core/src/types.ts:734](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L734) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:724](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,9 +37,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/vue/reference/interfaces/InvalidateQueryFilters.md b/docs/framework/vue/reference/interfaces/InvalidateQueryFilters.md index 81461ccb716..14461260d18 100644 --- a/docs/framework/vue/reference/interfaces/InvalidateQueryFilters.md +++ b/docs/framework/vue/reference/interfaces/InvalidateQueryFilters.md @@ -3,7 +3,7 @@ id: InvalidateQueryFilters title: InvalidateQueryFilters --- -Defined in: [packages/query-core/src/types.ts:706](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L706) +Defined in: [packages/query-core/src/types.ts:715](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L715) ## Extends @@ -105,9 +105,10 @@ QueryFilters.queryKey optional refetchType: QueryTypeFilter | "none"; ``` -Defined in: [packages/query-core/src/types.ts:717](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L717) +Defined in: [packages/query-core/src/types.ts:727](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L727) Controls which of the matched (now-invalidated) queries are refetched in the background. + Defaults to `'active'`. - `'active'`: only queries with at least one active observer are refetched. - `'inactive'`: only queries with no active observer are refetched. diff --git a/docs/framework/vue/reference/interfaces/MutateOptions.md b/docs/framework/vue/reference/interfaces/MutateOptions.md index b12b3b29ec2..34e2a4d4d7e 100644 --- a/docs/framework/vue/reference/interfaces/MutateOptions.md +++ b/docs/framework/vue/reference/interfaces/MutateOptions.md @@ -3,7 +3,7 @@ id: MutateOptions title: MutateOptions --- -Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) +Defined in: [packages/query-core/src/types.ts:1284](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1284) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/ optional onError: (error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1276) +Defined in: [packages/query-core/src/types.ts:1296](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1296) #### Parameters @@ -63,7 +63,7 @@ Defined in: [packages/query-core/src/types.ts:1276](https://github.com/TanStack/ optional onSettled: (data, error, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1282) +Defined in: [packages/query-core/src/types.ts:1302](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1302) #### Parameters @@ -99,7 +99,7 @@ Defined in: [packages/query-core/src/types.ts:1282](https://github.com/TanStack/ optional onSuccess: (data, variables, onMutateResult, context) => void; ``` -Defined in: [packages/query-core/src/types.ts:1270](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1270) +Defined in: [packages/query-core/src/types.ts:1290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1290) #### Parameters diff --git a/docs/framework/vue/reference/interfaces/MutationObserverBaseResult.md b/docs/framework/vue/reference/interfaces/MutationObserverBaseResult.md index e1c09a56737..340a38cc9cc 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverBaseResult.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverBaseResult.md @@ -3,7 +3,7 @@ id: MutationObserverBaseResult title: MutationObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:1315](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1315) +Defined in: [packages/query-core/src/types.ts:1335](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1335) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -62,7 +62,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1324](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1324) +Defined in: [packages/query-core/src/types.ts:1344](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1344) The last successfully resolved data for the mutation. @@ -78,7 +78,7 @@ The last successfully resolved data for the mutation. error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:1333](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1333) +Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -127,7 +127,7 @@ The reason the current attempt failed, as reported by the retryer. isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1338](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1338) +Defined in: [packages/query-core/src/types.ts:1358](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1358) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -140,7 +140,7 @@ A boolean variable derived from `status`. isIdle: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1343](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1343) +Defined in: [packages/query-core/src/types.ts:1363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1363) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -170,7 +170,7 @@ waiting for another mutation with the same `scope` to finish. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) +Defined in: [packages/query-core/src/types.ts:1368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1368) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -183,7 +183,7 @@ A boolean variable derived from `status`. isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:1353](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1353) +Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -196,7 +196,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -229,7 +229,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -245,7 +245,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: MutationStatus; ``` -Defined in: [packages/query-core/src/types.ts:1362](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1362) +Defined in: [packages/query-core/src/types.ts:1382](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1382) The status of the mutation. - Will be: @@ -282,7 +282,7 @@ The timestamp for when the mutation was submitted. variables: TVariables | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1328](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1328) +Defined in: [packages/query-core/src/types.ts:1348](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1348) The variables object passed to the `mutationFn`. diff --git a/docs/framework/vue/reference/interfaces/MutationObserverErrorResult.md b/docs/framework/vue/reference/interfaces/MutationObserverErrorResult.md index cce591e3465..72e459a2e0b 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverErrorResult.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverErrorResult.md @@ -3,7 +3,7 @@ id: MutationObserverErrorResult title: MutationObserverErrorResult --- -Defined in: [packages/query-core/src/types.ts:1422](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1422) +Defined in: [packages/query-core/src/types.ts:1442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1442) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) +Defined in: [packages/query-core/src/types.ts:1453](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1453) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: TError; ``` -Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) +Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: true; ``` -Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) +Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) +Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) +Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) +Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:1440](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1440) +Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) +Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) The variables object passed to the `mutationFn`. diff --git a/docs/framework/vue/reference/interfaces/MutationObserverIdleResult.md b/docs/framework/vue/reference/interfaces/MutationObserverIdleResult.md index b7892846a6c..cd8d6eb3130 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverIdleResult.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverIdleResult.md @@ -3,7 +3,7 @@ id: MutationObserverIdleResult title: MutationObserverIdleResult --- -Defined in: [packages/query-core/src/types.ts:1380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1380) +Defined in: [packages/query-core/src/types.ts:1400](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1400) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1391](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1391) +Defined in: [packages/query-core/src/types.ts:1411](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1411) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) +Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1394](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1394) +Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: true; ``` -Defined in: [packages/query-core/src/types.ts:1395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1395) +Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1396](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1396) +Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) +Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "idle"; ``` -Defined in: [packages/query-core/src/types.ts:1398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1398) +Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1392](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1392) +Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) The variables object passed to the `mutationFn`. diff --git a/docs/framework/vue/reference/interfaces/MutationObserverLoadingResult.md b/docs/framework/vue/reference/interfaces/MutationObserverLoadingResult.md index d4368822213..9b70a8558e7 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverLoadingResult.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverLoadingResult.md @@ -3,7 +3,7 @@ id: MutationObserverLoadingResult title: MutationObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:1401](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1401) +Defined in: [packages/query-core/src/types.ts:1421](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1421) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:1412](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1412) +Defined in: [packages/query-core/src/types.ts:1432](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1432) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1414) +Defined in: [packages/query-core/src/types.ts:1434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1434) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1415](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1415) +Defined in: [packages/query-core/src/types.ts:1435](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1435) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1416](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1416) +Defined in: [packages/query-core/src/types.ts:1436](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1436) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:1417](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1417) +Defined in: [packages/query-core/src/types.ts:1437](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1437) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:1418](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1418) +Defined in: [packages/query-core/src/types.ts:1438](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1438) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:1419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1419) +Defined in: [packages/query-core/src/types.ts:1439](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1439) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1413](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1413) +Defined in: [packages/query-core/src/types.ts:1433](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1433) The variables object passed to the `mutationFn`. diff --git a/docs/framework/vue/reference/interfaces/MutationObserverOptions.md b/docs/framework/vue/reference/interfaces/MutationObserverOptions.md index d21a77b5505..b3835184b96 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverOptions.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverOptions.md @@ -3,7 +3,7 @@ id: MutationObserverOptions title: MutationObserverOptions --- -Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1255) +Defined in: [packages/query-core/src/types.ts:1267](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1267) ## Extends @@ -35,7 +35,7 @@ Defined in: [packages/query-core/src/types.ts:1255](https://github.com/TanStack/ optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:1248](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1248) +Defined in: [packages/query-core/src/types.ts:1260](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1260) The time in milliseconds that an unused/inactive mutation remains in memory before it is garbage collected. @@ -56,7 +56,7 @@ MutationOptions.gcTime optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:1251](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1251) +Defined in: [packages/query-core/src/types.ts:1263](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1263) #### Inherited from @@ -72,7 +72,7 @@ MutationOptions.meta optional mutationFn: MutationFunction; ``` -Defined in: [packages/query-core/src/types.ts:1196](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1196) +Defined in: [packages/query-core/src/types.ts:1206](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1206) #### Inherited from @@ -88,7 +88,7 @@ MutationOptions.mutationFn optional mutationKey: readonly unknown[]; ``` -Defined in: [packages/query-core/src/types.ts:1197](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1197) +Defined in: [packages/query-core/src/types.ts:1207](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1207) #### Inherited from @@ -104,7 +104,9 @@ MutationOptions.mutationKey optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:1241](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1241) +Defined in: [packages/query-core/src/types.ts:1253](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1253) + +Controls whether a mutation is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -126,7 +128,7 @@ MutationOptions.networkMode optional onError: (error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) +Defined in: [packages/query-core/src/types.ts:1218](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1218) #### Parameters @@ -164,7 +166,7 @@ MutationOptions.onError optional onMutate: (variables, context) => TOnMutateResult | Promise; ``` -Defined in: [packages/query-core/src/types.ts:1198](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1198) +Defined in: [packages/query-core/src/types.ts:1208](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1208) #### Parameters @@ -194,7 +196,7 @@ MutationOptions.onMutate optional onSettled: (data, error, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1214](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1214) +Defined in: [packages/query-core/src/types.ts:1224](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1224) #### Parameters @@ -236,7 +238,7 @@ MutationOptions.onSettled optional onSuccess: (data, variables, onMutateResult, context) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:1202](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1202) +Defined in: [packages/query-core/src/types.ts:1212](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1212) #### Parameters @@ -274,7 +276,7 @@ MutationOptions.onSuccess optional retry: RetryValue; ``` -Defined in: [packages/query-core/src/types.ts:1229](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1229) +Defined in: [packages/query-core/src/types.ts:1239](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1239) If `false`, failed mutations will not retry by default. If `true`, failed mutations will retry infinitely. @@ -297,7 +299,7 @@ MutationOptions.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:1236](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1236) +Defined in: [packages/query-core/src/types.ts:1246](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1246) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -318,7 +320,7 @@ MutationOptions.retryDelay optional scope: MutationScope; ``` -Defined in: [packages/query-core/src/types.ts:1252](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1252) +Defined in: [packages/query-core/src/types.ts:1264](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1264) #### Inherited from @@ -334,4 +336,11 @@ MutationOptions.scope optional throwOnError: boolean | (error) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:1261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1261) +Defined in: [packages/query-core/src/types.ts:1281](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1281) + +Whether errors should be thrown instead of setting the `error` property. +If set to `true`, all errors will be thrown to the nearest error boundary. +If set to a function, it will be passed the error and should return a boolean indicating whether to throw the +error (`true`) or return it as state (`false`). + +Defaults to `false`. diff --git a/docs/framework/vue/reference/interfaces/MutationObserverSuccessResult.md b/docs/framework/vue/reference/interfaces/MutationObserverSuccessResult.md index 52cdcc4883e..e2e03642f82 100644 --- a/docs/framework/vue/reference/interfaces/MutationObserverSuccessResult.md +++ b/docs/framework/vue/reference/interfaces/MutationObserverSuccessResult.md @@ -3,7 +3,7 @@ id: MutationObserverSuccessResult title: MutationObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:1443](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1443) +Defined in: [packages/query-core/src/types.ts:1463](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1463) The raw state stored on a `Mutation` instance. This is the underlying state that observer results (e.g. `MutationObserverResult`) are derived from. @@ -55,7 +55,7 @@ The value returned by `onMutate`, if defined. Passed to `onSuccess`, data: TData; ``` -Defined in: [packages/query-core/src/types.ts:1454](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1454) +Defined in: [packages/query-core/src/types.ts:1474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1474) The last successfully resolved data for the mutation. @@ -71,7 +71,7 @@ The last successfully resolved data for the mutation. error: null; ``` -Defined in: [packages/query-core/src/types.ts:1455](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1455) +Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) The error object for the mutation, if an error was encountered. - Defaults to `null`. @@ -120,7 +120,7 @@ The reason the current attempt failed, as reported by the retryer. isError: false; ``` -Defined in: [packages/query-core/src/types.ts:1457](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1457) +Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) A boolean variable derived from `status`. - `true` if the last mutation attempt resulted in an error. @@ -137,7 +137,7 @@ A boolean variable derived from `status`. isIdle: false; ``` -Defined in: [packages/query-core/src/types.ts:1458](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1458) +Defined in: [packages/query-core/src/types.ts:1478](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1478) A boolean variable derived from `status`. - `true` if the mutation is in its initial state prior to executing. @@ -171,7 +171,7 @@ waiting for another mutation with the same `scope` to finish. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:1459](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1459) +Defined in: [packages/query-core/src/types.ts:1479](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1479) A boolean variable derived from `status`. - `true` if the mutation is currently executing. @@ -188,7 +188,7 @@ A boolean variable derived from `status`. isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:1460](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1460) +Defined in: [packages/query-core/src/types.ts:1480](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1480) A boolean variable derived from `status`. - `true` if the last mutation attempt was successful. @@ -205,7 +205,7 @@ A boolean variable derived from `status`. mutate: MutateFunction; ``` -Defined in: [packages/query-core/src/types.ts:1373](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1373) +Defined in: [packages/query-core/src/types.ts:1393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1393) The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. @@ -242,7 +242,7 @@ This function will fire when the mutation is either successfully fetched or enco reset: () => void; ``` -Defined in: [packages/query-core/src/types.ts:1377](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1377) +Defined in: [packages/query-core/src/types.ts:1397](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1397) A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). @@ -262,7 +262,7 @@ A function to clean the mutation internal state (i.e., it resets the mutation to status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:1461](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1461) +Defined in: [packages/query-core/src/types.ts:1481](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1481) The status of the mutation. - Will be: @@ -299,7 +299,7 @@ The timestamp for when the mutation was submitted. variables: TVariables; ``` -Defined in: [packages/query-core/src/types.ts:1456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1456) +Defined in: [packages/query-core/src/types.ts:1476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1476) The variables object passed to the `mutationFn`. diff --git a/docs/framework/vue/reference/interfaces/NotifyEvent.md b/docs/framework/vue/reference/interfaces/NotifyEvent.md index 5e7875d41b8..4f5b023f49a 100644 --- a/docs/framework/vue/reference/interfaces/NotifyEvent.md +++ b/docs/framework/vue/reference/interfaces/NotifyEvent.md @@ -3,7 +3,7 @@ id: NotifyEvent title: NotifyEvent --- -Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1519) +Defined in: [packages/query-core/src/types.ts:1539](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1539) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1519](https://github.com/TanStack/ type: NotifyEventType; ``` -Defined in: [packages/query-core/src/types.ts:1520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1520) +Defined in: [packages/query-core/src/types.ts:1540](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1540) diff --git a/docs/framework/vue/reference/interfaces/QueryClientConfig.md b/docs/framework/vue/reference/interfaces/QueryClientConfig.md index 411eb0b2fb2..070e249491f 100644 --- a/docs/framework/vue/reference/interfaces/QueryClientConfig.md +++ b/docs/framework/vue/reference/interfaces/QueryClientConfig.md @@ -3,7 +3,7 @@ id: QueryClientConfig title: QueryClientConfig --- -Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1475) +Defined in: [packages/query-core/src/types.ts:1495](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1495) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/query-core/src/types.ts:1475](https://github.com/TanStack/ optional defaultOptions: DefaultOptions; ``` -Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) +Defined in: [packages/query-core/src/types.ts:1504](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1504) Default options for all queries and mutations created through this client. @@ -25,7 +25,7 @@ Default options for all queries and mutations created through this client. optional mutationCache: MutationCache; ``` -Defined in: [packages/query-core/src/types.ts:1482](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1482) +Defined in: [packages/query-core/src/types.ts:1502](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1502) The mutation cache this client is connected to. A new `MutationCache` is created if not provided. @@ -38,6 +38,6 @@ provided. optional queryCache: QueryCache; ``` -Defined in: [packages/query-core/src/types.ts:1477](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1477) +Defined in: [packages/query-core/src/types.ts:1497](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1497) The query cache this client is connected to. A new `QueryCache` is created if not provided. diff --git a/docs/framework/vue/reference/interfaces/QueryExecuteOptions.md b/docs/framework/vue/reference/interfaces/QueryExecuteOptions.md index d2ebd296f94..b16474c4999 100644 --- a/docs/framework/vue/reference/interfaces/QueryExecuteOptions.md +++ b/docs/framework/vue/reference/interfaces/QueryExecuteOptions.md @@ -3,7 +3,7 @@ id: QueryExecuteOptions title: QueryExecuteOptions --- -Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L566) +Defined in: [packages/query-core/src/types.ts:574](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L574) ## Extends @@ -43,12 +43,13 @@ Defined in: [packages/query-core/src/types.ts:566](https://github.com/TanStack/q optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -70,7 +71,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -93,7 +94,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -111,7 +112,7 @@ WithRequired.initialDataUpdatedAt optional initialPageParam: undefined; ``` -Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L577) +Defined in: [packages/query-core/src/types.ts:585](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L585) *** @@ -121,7 +122,7 @@ Defined in: [packages/query-core/src/types.ts:577](https://github.com/TanStack/q optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -139,7 +140,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -158,7 +159,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -180,7 +183,7 @@ WithRequired.networkMode optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -201,7 +204,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -223,7 +226,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -242,7 +245,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -265,7 +268,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -306,7 +309,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -316,6 +319,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -330,7 +335,7 @@ WithRequired.retryDelay optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L578) +Defined in: [packages/query-core/src/types.ts:586](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L586) #### Parameters @@ -350,7 +355,7 @@ Defined in: [packages/query-core/src/types.ts:578](https://github.com/TanStack/q optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:583](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L583) +Defined in: [packages/query-core/src/types.ts:591](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L591) The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache. @@ -363,7 +368,7 @@ If the data is fresh it will be returned from the cache. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. diff --git a/docs/framework/vue/reference/interfaces/QueryObserverBaseResult.md b/docs/framework/vue/reference/interfaces/QueryObserverBaseResult.md index 1b54d6f8041..ef5fe0ad757 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverBaseResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverBaseResult.md @@ -3,7 +3,7 @@ id: QueryObserverBaseResult title: QueryObserverBaseResult --- -Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L754) +Defined in: [packages/query-core/src/types.ts:764](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L764) ## Extended by @@ -33,7 +33,7 @@ Defined in: [packages/query-core/src/types.ts:754](https://github.com/TanStack/q data: TData | undefined; ``` -Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) +Defined in: [packages/query-core/src/types.ts:771](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L771) The last successfully resolved data for the query. @@ -45,7 +45,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -57,7 +57,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:770](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L770) +Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -70,7 +70,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -82,7 +82,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -94,7 +94,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -108,7 +108,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -121,7 +121,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -137,7 +137,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -149,7 +149,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:794](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L794) +Defined in: [packages/query-core/src/types.ts:804](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L804) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -162,7 +162,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -174,7 +174,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -187,7 +187,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -200,7 +200,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -215,7 +215,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -228,7 +228,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:821](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L821) +Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) Will be `true` if the query failed while fetching for the first time. @@ -240,7 +240,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -253,7 +253,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: boolean; ``` -Defined in: [packages/query-core/src/types.ts:817](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L817) +Defined in: [packages/query-core/src/types.ts:827](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L827) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -265,7 +265,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: boolean; ``` -Defined in: [packages/query-core/src/types.ts:835](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L835) +Defined in: [packages/query-core/src/types.ts:845](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L845) Will be `true` if the data shown is the placeholder data. @@ -277,7 +277,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:839](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L839) +Defined in: [packages/query-core/src/types.ts:849](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L849) Will be `true` if the query failed while refetching. @@ -289,7 +289,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -302,7 +302,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -314,7 +314,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: boolean; ``` -Defined in: [packages/query-core/src/types.ts:853](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L853) +Defined in: [packages/query-core/src/types.ts:863](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L863) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -327,7 +327,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -349,7 +349,7 @@ A function to manually refetch the query. status: QueryStatus; ``` -Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) +Defined in: [packages/query-core/src/types.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L881) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverLoadingErrorResult.md b/docs/framework/vue/reference/interfaces/QueryObserverLoadingErrorResult.md index 7a4f855305f..21b39fbffe3 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverLoadingErrorResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverLoadingErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingErrorResult title: QueryObserverLoadingErrorResult --- -Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) +Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) +Defined in: [packages/query-core/src/types.ts:927](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L927) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) +Defined in: [packages/query-core/src/types.ts:928](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L928) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) +Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:921](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L921) +Defined in: [packages/query-core/src/types.ts:931](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L931) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: true; ``` -Defined in: [packages/query-core/src/types.ts:922](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L922) +Defined in: [packages/query-core/src/types.ts:932](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L932) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) +Defined in: [packages/query-core/src/types.ts:930](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L930) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:925](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L925) +Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:923](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L923) +Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:924](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L924) +Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:926](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L926) +Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverLoadingResult.md b/docs/framework/vue/reference/interfaces/QueryObserverLoadingResult.md index 8f94574bcca..4966390127f 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverLoadingResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverLoadingResult.md @@ -3,7 +3,7 @@ id: QueryObserverLoadingResult title: QueryObserverLoadingResult --- -Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) +Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) +Defined in: [packages/query-core/src/types.ts:911](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L911) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) +Defined in: [packages/query-core/src/types.ts:912](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L912) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) +Defined in: [packages/query-core/src/types.ts:913](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L913) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: true; ``` -Defined in: [packages/query-core/src/types.ts:905](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L905) +Defined in: [packages/query-core/src/types.ts:915](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L915) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:906](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L906) +Defined in: [packages/query-core/src/types.ts:916](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L916) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) +Defined in: [packages/query-core/src/types.ts:914](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L914) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:909](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L909) +Defined in: [packages/query-core/src/types.ts:919](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L919) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:907](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L907) +Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:908](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L908) +Defined in: [packages/query-core/src/types.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L918) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:910](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L910) +Defined in: [packages/query-core/src/types.ts:920](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L920) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverOptions.md b/docs/framework/vue/reference/interfaces/QueryObserverOptions.md index f6180995f76..8b31eca49b1 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverOptions.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverOptions.md @@ -3,7 +3,7 @@ id: QueryObserverOptions title: QueryObserverOptions --- -Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L375) +Defined in: [packages/query-core/src/types.ts:380](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L380) ## Extends @@ -47,7 +47,7 @@ Defined in: [packages/query-core/src/types.ts:375](https://github.com/TanStack/q optional enabled: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:393](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L393) +Defined in: [packages/query-core/src/types.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L398) Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. @@ -63,12 +63,13 @@ Defaults to `true`. optional gcTime: number; ``` -Defined in: [packages/query-core/src/types.ts:272](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L272) +Defined in: [packages/query-core/src/types.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L277) The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. + Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -90,7 +91,7 @@ optional initialData: | InitialDataFunction; ``` -Defined in: [packages/query-core/src/types.ts:312](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L312) +Defined in: [packages/query-core/src/types.ts:317](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L317) If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). @@ -113,7 +114,7 @@ WithRequired.initialData optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-core/src/types.ts:316](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L316) +Defined in: [packages/query-core/src/types.ts:321](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L321) If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. @@ -131,7 +132,7 @@ WithRequired.initialDataUpdatedAt optional maxPages: number; ``` -Defined in: [packages/query-core/src/types.ts:340](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L340) +Defined in: [packages/query-core/src/types.ts:345](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L345) Maximum number of pages to store in the data of an infinite query. @@ -149,7 +150,7 @@ WithRequired.maxPages optional meta: Record; ``` -Defined in: [packages/query-core/src/types.ts:336](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L336) +Defined in: [packages/query-core/src/types.ts:341](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L341) Additional payload to be stored on each query. Use this property to pass information that can be used in other places. @@ -168,7 +169,9 @@ WithRequired.meta optional networkMode: NetworkMode; ``` -Defined in: [packages/query-core/src/types.ts:261](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L261) +Defined in: [packages/query-core/src/types.ts:265](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L265) + +Controls whether a query is allowed to run based on the current network connectivity. Defaults to `'online'`. @@ -190,13 +193,15 @@ WithRequired.networkMode optional notifyOnChangeProps: NotifyOnChangeProps; ``` -Defined in: [packages/query-core/src/types.ts:476](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L476) +Defined in: [packages/query-core/src/types.ts:484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L484) If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. -By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + +Defaults to `undefined`, in which case property access is tracked automatically, and the +component only re-renders when one of the tracked properties changes. *** @@ -206,7 +211,7 @@ By default, access to properties will be tracked, and the component will only re optional persister: QueryPersister, TPageParam>; ``` -Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) +Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. @@ -227,7 +232,7 @@ optional placeholderData: | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; ``` -Defined in: [packages/query-core/src/types.ts:503](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L503) +Defined in: [packages/query-core/src/types.ts:511](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L511) If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. @@ -241,7 +246,7 @@ optional queryFn: | QueryFunction; ``` -Defined in: [packages/query-core/src/types.ts:280](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L280) +Defined in: [packages/query-core/src/types.ts:285](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L285) The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or @@ -263,7 +268,7 @@ WithRequired.queryFn optional queryHash: string; ``` -Defined in: [packages/query-core/src/types.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L290) +Defined in: [packages/query-core/src/types.ts:295](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L295) The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. @@ -282,7 +287,7 @@ WithRequired.queryHash queryKey: TQueryKey & object; ``` -Defined in: [packages/query-core/src/types.ts:299](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L299) +Defined in: [packages/query-core/src/types.ts:304](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L304) The query key to use for this query. @@ -305,7 +310,7 @@ WithRequired.queryKey optional queryKeyHashFn: QueryKeyHashFunction; ``` -Defined in: [packages/query-core/src/types.ts:303](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L303) +Defined in: [packages/query-core/src/types.ts:308](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L308) If specified, this function is used to hash the `queryKey` to a string. @@ -323,7 +328,7 @@ WithRequired.queryKeyHashFn optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-core/src/types.ts:409](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L409) +Defined in: [packages/query-core/src/types.ts:414](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L414) If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency @@ -338,9 +343,10 @@ Defaults to `false`. optional refetchIntervalInBackground: boolean; ``` -Defined in: [packages/query-core/src/types.ts:419](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L419) +Defined in: [packages/query-core/src/types.ts:425](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L425) If set to `true`, the query will continue to refetch while their tab/window is in the background. + Defaults to `false`. *** @@ -351,7 +357,7 @@ Defaults to `false`. optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:456](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L456) +Defined in: [packages/query-core/src/types.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L462) If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. @@ -368,7 +374,7 @@ Defaults to `true`. optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:442](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L442) +Defined in: [packages/query-core/src/types.ts:448](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L448) If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. @@ -385,7 +391,7 @@ Defaults to `true` unless `networkMode` is `'always'`. optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-core/src/types.ts:428](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L428) +Defined in: [packages/query-core/src/types.ts:434](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L434) If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. @@ -425,7 +431,7 @@ WithRequired.retry optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-core/src/types.ts:256](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L256) +Defined in: [packages/query-core/src/types.ts:258](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L258) This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. @@ -435,6 +441,8 @@ backoff. A function like `attempt => attempt * 1000` applies linear backoff. +Defaults to a function that applies exponential backoff, capped at 30 seconds. + #### Inherited from ```ts @@ -449,7 +457,7 @@ WithRequired.retryDelay optional retryOnMount: QueryBooleanOption; ``` -Defined in: [packages/query-core/src/types.ts:468](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L468) +Defined in: [packages/query-core/src/types.ts:474](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L474) If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. @@ -464,7 +472,7 @@ Defaults to `true`. optional select: (data) => TData; ``` -Defined in: [packages/query-core/src/types.ts:492](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L492) +Defined in: [packages/query-core/src/types.ts:500](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L500) This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. @@ -489,7 +497,7 @@ changes. To optimize, memoize the function so its reference stays stable across optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-core/src/types.ts:402](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L402) +Defined in: [packages/query-core/src/types.ts:407](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L407) The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. @@ -506,7 +514,7 @@ Defaults to `0`. optional structuralSharing: boolean | (oldData, newData) => unknown; ``` -Defined in: [packages/query-core/src/types.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L325) +Defined in: [packages/query-core/src/types.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L330) Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. @@ -527,7 +535,7 @@ WithRequired.structuralSharing optional suspense: boolean; ``` -Defined in: [packages/query-core/src/types.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L499) +Defined in: [packages/query-core/src/types.ts:507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L507) If set to `true`, the query will suspend when `status === 'pending'` and throw errors when `status === 'error'`. @@ -542,7 +550,7 @@ Defaults to `false`. optional throwOnError: ThrowOnError; ``` -Defined in: [packages/query-core/src/types.ts:485](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L485) +Defined in: [packages/query-core/src/types.ts:493](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L493) Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. diff --git a/docs/framework/vue/reference/interfaces/QueryObserverPendingResult.md b/docs/framework/vue/reference/interfaces/QueryObserverPendingResult.md index 41a101c7c8c..8f00c426b64 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverPendingResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverPendingResult.md @@ -3,7 +3,7 @@ id: QueryObserverPendingResult title: QueryObserverPendingResult --- -Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L882) +Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:882](https://github.com/TanStack/q data: undefined; ``` -Defined in: [packages/query-core/src/types.ts:886](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L886) +Defined in: [packages/query-core/src/types.ts:896](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L896) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:887](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L887) +Defined in: [packages/query-core/src/types.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L897) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:888](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L888) +Defined in: [packages/query-core/src/types.ts:898](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L898) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) +Defined in: [packages/query-core/src/types.ts:823](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L823) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:890](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L890) +Defined in: [packages/query-core/src/types.ts:900](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L900) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: true; ``` -Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) +Defined in: [packages/query-core/src/types.ts:899](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L899) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:893](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L893) +Defined in: [packages/query-core/src/types.ts:903](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L903) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:891](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L891) +Defined in: [packages/query-core/src/types.ts:901](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L901) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:892](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L892) +Defined in: [packages/query-core/src/types.ts:902](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L902) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "pending"; ``` -Defined in: [packages/query-core/src/types.ts:894](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L894) +Defined in: [packages/query-core/src/types.ts:904](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L904) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverPlaceholderResult.md b/docs/framework/vue/reference/interfaces/QueryObserverPlaceholderResult.md index cce7cffcc9b..bbf3da387f9 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverPlaceholderResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverPlaceholderResult.md @@ -3,7 +3,7 @@ id: QueryObserverPlaceholderResult title: QueryObserverPlaceholderResult --- -Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) +Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) +Defined in: [packages/query-core/src/types.ts:975](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L975) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) +Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) +Defined in: [packages/query-core/src/types.ts:976](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L976) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:969](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L969) +Defined in: [packages/query-core/src/types.ts:979](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L979) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L970) +Defined in: [packages/query-core/src/types.ts:980](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L980) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) +Defined in: [packages/query-core/src/types.ts:978](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L978) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: true; ``` -Defined in: [packages/query-core/src/types.ts:973](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L973) +Defined in: [packages/query-core/src/types.ts:983](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L983) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:971](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L971) +Defined in: [packages/query-core/src/types.ts:981](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L981) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:972](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L972) +Defined in: [packages/query-core/src/types.ts:982](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L982) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:974](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L974) +Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverRefetchErrorResult.md b/docs/framework/vue/reference/interfaces/QueryObserverRefetchErrorResult.md index 8486e8cf4cb..345ecab35e1 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverRefetchErrorResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverRefetchErrorResult.md @@ -3,7 +3,7 @@ id: QueryObserverRefetchErrorResult title: QueryObserverRefetchErrorResult --- -Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L929) +Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:929](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:933](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L933) +Defined in: [packages/query-core/src/types.ts:943](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L943) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: TError; ``` -Defined in: [packages/query-core/src/types.ts:934](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L934) +Defined in: [packages/query-core/src/types.ts:944](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L944) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: true; ``` -Defined in: [packages/query-core/src/types.ts:935](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L935) +Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:937](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L937) +Defined in: [packages/query-core/src/types.ts:947](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L947) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L938) +Defined in: [packages/query-core/src/types.ts:948](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L948) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:936](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L936) +Defined in: [packages/query-core/src/types.ts:946](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L946) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:941](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L941) +Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: true; ``` -Defined in: [packages/query-core/src/types.ts:939](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L939) +Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: false; ``` -Defined in: [packages/query-core/src/types.ts:940](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L940) +Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "error"; ``` -Defined in: [packages/query-core/src/types.ts:942](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L942) +Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/QueryObserverSuccessResult.md b/docs/framework/vue/reference/interfaces/QueryObserverSuccessResult.md index f126bea0f70..3942655c627 100644 --- a/docs/framework/vue/reference/interfaces/QueryObserverSuccessResult.md +++ b/docs/framework/vue/reference/interfaces/QueryObserverSuccessResult.md @@ -3,7 +3,7 @@ id: QueryObserverSuccessResult title: QueryObserverSuccessResult --- -Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L945) +Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:945](https://github.com/TanStack/q data: TData; ``` -Defined in: [packages/query-core/src/types.ts:949](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L949) +Defined in: [packages/query-core/src/types.ts:959](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L959) The last successfully resolved data for the query. @@ -43,7 +43,7 @@ The last successfully resolved data for the query. dataUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:765](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L765) +Defined in: [packages/query-core/src/types.ts:775](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L775) The timestamp for when the query most recently returned the `status` as `"success"`. @@ -59,7 +59,7 @@ The timestamp for when the query most recently returned the `status` as `"succes error: null; ``` -Defined in: [packages/query-core/src/types.ts:950](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L950) +Defined in: [packages/query-core/src/types.ts:960](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L960) The error object for the query, if an error was thrown. - Defaults to `null`. @@ -76,7 +76,7 @@ The error object for the query, if an error was thrown. errorUpdateCount: number; ``` -Defined in: [packages/query-core/src/types.ts:789](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L789) +Defined in: [packages/query-core/src/types.ts:799](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L799) The sum of all errors. @@ -92,7 +92,7 @@ The sum of all errors. errorUpdatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:774](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L774) +Defined in: [packages/query-core/src/types.ts:784](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L784) The timestamp for when the query most recently returned the `status` as `"error"`. @@ -108,7 +108,7 @@ The timestamp for when the query most recently returned the `status` as `"error" failureCount: number; ``` -Defined in: [packages/query-core/src/types.ts:780](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L780) +Defined in: [packages/query-core/src/types.ts:790](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L790) The failure count for the query. - Incremented every time the query fails. @@ -126,7 +126,7 @@ The failure count for the query. failureReason: TError | null; ``` -Defined in: [packages/query-core/src/types.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L785) +Defined in: [packages/query-core/src/types.ts:795](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L795) The failure reason for the query retry. - Reset to `null` when the query succeeds. @@ -143,7 +143,7 @@ The failure reason for the query retry. fetchStatus: FetchStatus; ``` -Defined in: [packages/query-core/src/types.ts:879](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L879) +Defined in: [packages/query-core/src/types.ts:889](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L889) The fetch status of the query. - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. @@ -163,7 +163,7 @@ The fetch status of the query. isEnabled: boolean; ``` -Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L857) +Defined in: [packages/query-core/src/types.ts:867](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L867) `true` if this observer is enabled, `false` otherwise. @@ -179,7 +179,7 @@ Defined in: [packages/query-core/src/types.ts:857](https://github.com/TanStack/q isError: false; ``` -Defined in: [packages/query-core/src/types.ts:951](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L951) +Defined in: [packages/query-core/src/types.ts:961](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L961) A derived boolean from the `status` variable, provided for convenience. - `true` if the query attempt resulted in an error. @@ -196,7 +196,7 @@ A derived boolean from the `status` variable, provided for convenience. isFetched: boolean; ``` -Defined in: [packages/query-core/src/types.ts:798](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L798) +Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) Will be `true` if the query has been fetched. @@ -212,7 +212,7 @@ Will be `true` if the query has been fetched. isFetchedAfterMount: boolean; ``` -Defined in: [packages/query-core/src/types.ts:803](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L803) +Defined in: [packages/query-core/src/types.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L813) Will be `true` if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data. @@ -229,7 +229,7 @@ Will be `true` if the query has been fetched after the component mounted. isFetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:808](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L808) +Defined in: [packages/query-core/src/types.ts:818](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L818) A derived boolean from the `fetchStatus` variable, provided for convenience. - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. @@ -246,7 +246,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isInitialLoading: boolean; ``` -Defined in: [packages/query-core/src/types.ts:826](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L826) +Defined in: [packages/query-core/src/types.ts:836](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L836) #### Deprecated @@ -265,7 +265,7 @@ and will be removed in the next major version. isLoading: false; ``` -Defined in: [packages/query-core/src/types.ts:953](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L953) +Defined in: [packages/query-core/src/types.ts:963](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L963) Is `true` whenever the first fetch for a query is in-flight. - Is the same as `isFetching && isPending`. @@ -282,7 +282,7 @@ Is `true` whenever the first fetch for a query is in-flight. isLoadingError: false; ``` -Defined in: [packages/query-core/src/types.ts:954](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L954) +Defined in: [packages/query-core/src/types.ts:964](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L964) Will be `true` if the query failed while fetching for the first time. @@ -298,7 +298,7 @@ Will be `true` if the query failed while fetching for the first time. isPaused: boolean; ``` -Defined in: [packages/query-core/src/types.ts:831](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L831) +Defined in: [packages/query-core/src/types.ts:841](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L841) A derived boolean from the `fetchStatus` variable, provided for convenience. - The query wanted to fetch, but has been `paused`. @@ -315,7 +315,7 @@ A derived boolean from the `fetchStatus` variable, provided for convenience. isPending: false; ``` -Defined in: [packages/query-core/src/types.ts:952](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L952) +Defined in: [packages/query-core/src/types.ts:962](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L962) Will be `pending` if there's no cached data and no query attempt was finished yet. @@ -331,7 +331,7 @@ Will be `pending` if there's no cached data and no query attempt was finished ye isPlaceholderData: false; ``` -Defined in: [packages/query-core/src/types.ts:957](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L957) +Defined in: [packages/query-core/src/types.ts:967](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L967) Will be `true` if the data shown is the placeholder data. @@ -347,7 +347,7 @@ Will be `true` if the data shown is the placeholder data. isRefetchError: false; ``` -Defined in: [packages/query-core/src/types.ts:955](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L955) +Defined in: [packages/query-core/src/types.ts:965](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L965) Will be `true` if the query failed while refetching. @@ -363,7 +363,7 @@ Will be `true` if the query failed while refetching. isRefetching: boolean; ``` -Defined in: [packages/query-core/src/types.ts:844](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L844) +Defined in: [packages/query-core/src/types.ts:854](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L854) Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - Is the same as `isFetching && !isPending`. @@ -380,7 +380,7 @@ Is `true` whenever a background refetch is in-flight, which _does not_ include i isStale: boolean; ``` -Defined in: [packages/query-core/src/types.ts:848](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L848) +Defined in: [packages/query-core/src/types.ts:858](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L858) Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. @@ -396,7 +396,7 @@ Will be `true` if the data in the cache is invalidated or if the data is older t isSuccess: true; ``` -Defined in: [packages/query-core/src/types.ts:956](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L956) +Defined in: [packages/query-core/src/types.ts:966](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L966) A derived boolean from the `status` variable, provided for convenience. - `true` if the query has received a response with no errors and is ready to display its data. @@ -413,7 +413,7 @@ A derived boolean from the `status` variable, provided for convenience. refetch: (options?) => Promise>; ``` -Defined in: [packages/query-core/src/types.ts:861](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L861) +Defined in: [packages/query-core/src/types.ts:871](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L871) A function to manually refetch the query. @@ -439,7 +439,7 @@ A function to manually refetch the query. status: "success"; ``` -Defined in: [packages/query-core/src/types.ts:958](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L958) +Defined in: [packages/query-core/src/types.ts:968](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L968) The status of the query. - Will be: diff --git a/docs/framework/vue/reference/interfaces/RefetchOptions.md b/docs/framework/vue/reference/interfaces/RefetchOptions.md index 104412c5bac..cfcc0498799 100644 --- a/docs/framework/vue/reference/interfaces/RefetchOptions.md +++ b/docs/framework/vue/reference/interfaces/RefetchOptions.md @@ -3,7 +3,7 @@ id: RefetchOptions title: RefetchOptions --- -Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L695) +Defined in: [packages/query-core/src/types.ts:704](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L704) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/query-core/src/types.ts:695](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -38,9 +38,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/vue/reference/interfaces/RefetchQueryFilters.md b/docs/framework/vue/reference/interfaces/RefetchQueryFilters.md index 00581054484..e3fcaae638f 100644 --- a/docs/framework/vue/reference/interfaces/RefetchQueryFilters.md +++ b/docs/framework/vue/reference/interfaces/RefetchQueryFilters.md @@ -3,7 +3,7 @@ id: RefetchQueryFilters title: RefetchQueryFilters --- -Defined in: [packages/query-core/src/types.ts:720](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L720) +Defined in: [packages/query-core/src/types.ts:730](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L730) ## Extends diff --git a/docs/framework/vue/reference/interfaces/ResetOptions.md b/docs/framework/vue/reference/interfaces/ResetOptions.md index 6d3a8398fbb..9f12324ba27 100644 --- a/docs/framework/vue/reference/interfaces/ResetOptions.md +++ b/docs/framework/vue/reference/interfaces/ResetOptions.md @@ -3,7 +3,7 @@ id: ResetOptions title: ResetOptions --- -Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L725) +Defined in: [packages/query-core/src/types.ts:735](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L735) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:725](https://github.com/TanStack/q optional cancelRefetch: boolean; ``` -Defined in: [packages/query-core/src/types.ts:703](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L703) +Defined in: [packages/query-core/src/types.ts:712](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L712) If set to `true`, a currently running request will be cancelled before a new request is made @@ -37,9 +37,10 @@ Defaults to `true`. optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/vue/reference/interfaces/ResultOptions.md b/docs/framework/vue/reference/interfaces/ResultOptions.md index f3da151a3ec..42917f20bf0 100644 --- a/docs/framework/vue/reference/interfaces/ResultOptions.md +++ b/docs/framework/vue/reference/interfaces/ResultOptions.md @@ -3,7 +3,7 @@ id: ResultOptions title: ResultOptions --- -Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L686) +Defined in: [packages/query-core/src/types.ts:694](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L694) ## Extended by @@ -19,8 +19,9 @@ Defined in: [packages/query-core/src/types.ts:686](https://github.com/TanStack/q optional throwOnError: boolean; ``` -Defined in: [packages/query-core/src/types.ts:692](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L692) +Defined in: [packages/query-core/src/types.ts:701](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L701) If set to `true`, the method throws if any of the underlying query refetch tasks fail. + Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the caller. diff --git a/docs/framework/vue/reference/interfaces/SetDataOptions.md b/docs/framework/vue/reference/interfaces/SetDataOptions.md index cac83e9312a..bb668fbf162 100644 --- a/docs/framework/vue/reference/interfaces/SetDataOptions.md +++ b/docs/framework/vue/reference/interfaces/SetDataOptions.md @@ -3,7 +3,7 @@ id: SetDataOptions title: SetDataOptions --- -Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1506) +Defined in: [packages/query-core/src/types.ts:1526](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1526) ## Properties @@ -13,4 +13,4 @@ Defined in: [packages/query-core/src/types.ts:1506](https://github.com/TanStack/ optional updatedAt: number; ``` -Defined in: [packages/query-core/src/types.ts:1507](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1507) +Defined in: [packages/query-core/src/types.ts:1527](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1527) diff --git a/docs/framework/vue/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md b/docs/framework/vue/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md index 4412ad00c8e..82c7ddbb886 100644 --- a/docs/framework/vue/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md +++ b/docs/framework/vue/reference/type-aliases/DefaultedInfiniteQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedInfiniteQueryObserverOptions type DefaultedInfiniteQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:549](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L549) +Defined in: [packages/query-core/src/types.ts:557](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L557) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/DefaultedQueryObserverOptions.md b/docs/framework/vue/reference/type-aliases/DefaultedQueryObserverOptions.md index 9ce8401b128..7687d8c24f6 100644 --- a/docs/framework/vue/reference/type-aliases/DefaultedQueryObserverOptions.md +++ b/docs/framework/vue/reference/type-aliases/DefaultedQueryObserverOptions.md @@ -7,7 +7,7 @@ title: DefaultedQueryObserverOptions type DefaultedQueryObserverOptions = WithRequired, "throwOnError" | "refetchOnReconnect" | "queryHash">; ``` -Defined in: [packages/query-core/src/types.ts:520](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L520) +Defined in: [packages/query-core/src/types.ts:528](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L528) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult.md b/docs/framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult.md index cec33b142b7..38dac7cfe2b 100644 --- a/docs/framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult.md +++ b/docs/framework/vue/reference/type-aliases/DefinedInfiniteQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedInfiniteQueryObserverResult = | InfiniteQueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1138](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1138) +Defined in: [packages/query-core/src/types.ts:1148](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1148) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/DefinedQueryObserverResult.md b/docs/framework/vue/reference/type-aliases/DefinedQueryObserverResult.md index b4480af3810..ae77ddcc22d 100644 --- a/docs/framework/vue/reference/type-aliases/DefinedQueryObserverResult.md +++ b/docs/framework/vue/reference/type-aliases/DefinedQueryObserverResult.md @@ -9,7 +9,7 @@ type DefinedQueryObserverResult = | QueryObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:977](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L977) +Defined in: [packages/query-core/src/types.ts:987](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L987) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/EnsureInfiniteQueryDataOptions.md b/docs/framework/vue/reference/type-aliases/EnsureInfiniteQueryDataOptions.md index ff75b1c3449..7648331fca2 100644 --- a/docs/framework/vue/reference/type-aliases/EnsureInfiniteQueryDataOptions.md +++ b/docs/framework/vue/reference/type-aliases/EnsureInfiniteQueryDataOptions.md @@ -7,7 +7,7 @@ title: EnsureInfiniteQueryDataOptions type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & object; ``` -Defined in: [packages/query-core/src/types.ts:623](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L623) +Defined in: [packages/query-core/src/types.ts:631](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L631) ## Type Declaration diff --git a/docs/framework/vue/reference/type-aliases/FetchInfiniteQueryOptions.md b/docs/framework/vue/reference/type-aliases/FetchInfiniteQueryOptions.md index c926bbd3ae5..d00a2455889 100644 --- a/docs/framework/vue/reference/type-aliases/FetchInfiniteQueryOptions.md +++ b/docs/framework/vue/reference/type-aliases/FetchInfiniteQueryOptions.md @@ -7,7 +7,7 @@ title: FetchInfiniteQueryOptions type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:667](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L667) +Defined in: [packages/query-core/src/types.ts:675](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L675) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/FetchStatus.md b/docs/framework/vue/reference/type-aliases/FetchStatus.md index b347069e97e..d50002355ca 100644 --- a/docs/framework/vue/reference/type-aliases/FetchStatus.md +++ b/docs/framework/vue/reference/type-aliases/FetchStatus.md @@ -7,4 +7,4 @@ title: FetchStatus type FetchStatus = "fetching" | "paused" | "idle"; ``` -Defined in: [packages/query-core/src/types.ts:752](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L752) +Defined in: [packages/query-core/src/types.ts:762](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L762) diff --git a/docs/framework/vue/reference/type-aliases/InfiniteQueryExecuteOptions.md b/docs/framework/vue/reference/type-aliases/InfiniteQueryExecuteOptions.md index c198662a319..259c97c96bb 100644 --- a/docs/framework/vue/reference/type-aliases/InfiniteQueryExecuteOptions.md +++ b/docs/framework/vue/reference/type-aliases/InfiniteQueryExecuteOptions.md @@ -7,7 +7,7 @@ title: InfiniteQueryExecuteOptions type InfiniteQueryExecuteOptions = Omit, TQueryKey, TPageParam>, "initialPageParam"> & InitialPageParam & InfiniteQueryPages; ``` -Defined in: [packages/query-core/src/types.ts:646](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L646) +Defined in: [packages/query-core/src/types.ts:654](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L654) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/InfiniteQueryObserverResult.md b/docs/framework/vue/reference/type-aliases/InfiniteQueryObserverResult.md index 42279b19c00..aa27563b9cd 100644 --- a/docs/framework/vue/reference/type-aliases/InfiniteQueryObserverResult.md +++ b/docs/framework/vue/reference/type-aliases/InfiniteQueryObserverResult.md @@ -12,7 +12,7 @@ type InfiniteQueryObserverResult = | InfiniteQueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:1145](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1145) +Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/MutateFunction.md b/docs/framework/vue/reference/type-aliases/MutateFunction.md index 558040d3439..e12b7a80291 100644 --- a/docs/framework/vue/reference/type-aliases/MutateFunction.md +++ b/docs/framework/vue/reference/type-aliases/MutateFunction.md @@ -7,7 +7,7 @@ title: MutateFunction type MutateFunction = (...rest) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1306](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1306) +Defined in: [packages/query-core/src/types.ts:1326](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1326) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/MutateFunctionRest.md b/docs/framework/vue/reference/type-aliases/MutateFunctionRest.md index 3e7a5217482..3902f1082f9 100644 --- a/docs/framework/vue/reference/type-aliases/MutateFunctionRest.md +++ b/docs/framework/vue/reference/type-aliases/MutateFunctionRest.md @@ -7,7 +7,7 @@ title: MutateFunctionRest type MutateFunctionRest = undefined extends TVariables ? [TVariables, MutateOptions] : [TVariables, MutateOptions]; ``` -Defined in: [packages/query-core/src/types.ts:1291](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1291) +Defined in: [packages/query-core/src/types.ts:1311](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1311) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/MutationFunction.md b/docs/framework/vue/reference/type-aliases/MutationFunction.md index 330af1ef65a..9bafb3db56b 100644 --- a/docs/framework/vue/reference/type-aliases/MutationFunction.md +++ b/docs/framework/vue/reference/type-aliases/MutationFunction.md @@ -7,7 +7,7 @@ title: MutationFunction type MutationFunction = (variables, context) => Promise; ``` -Defined in: [packages/query-core/src/types.ts:1185](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1185) +Defined in: [packages/query-core/src/types.ts:1195](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1195) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/MutationFunctionContext.md b/docs/framework/vue/reference/type-aliases/MutationFunctionContext.md index 97de2f1c220..0207256c702 100644 --- a/docs/framework/vue/reference/type-aliases/MutationFunctionContext.md +++ b/docs/framework/vue/reference/type-aliases/MutationFunctionContext.md @@ -7,7 +7,7 @@ title: MutationFunctionContext type MutationFunctionContext = object; ``` -Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1179) +Defined in: [packages/query-core/src/types.ts:1189](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1189) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/query-core/src/types.ts:1179](https://github.com/TanStack/ client: QueryClient; ``` -Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1180) +Defined in: [packages/query-core/src/types.ts:1190](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1190) *** @@ -27,7 +27,7 @@ Defined in: [packages/query-core/src/types.ts:1180](https://github.com/TanStack/ meta: MutationMeta | undefined; ``` -Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) +Defined in: [packages/query-core/src/types.ts:1191](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1191) *** @@ -37,4 +37,4 @@ Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/ optional mutationKey: MutationKey; ``` -Defined in: [packages/query-core/src/types.ts:1182](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1182) +Defined in: [packages/query-core/src/types.ts:1192](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1192) diff --git a/docs/framework/vue/reference/type-aliases/MutationKey.md b/docs/framework/vue/reference/type-aliases/MutationKey.md index 8e9d3bc3b3a..9d1d7f0f77b 100644 --- a/docs/framework/vue/reference/type-aliases/MutationKey.md +++ b/docs/framework/vue/reference/type-aliases/MutationKey.md @@ -7,4 +7,4 @@ title: MutationKey type MutationKey = Register extends object ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends unknown[] ? TMutationKey : ReadonlyArray : ReadonlyArray; ``` -Defined in: [packages/query-core/src/types.ts:1155](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1155) +Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) diff --git a/docs/framework/vue/reference/type-aliases/MutationMeta.md b/docs/framework/vue/reference/type-aliases/MutationMeta.md index 474c593e206..ff1f9b4bf94 100644 --- a/docs/framework/vue/reference/type-aliases/MutationMeta.md +++ b/docs/framework/vue/reference/type-aliases/MutationMeta.md @@ -7,4 +7,4 @@ title: MutationMeta type MutationMeta = Register extends object ? TMutationMeta extends Record ? TMutationMeta : Record : Record; ``` -Defined in: [packages/query-core/src/types.ts:1171](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1171) +Defined in: [packages/query-core/src/types.ts:1181](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1181) diff --git a/docs/framework/vue/reference/type-aliases/MutationObserverResult.md b/docs/framework/vue/reference/type-aliases/MutationObserverResult.md index 21e43836bf6..c21fc3ac591 100644 --- a/docs/framework/vue/reference/type-aliases/MutationObserverResult.md +++ b/docs/framework/vue/reference/type-aliases/MutationObserverResult.md @@ -11,7 +11,7 @@ type MutationObserverResult = | MutationObserverSuccessResult; ``` -Defined in: [packages/query-core/src/types.ts:1464](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1464) +Defined in: [packages/query-core/src/types.ts:1484](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1484) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/MutationScope.md b/docs/framework/vue/reference/type-aliases/MutationScope.md index feac9d9d17a..1d6a91bd434 100644 --- a/docs/framework/vue/reference/type-aliases/MutationScope.md +++ b/docs/framework/vue/reference/type-aliases/MutationScope.md @@ -7,7 +7,7 @@ title: MutationScope type MutationScope = object; ``` -Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1167) +Defined in: [packages/query-core/src/types.ts:1177](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1177) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/query-core/src/types.ts:1167](https://github.com/TanStack/ id: string; ``` -Defined in: [packages/query-core/src/types.ts:1168](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1168) +Defined in: [packages/query-core/src/types.ts:1178](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1178) diff --git a/docs/framework/vue/reference/type-aliases/MutationStatus.md b/docs/framework/vue/reference/type-aliases/MutationStatus.md index 4cd2d3c9535..cf12d3d3ee3 100644 --- a/docs/framework/vue/reference/type-aliases/MutationStatus.md +++ b/docs/framework/vue/reference/type-aliases/MutationStatus.md @@ -7,4 +7,4 @@ title: MutationStatus type MutationStatus = "idle" | "pending" | "success" | "error"; ``` -Defined in: [packages/query-core/src/types.ts:1165](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1165) +Defined in: [packages/query-core/src/types.ts:1175](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1175) diff --git a/docs/framework/vue/reference/type-aliases/NotifyEventType.md b/docs/framework/vue/reference/type-aliases/NotifyEventType.md index 9bbc85e4ce8..ffa60b016e3 100644 --- a/docs/framework/vue/reference/type-aliases/NotifyEventType.md +++ b/docs/framework/vue/reference/type-aliases/NotifyEventType.md @@ -14,4 +14,4 @@ type NotifyEventType = | "observerOptionsUpdated"; ``` -Defined in: [packages/query-core/src/types.ts:1510](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1510) +Defined in: [packages/query-core/src/types.ts:1530](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L1530) diff --git a/docs/framework/vue/reference/type-aliases/QueryObserverResult.md b/docs/framework/vue/reference/type-aliases/QueryObserverResult.md index 4fc661a6c9d..5138b635f2c 100644 --- a/docs/framework/vue/reference/type-aliases/QueryObserverResult.md +++ b/docs/framework/vue/reference/type-aliases/QueryObserverResult.md @@ -12,7 +12,7 @@ type QueryObserverResult = | QueryObserverPlaceholderResult; ``` -Defined in: [packages/query-core/src/types.ts:984](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L984) +Defined in: [packages/query-core/src/types.ts:994](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L994) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/QueryStatus.md b/docs/framework/vue/reference/type-aliases/QueryStatus.md index 6679b8b17c6..bab00f6f423 100644 --- a/docs/framework/vue/reference/type-aliases/QueryStatus.md +++ b/docs/framework/vue/reference/type-aliases/QueryStatus.md @@ -7,4 +7,4 @@ title: QueryStatus type QueryStatus = "pending" | "error" | "success"; ``` -Defined in: [packages/query-core/src/types.ts:751](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L751) +Defined in: [packages/query-core/src/types.ts:761](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L761) diff --git a/docs/framework/vue/reference/type-aliases/ThrowOnError.md b/docs/framework/vue/reference/type-aliases/ThrowOnError.md index 613549e4d52..134683388ef 100644 --- a/docs/framework/vue/reference/type-aliases/ThrowOnError.md +++ b/docs/framework/vue/reference/type-aliases/ThrowOnError.md @@ -7,7 +7,7 @@ title: ThrowOnError type ThrowOnError = boolean | (error, query) => boolean; ``` -Defined in: [packages/query-core/src/types.ts:363](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L363) +Defined in: [packages/query-core/src/types.ts:368](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L368) ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/WithRequired.md b/docs/framework/vue/reference/type-aliases/WithRequired.md index deb87dfe4a4..a40a48c865b 100644 --- a/docs/framework/vue/reference/type-aliases/WithRequired.md +++ b/docs/framework/vue/reference/type-aliases/WithRequired.md @@ -7,7 +7,7 @@ title: WithRequired type WithRequired = TTarget & { [_ in TKey]: {} }; ``` -Defined in: [packages/query-core/src/types.ts:516](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L516) +Defined in: [packages/query-core/src/types.ts:524](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L524) ## Type Parameters diff --git a/packages/query-core/src/types.ts b/packages/query-core/src/types.ts index 3858f8fe1d0..08e254885a3 100644 --- a/packages/query-core/src/types.ts +++ b/packages/query-core/src/types.ts @@ -252,9 +252,13 @@ export interface QueryOptions< * backoff. * * A function like `attempt => attempt * 1000` applies linear backoff. + * + * Defaults to a function that applies exponential backoff, capped at 30 seconds. */ retryDelay?: RetryDelayValue /** + * Controls whether a query is allowed to run based on the current network connectivity. + * * Defaults to `'online'`. * @see [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. */ @@ -264,6 +268,7 @@ export interface QueryOptions< * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. * When different garbage collection times are specified, the longest one will be used. * Setting it to `Infinity` will disable garbage collection. + * * Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. * * Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see @@ -414,6 +419,7 @@ export interface QueryObserverOptions< ) => number | false | undefined) /** * If set to `true`, the query will continue to refetch while their tab/window is in the background. + * * Defaults to `false`. */ refetchIntervalInBackground?: boolean @@ -471,7 +477,9 @@ export interface QueryObserverOptions< * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. * When set to `'all'`, the component will re-render whenever a query is updated. * When set to a function, the function will be executed to compute the list of properties. - * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + * + * Defaults to `undefined`, in which case property access is tracked automatically, and the + * component only re-renders when one of the tracked properties changes. */ notifyOnChangeProps?: NotifyOnChangeProps /** @@ -686,6 +694,7 @@ export type FetchInfiniteQueryOptions< export interface ResultOptions { /** * If set to `true`, the method throws if any of the underlying query refetch tasks fail. + * * Defaults to `false`, in which case failed refetches are swallowed and not surfaced to the * caller. */ @@ -708,6 +717,7 @@ export interface InvalidateQueryFilters< > extends QueryFilters { /** * Controls which of the matched (now-invalidated) queries are refetched in the background. + * * Defaults to `'active'`. * - `'active'`: only queries with at least one active observer are refetched. * - `'inactive'`: only queries with no active observer are refetched. @@ -1235,6 +1245,8 @@ export interface MutationOptions< */ retryDelay?: RetryDelayValue /** + * Controls whether a mutation is allowed to run based on the current network connectivity. + * * Defaults to `'online'`. * @see [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. */ @@ -1258,6 +1270,14 @@ export interface MutationObserverOptions< TVariables = void, TOnMutateResult = unknown, > extends MutationOptions { + /** + * Whether errors should be thrown instead of setting the `error` property. + * If set to `true`, all errors will be thrown to the nearest error boundary. + * If set to a function, it will be passed the error and should return a boolean indicating whether to throw the + * error (`true`) or return it as state (`false`). + * + * Defaults to `false`. + */ throwOnError?: boolean | ((error: TError) => boolean) } From 2031b93a03bd9e98563a42a155aca624434b207b Mon Sep 17 00:00:00 2001 From: Wonsuk Choi Date: Mon, 7 Sep 2026 23:18:16 +0900 Subject: [PATCH 9/9] docs(query-core): fix 'environmentManager' JSDoc example --- .../reference/variables/environmentManager.md | 16 ++++++++-------- .../reference/variables/environmentManager.md | 16 ++++++++-------- .../reference/variables/environmentManager.md | 16 ++++++++-------- .../reference/variables/environmentManager.md | 16 ++++++++-------- .../reference/variables/environmentManager.md | 16 ++++++++-------- .../reference/variables/environmentManager.md | 16 ++++++++-------- .../reference/variables/environmentManager.md | 16 ++++++++-------- packages/query-core/src/environmentManager.ts | 16 ++++++++-------- 8 files changed, 64 insertions(+), 64 deletions(-) diff --git a/docs/framework/angular/reference/variables/environmentManager.md b/docs/framework/angular/reference/variables/environmentManager.md index e207cfd2484..ed333b8747b 100644 --- a/docs/framework/angular/reference/variables/environmentManager.md +++ b/docs/framework/angular/reference/variables/environmentManager.md @@ -10,10 +10,13 @@ const environmentManager: object; Defined in: [packages/query-core/src/environmentManager.ts:29](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L29) Manages how TanStack Query detects whether the current runtime should be treated as -server-side. By default, this uses the same detection as the exported `isServer` utility. +server-side, which disables scheduling refetch timers and changes the default `retry` count +and `gcTime`. By default, the detection treats a missing `window` (or the presence of a +`Deno` global) as server. -Override this for runtimes that are not traditional browser/server environments (e.g. -extension workers), where the default detection would give the wrong answer. +Override this for runtimes where that default detection would give the wrong answer — for +example, a Service Worker, where `window` is undefined even though the environment should +behave like a client. ## Type Declaration @@ -50,10 +53,7 @@ Overrides the server check globally. ## Example ```ts -import { environmentManager, isServer } from '@tanstack/query-core' +import { environmentManager } from '@tanstack/query-core' -environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis)) - -// Restore the default behavior: -environmentManager.setIsServer(() => isServer) +environmentManager.setIsServer(() => false) ``` diff --git a/docs/framework/lit/reference/variables/environmentManager.md b/docs/framework/lit/reference/variables/environmentManager.md index e207cfd2484..ed333b8747b 100644 --- a/docs/framework/lit/reference/variables/environmentManager.md +++ b/docs/framework/lit/reference/variables/environmentManager.md @@ -10,10 +10,13 @@ const environmentManager: object; Defined in: [packages/query-core/src/environmentManager.ts:29](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L29) Manages how TanStack Query detects whether the current runtime should be treated as -server-side. By default, this uses the same detection as the exported `isServer` utility. +server-side, which disables scheduling refetch timers and changes the default `retry` count +and `gcTime`. By default, the detection treats a missing `window` (or the presence of a +`Deno` global) as server. -Override this for runtimes that are not traditional browser/server environments (e.g. -extension workers), where the default detection would give the wrong answer. +Override this for runtimes where that default detection would give the wrong answer — for +example, a Service Worker, where `window` is undefined even though the environment should +behave like a client. ## Type Declaration @@ -50,10 +53,7 @@ Overrides the server check globally. ## Example ```ts -import { environmentManager, isServer } from '@tanstack/query-core' +import { environmentManager } from '@tanstack/query-core' -environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis)) - -// Restore the default behavior: -environmentManager.setIsServer(() => isServer) +environmentManager.setIsServer(() => false) ``` diff --git a/docs/framework/preact/reference/variables/environmentManager.md b/docs/framework/preact/reference/variables/environmentManager.md index e207cfd2484..ed333b8747b 100644 --- a/docs/framework/preact/reference/variables/environmentManager.md +++ b/docs/framework/preact/reference/variables/environmentManager.md @@ -10,10 +10,13 @@ const environmentManager: object; Defined in: [packages/query-core/src/environmentManager.ts:29](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L29) Manages how TanStack Query detects whether the current runtime should be treated as -server-side. By default, this uses the same detection as the exported `isServer` utility. +server-side, which disables scheduling refetch timers and changes the default `retry` count +and `gcTime`. By default, the detection treats a missing `window` (or the presence of a +`Deno` global) as server. -Override this for runtimes that are not traditional browser/server environments (e.g. -extension workers), where the default detection would give the wrong answer. +Override this for runtimes where that default detection would give the wrong answer — for +example, a Service Worker, where `window` is undefined even though the environment should +behave like a client. ## Type Declaration @@ -50,10 +53,7 @@ Overrides the server check globally. ## Example ```ts -import { environmentManager, isServer } from '@tanstack/query-core' +import { environmentManager } from '@tanstack/query-core' -environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis)) - -// Restore the default behavior: -environmentManager.setIsServer(() => isServer) +environmentManager.setIsServer(() => false) ``` diff --git a/docs/framework/react/reference/variables/environmentManager.md b/docs/framework/react/reference/variables/environmentManager.md index 6eaa20da4f3..c1e4abc429a 100644 --- a/docs/framework/react/reference/variables/environmentManager.md +++ b/docs/framework/react/reference/variables/environmentManager.md @@ -12,10 +12,13 @@ const environmentManager: object; Defined in: [packages/query-core/src/environmentManager.ts:29](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L29) Manages how TanStack Query detects whether the current runtime should be treated as -server-side. By default, this uses the same detection as the exported `isServer` utility. +server-side, which disables scheduling refetch timers and changes the default `retry` count +and `gcTime`. By default, the detection treats a missing `window` (or the presence of a +`Deno` global) as server. -Override this for runtimes that are not traditional browser/server environments (e.g. -extension workers), where the default detection would give the wrong answer. +Override this for runtimes where that default detection would give the wrong answer — for +example, a Service Worker, where `window` is undefined even though the environment should +behave like a client. ## Type Declaration @@ -52,10 +55,7 @@ Overrides the server check globally. ## Example ```ts -import { environmentManager, isServer } from '@tanstack/query-core' +import { environmentManager } from '@tanstack/query-core' -environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis)) - -// Restore the default behavior: -environmentManager.setIsServer(() => isServer) +environmentManager.setIsServer(() => false) ``` diff --git a/docs/framework/solid/reference/variables/environmentManager.md b/docs/framework/solid/reference/variables/environmentManager.md index e207cfd2484..ed333b8747b 100644 --- a/docs/framework/solid/reference/variables/environmentManager.md +++ b/docs/framework/solid/reference/variables/environmentManager.md @@ -10,10 +10,13 @@ const environmentManager: object; Defined in: [packages/query-core/src/environmentManager.ts:29](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L29) Manages how TanStack Query detects whether the current runtime should be treated as -server-side. By default, this uses the same detection as the exported `isServer` utility. +server-side, which disables scheduling refetch timers and changes the default `retry` count +and `gcTime`. By default, the detection treats a missing `window` (or the presence of a +`Deno` global) as server. -Override this for runtimes that are not traditional browser/server environments (e.g. -extension workers), where the default detection would give the wrong answer. +Override this for runtimes where that default detection would give the wrong answer — for +example, a Service Worker, where `window` is undefined even though the environment should +behave like a client. ## Type Declaration @@ -50,10 +53,7 @@ Overrides the server check globally. ## Example ```ts -import { environmentManager, isServer } from '@tanstack/query-core' +import { environmentManager } from '@tanstack/query-core' -environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis)) - -// Restore the default behavior: -environmentManager.setIsServer(() => isServer) +environmentManager.setIsServer(() => false) ``` diff --git a/docs/framework/svelte/reference/variables/environmentManager.md b/docs/framework/svelte/reference/variables/environmentManager.md index e207cfd2484..ed333b8747b 100644 --- a/docs/framework/svelte/reference/variables/environmentManager.md +++ b/docs/framework/svelte/reference/variables/environmentManager.md @@ -10,10 +10,13 @@ const environmentManager: object; Defined in: [packages/query-core/src/environmentManager.ts:29](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L29) Manages how TanStack Query detects whether the current runtime should be treated as -server-side. By default, this uses the same detection as the exported `isServer` utility. +server-side, which disables scheduling refetch timers and changes the default `retry` count +and `gcTime`. By default, the detection treats a missing `window` (or the presence of a +`Deno` global) as server. -Override this for runtimes that are not traditional browser/server environments (e.g. -extension workers), where the default detection would give the wrong answer. +Override this for runtimes where that default detection would give the wrong answer — for +example, a Service Worker, where `window` is undefined even though the environment should +behave like a client. ## Type Declaration @@ -50,10 +53,7 @@ Overrides the server check globally. ## Example ```ts -import { environmentManager, isServer } from '@tanstack/query-core' +import { environmentManager } from '@tanstack/query-core' -environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis)) - -// Restore the default behavior: -environmentManager.setIsServer(() => isServer) +environmentManager.setIsServer(() => false) ``` diff --git a/docs/framework/vue/reference/variables/environmentManager.md b/docs/framework/vue/reference/variables/environmentManager.md index e207cfd2484..ed333b8747b 100644 --- a/docs/framework/vue/reference/variables/environmentManager.md +++ b/docs/framework/vue/reference/variables/environmentManager.md @@ -10,10 +10,13 @@ const environmentManager: object; Defined in: [packages/query-core/src/environmentManager.ts:29](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L29) Manages how TanStack Query detects whether the current runtime should be treated as -server-side. By default, this uses the same detection as the exported `isServer` utility. +server-side, which disables scheduling refetch timers and changes the default `retry` count +and `gcTime`. By default, the detection treats a missing `window` (or the presence of a +`Deno` global) as server. -Override this for runtimes that are not traditional browser/server environments (e.g. -extension workers), where the default detection would give the wrong answer. +Override this for runtimes where that default detection would give the wrong answer — for +example, a Service Worker, where `window` is undefined even though the environment should +behave like a client. ## Type Declaration @@ -50,10 +53,7 @@ Overrides the server check globally. ## Example ```ts -import { environmentManager, isServer } from '@tanstack/query-core' +import { environmentManager } from '@tanstack/query-core' -environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis)) - -// Restore the default behavior: -environmentManager.setIsServer(() => isServer) +environmentManager.setIsServer(() => false) ``` diff --git a/packages/query-core/src/environmentManager.ts b/packages/query-core/src/environmentManager.ts index 6a5d8ec20b5..b8adefd0e7d 100644 --- a/packages/query-core/src/environmentManager.ts +++ b/packages/query-core/src/environmentManager.ts @@ -11,19 +11,19 @@ export const isServer = (): boolean => isServerFn() /** * Manages how TanStack Query detects whether the current runtime should be treated as - * server-side. By default, this uses the same detection as the exported `isServer` utility. + * server-side, which disables scheduling refetch timers and changes the default `retry` count + * and `gcTime`. By default, the detection treats a missing `window` (or the presence of a + * `Deno` global) as server. * - * Override this for runtimes that are not traditional browser/server environments (e.g. - * extension workers), where the default detection would give the wrong answer. + * Override this for runtimes where that default detection would give the wrong answer — for + * example, a Service Worker, where `window` is undefined even though the environment should + * behave like a client. * * @example * ```ts - * import { environmentManager, isServer } from '@tanstack/query-core' + * import { environmentManager } from '@tanstack/query-core' * - * environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis)) - * - * // Restore the default behavior: - * environmentManager.setIsServer(() => isServer) + * environmentManager.setIsServer(() => false) * ``` */ export const environmentManager = {